|
| 1 | +name: CI |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: [main, android] |
| 5 | + pull_request: |
| 6 | + |
| 7 | +env: |
| 8 | + CARGO_TERM_COLOR: always |
| 9 | + RUST_BACKTRACE: 1 |
| 10 | + |
| 11 | +jobs: |
| 12 | + check: |
| 13 | + name: Check & Clippy |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v4 |
| 17 | + - uses: dtolnay/rust-toolchain@stable |
| 18 | + - uses: Swatinem/rust-cache@v2 |
| 19 | + - name: Install system deps |
| 20 | + run: > |
| 21 | + sudo apt-get update && sudo apt-get install -y |
| 22 | + libasound2-dev libpipewire-0.3-dev libclang-dev |
| 23 | + libegl-dev libgbm-dev libdrm-dev |
| 24 | + nasm |
| 25 | + - run: cargo check --workspace --all-targets |
| 26 | + - run: cargo clippy --workspace --all-targets -- -D warnings |
| 27 | + |
| 28 | + fmt: |
| 29 | + name: Format |
| 30 | + runs-on: ubuntu-latest |
| 31 | + steps: |
| 32 | + - uses: actions/checkout@v4 |
| 33 | + - uses: dtolnay/rust-toolchain@stable |
| 34 | + with: |
| 35 | + components: rustfmt |
| 36 | + - run: cargo fmt --check |
| 37 | + |
| 38 | + test: |
| 39 | + name: Rust Tests |
| 40 | + runs-on: ubuntu-latest |
| 41 | + steps: |
| 42 | + - uses: actions/checkout@v4 |
| 43 | + - uses: dtolnay/rust-toolchain@stable |
| 44 | + - uses: Swatinem/rust-cache@v2 |
| 45 | + - name: Install system deps |
| 46 | + run: > |
| 47 | + sudo apt-get update && sudo apt-get install -y |
| 48 | + libasound2-dev libpipewire-0.3-dev libclang-dev |
| 49 | + libegl-dev libgbm-dev libdrm-dev |
| 50 | + nasm |
| 51 | + - run: cargo test --workspace |
| 52 | + # Relay bridge tests need serial execution (iroh endpoint contention). |
| 53 | + - run: cargo test -p iroh-live-relay --test relay_bridge -- --test-threads=1 |
| 54 | + |
| 55 | + e2e-browser: |
| 56 | + name: Playwright E2E |
| 57 | + runs-on: ubuntu-latest |
| 58 | + steps: |
| 59 | + - uses: actions/checkout@v4 |
| 60 | + - uses: dtolnay/rust-toolchain@stable |
| 61 | + - uses: Swatinem/rust-cache@v2 |
| 62 | + - name: Install system deps |
| 63 | + run: > |
| 64 | + sudo apt-get update && sudo apt-get install -y |
| 65 | + libasound2-dev libpipewire-0.3-dev libclang-dev |
| 66 | + libegl-dev libgbm-dev libdrm-dev |
| 67 | + nasm |
| 68 | + # Pre-build the relay and examples so compilation doesn't eat into test timeouts. |
| 69 | + - name: Build relay + examples |
| 70 | + run: | |
| 71 | + cargo build -p iroh-live-relay |
| 72 | + cargo build --example publish --example subscribe_test |
| 73 | + - uses: actions/setup-node@v4 |
| 74 | + with: |
| 75 | + node-version: 20 |
| 76 | + - name: Install Playwright |
| 77 | + working-directory: tests/e2e-browser |
| 78 | + run: | |
| 79 | + npm ci |
| 80 | + npx playwright install --with-deps chromium |
| 81 | + - name: Run Playwright tests |
| 82 | + working-directory: tests/e2e-browser |
| 83 | + run: npx playwright test --workers=1 |
| 84 | + - name: Upload test results |
| 85 | + if: failure() |
| 86 | + uses: actions/upload-artifact@v4 |
| 87 | + with: |
| 88 | + name: playwright-results |
| 89 | + path: tests/e2e-browser/test-results/ |
0 commit comments