Fix multisource and demod lifecycle issues #758
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: Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| workflow_dispatch: {} | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| # Frontend type checking | |
| frontend-typecheck: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js 26.x | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
| with: | |
| node-version: 26.x | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci --legacy-peer-deps | |
| - name: Run linting | |
| run: npm run lint | |
| - name: Run type checking | |
| run: npm run typecheck | |
| - name: Check module reachability and script targets | |
| run: npm run lint:structure | |
| # Frontend tests | |
| frontend-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js 26.x | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
| with: | |
| node-version: 26.x | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci --legacy-peer-deps | |
| - name: Run all frontend tests | |
| run: npm test | |
| - name: Upload coverage reports | |
| uses: codecov/codecov-action@0f8570b1a125f4937846a11fcfa3bcd548bd8c97 # v4.6.0 | |
| with: | |
| file: ./coverage/lcov.info | |
| flags: frontend | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: false | |
| # Rust tests | |
| rust-tests: | |
| runs-on: ubuntu-latest | |
| services: | |
| redis: | |
| image: redis | |
| ports: | |
| - 6379:6379 | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install system dependencies | |
| run: sudo apt-get update && sudo apt-get install -y librtlsdr-dev redis-server | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable | |
| - name: Install cargo-nextest | |
| run: cargo install cargo-nextest --locked | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@aa7c1c80a07a27a84c0aa76d0cef0aad3830e330 # v2.7.8 | |
| with: | |
| workspaces: . | |
| cache-on-failure: true | |
| - name: Compile check (warnings are errors) | |
| run: RUSTFLAGS="-D warnings" cargo check --workspace --all-targets | |
| - name: Run Rust tests | |
| run: | | |
| all_tests=( | |
| authentication_tests | |
| capture_stitch_tests | |
| device_stream_frozen_tests | |
| encryption_e2e_tests | |
| fft_processor_tests | |
| frequency_scaling_e2e | |
| frequency_validation_tests | |
| iq_capture_integration_tests | |
| mock_apt_tests | |
| performance_program_tests | |
| server_tests | |
| ws_message_proptests | |
| yaml_config_proptests | |
| iq_frame_codec_proptests | |
| stream_manager_proptests | |
| stream_command_proptests | |
| ) | |
| run_selected_tests() { | |
| for test_name in "$@"; do | |
| cargo nextest run --test "$test_name" | |
| done | |
| } | |
| run_selected_tests "${all_tests[@]}" | |
| env: | |
| REDIS_URL: redis://localhost:6379 | |
| UNSAFE_LOCAL_USER_PASSWORD: n-apt-dev-key | |
| PROPTEST_SEED: "0xdeadbeef00000001" | |
| - name: Upload Rust coverage | |
| uses: codecov/codecov-action@0f8570b1a125f4937846a11fcfa3bcd548bd8c97 # v4.6.0 | |
| with: | |
| flags: rust | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: false | |
| # Rust Performance Tests (Release mode) | |
| rust-performance-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Install system dependencies | |
| run: sudo apt-get update && sudo apt-get install -y librtlsdr-dev | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@aa7c1c80a07a27a84c0aa76d0cef0aad3830e330 # v2.7.8 | |
| with: | |
| workspaces: . | |
| cache-on-failure: true | |
| - name: Run Rust Performance Tests | |
| run: | | |
| cargo --config .cargo/performance.toml test --test performance_tests --release -- --nocapture | |
| cargo test --test performance_program_tests | |
| - name: Compile report-only uncapped benchmarks | |
| run: cargo bench --bench pipeline_benchmarks --no-run | |
| # WASM tests | |
| wasm-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
| with: | |
| node-version: '26.x' | |
| cache: "npm" | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - name: Install wasm-pack | |
| run: cargo install wasm-pack --locked | |
| - name: Install dependencies | |
| run: npm ci --legacy-peer-deps | |
| - name: Run WASM tests | |
| run: npm run test:wasm | |
| # Integration tests | |
| integration-tests: | |
| runs-on: ubuntu-latest | |
| services: | |
| redis: | |
| image: redis | |
| ports: | |
| - 6379:6379 | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
| with: | |
| node-version: '26.x' | |
| cache: "npm" | |
| - name: Install system dependencies | |
| run: sudo apt-get update && sudo apt-get install -y librtlsdr-dev | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@aa7c1c80a07a27a84c0aa76d0cef0aad3830e330 # v2.7.8 | |
| with: | |
| workspaces: . | |
| cache-on-failure: true | |
| - name: Install dependencies | |
| run: npm ci --legacy-peer-deps | |
| - name: Build WASM | |
| run: npm run build:wasm | |
| - name: Build Rust Backend | |
| run: npm run build:rust | |
| - name: Generate Encrypted Test Artifacts | |
| run: cargo test --test encryption_e2e_tests generate_test_artifacts -- --nocapture | |
| - name: Run all integration tests | |
| run: npm run test:integration | |
| env: | |
| REDIS_URL: redis://localhost:6379 | |
| UNSAFE_LOCAL_USER_PASSWORD: n-apt-dev-key |