fix: split e2e into parallel CI job, fix stale netsim references #28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| ci: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy, rustfmt | |
| - uses: taiki-e/install-action@cargo-make | |
| - uses: taiki-e/install-action@nextest | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-on-failure: true | |
| - name: Install iperf3 | |
| run: sudo apt-get update && sudo apt-get install -y iperf3 | |
| - name: Enable unprivileged user namespaces | |
| run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 | |
| - name: Build | |
| run: cargo build --workspace --all-targets | |
| - name: Test | |
| run: cargo nextest run --workspace --profile ci | |
| - name: Clippy | |
| run: cargo clippy --workspace --tests -- -D warnings | |
| - name: Format | |
| run: cargo make format-check | |
| e2e: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-on-failure: true | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: npm | |
| cache-dependency-path: ui/package-lock.json | |
| - name: Install UI dependencies | |
| working-directory: ui | |
| run: npm ci | |
| - name: Build UI bundle | |
| working-directory: ui | |
| run: npm run build | |
| - name: Get Playwright version | |
| id: pw-version | |
| working-directory: ui | |
| run: echo "version=$(node -e "console.log(require('./node_modules/@playwright/test/package.json').version)")" >> "$GITHUB_OUTPUT" | |
| - uses: actions/cache@v4 | |
| id: pw-cache | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: playwright-${{ steps.pw-version.outputs.version }}-chromium | |
| - name: Install Playwright browser | |
| working-directory: ui | |
| run: npx playwright install --with-deps chromium | |
| if: steps.pw-cache.outputs.cache-hit != 'true' | |
| - name: Install Playwright system deps | |
| working-directory: ui | |
| run: npx playwright install-deps chromium | |
| if: steps.pw-cache.outputs.cache-hit == 'true' | |
| - name: Install iperf3 | |
| run: sudo apt-get update && sudo apt-get install -y iperf3 | |
| - name: Enable unprivileged user namespaces | |
| run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 | |
| - name: Build Rust (bins + test targets) | |
| run: cargo build --workspace --all-targets | |
| - name: UI E2E | |
| working-directory: ui | |
| run: npm run test:e2e |