2023-06-19 16:21:53 +02:00
|
|
|
name: Build and Test
|
2023-04-04 16:43:53 +02:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2024-07-24 13:58:19 +02:00
|
|
|
branches: ["main"]
|
2023-04-04 16:43:53 +02:00
|
|
|
pull_request:
|
2024-07-24 13:58:19 +02:00
|
|
|
branches: ["main", "dev"]
|
2023-04-04 16:43:53 +02:00
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
2023-11-19 23:15:12 +01:00
|
|
|
linux:
|
2023-04-04 16:43:53 +02:00
|
|
|
runs-on: ubuntu-latest
|
2024-04-16 17:40:38 +02:00
|
|
|
timeout-minutes: 30
|
2023-04-04 16:43:53 +02:00
|
|
|
steps:
|
2024-07-24 13:58:19 +02:00
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Clone spacebar server
|
|
|
|
run: |
|
|
|
|
git clone https://github.com/bitfl0wer/server.git
|
|
|
|
- uses: actions/setup-node@v4
|
|
|
|
with:
|
2023-08-25 21:30:07 +02:00
|
|
|
node-version: 18
|
2024-07-24 13:58:19 +02:00
|
|
|
cache: "npm"
|
2023-07-14 11:58:12 +02:00
|
|
|
cache-dependency-path: server/package-lock.json
|
2024-07-24 13:58:19 +02:00
|
|
|
- name: Prepare and start Spacebar server
|
|
|
|
run: |
|
|
|
|
npm install
|
|
|
|
npm run setup
|
|
|
|
npm run start &
|
|
|
|
working-directory: ./server
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
|
|
with:
|
|
|
|
cache-all-crates: "true"
|
|
|
|
prefix-key: "linux"
|
|
|
|
- uses: taiki-e/install-action@nextest
|
|
|
|
- name: Build, Test with nextest, Publish Coverage
|
|
|
|
run: |
|
|
|
|
if [ -n "${{ secrets.COVERALLS_REPO_TOKEN }}" ]; then
|
|
|
|
if [ "${{github.event.pull_request.head.ref}}" = "main" ]; then
|
|
|
|
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
|
|
|
|
cargo binstall --no-confirm cargo-tarpaulin --force
|
|
|
|
cargo tarpaulin --all-features --avoid-cfg-tarpaulin --tests --verbose --skip-clean --coveralls ${{ secrets.COVERALLS_REPO_TOKEN }} --timeout 120
|
|
|
|
else
|
|
|
|
echo "Code Coverage step is skipped on non-main PRs and PRs from forks."
|
|
|
|
cargo nextest run --verbose --all-features
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "Code Coverage step is skipped on non-main PRs and PRs from forks."
|
|
|
|
cargo nextest run --verbose --all-features
|
|
|
|
fi
|
2024-07-24 16:09:25 +02:00
|
|
|
linux-non-default-features:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 10
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
2024-07-24 13:58:19 +02:00
|
|
|
- name: Check common non-default feature configurations
|
|
|
|
run: |
|
|
|
|
echo "No features:"
|
|
|
|
cargo check --features="" --no-default-features
|
|
|
|
echo "Only client:"
|
|
|
|
cargo check --features="client" --no-default-features
|
|
|
|
echo "Only backend:"
|
|
|
|
cargo check --features="backend" --no-default-features
|
|
|
|
echo "Only voice:"
|
|
|
|
cargo check --features="voice" --no-default-features
|
|
|
|
echo "Only voice gateway:"
|
|
|
|
cargo check --features="voice_gateway" --no-default-features
|
|
|
|
echo "Backend + client:"
|
|
|
|
cargo check --features="backend, client" --no-default-features
|
|
|
|
echo "Backend + voice:"
|
|
|
|
cargo check --features="backend, voice" --no-default-features
|
|
|
|
echo "Backend + voice gateway:"
|
|
|
|
cargo check --features="backend, voice_gateway" --no-default-features
|
|
|
|
echo "Client + voice gateway:"
|
|
|
|
cargo check --features="client, voice_gateway" --no-default-features
|
2023-11-22 15:13:26 +01:00
|
|
|
wasm-gecko:
|
2024-06-02 19:28:02 +02:00
|
|
|
runs-on: ubuntu-latest
|
2024-04-16 17:40:38 +02:00
|
|
|
timeout-minutes: 30
|
2023-11-22 15:13:26 +01:00
|
|
|
steps:
|
2024-07-24 13:58:19 +02:00
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Clone spacebar server
|
|
|
|
run: |
|
|
|
|
git clone https://github.com/bitfl0wer/server.git
|
|
|
|
- uses: actions/setup-node@v4
|
|
|
|
with:
|
2023-11-22 15:13:26 +01:00
|
|
|
node-version: 18
|
2024-07-24 13:58:19 +02:00
|
|
|
cache: "npm"
|
2023-11-22 15:13:26 +01:00
|
|
|
cache-dependency-path: server/package-lock.json
|
2024-07-24 13:58:19 +02:00
|
|
|
- name: Prepare and start Spacebar server
|
|
|
|
run: |
|
|
|
|
npm install
|
|
|
|
npm run setup
|
|
|
|
npm run start &
|
|
|
|
working-directory: ./server
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
|
|
with:
|
|
|
|
cache-all-crates: "true"
|
|
|
|
prefix-key: "macos"
|
|
|
|
- name: Run WASM tests with Safari, Firefox, Chrome
|
|
|
|
run: |
|
|
|
|
rustup target add wasm32-unknown-unknown
|
|
|
|
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
|
2024-08-21 23:43:42 +02:00
|
|
|
cargo binstall --no-confirm wasm-bindgen-cli --version "0.2.93" --force
|
2024-07-24 16:17:00 +02:00
|
|
|
GECKODRIVER=$(which geckodriver) cargo test --target wasm32-unknown-unknown --no-default-features --features="client, rt, voice_gateway"
|
2023-11-22 15:13:26 +01:00
|
|
|
wasm-chrome:
|
2024-06-23 17:23:13 +02:00
|
|
|
runs-on: ubuntu-latest
|
2024-04-16 17:40:38 +02:00
|
|
|
timeout-minutes: 30
|
2023-11-22 15:13:26 +01:00
|
|
|
steps:
|
2024-07-24 13:58:19 +02:00
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Clone spacebar server
|
|
|
|
run: |
|
|
|
|
git clone https://github.com/bitfl0wer/server.git
|
|
|
|
- uses: actions/setup-node@v4
|
|
|
|
with:
|
2023-11-22 15:13:26 +01:00
|
|
|
node-version: 18
|
2024-07-24 13:58:19 +02:00
|
|
|
cache: "npm"
|
2023-11-22 15:13:26 +01:00
|
|
|
cache-dependency-path: server/package-lock.json
|
2024-07-24 13:58:19 +02:00
|
|
|
- name: Prepare and start Spacebar server
|
|
|
|
run: |
|
|
|
|
npm install
|
|
|
|
npm run setup
|
|
|
|
npm run start &
|
|
|
|
working-directory: ./server
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
|
|
with:
|
|
|
|
cache-all-crates: "true"
|
|
|
|
prefix-key: "macos"
|
|
|
|
- name: Run WASM tests with Safari, Firefox, Chrome
|
|
|
|
run: |
|
|
|
|
rustup target add wasm32-unknown-unknown
|
|
|
|
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
|
2024-08-21 23:43:42 +02:00
|
|
|
cargo binstall --no-confirm wasm-bindgen-cli --version "0.2.93" --force
|
2024-07-24 16:17:00 +02:00
|
|
|
CHROMEDRIVER=$(which chromedriver) cargo test --target wasm32-unknown-unknown --no-default-features --features="client, rt, voice_gateway"
|