Merge pull request #39 from SunSunSun689/week10 #45
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: | |
| check: | |
| name: cargo check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - run: cargo check | |
| test: | |
| name: cargo test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| # Deferred-init NodeHarness feeds baked events via TestingInput::Input — | |
| # no live channel, no daemon-thread deadlock (dora-rs/dora#2855). | |
| # Tests run with default parallelism; e2e/smoke are fast (<0.02s each). | |
| - run: cargo test --lib | |
| - run: cargo test --test e2e | |
| - run: cargo test --test smoke | |
| clippy: | |
| name: cargo clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - run: cargo clippy -- -D warnings | |
| fmt: | |
| name: cargo fmt | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - run: cargo fmt --check | |
| integration-test: | |
| name: cargo test --integration | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| # DORA CLI is needed for `dora run` in integration + record tests. | |
| # dora-node-api is pulled as a git dep (Cargo.toml) — no patch needed. | |
| - run: git clone https://github.com/dora-rs/dora.git dora && git -C dora checkout 45436aad124fe46463d0b0411e3922dae8ee9ebd | |
| working-directory: ${{ github.workspace }} | |
| # Cache dora build artifacts — keyed on dora source hash so the | |
| # cache hits every run after the first (commit is locked). | |
| - uses: actions/cache@v4 | |
| with: | |
| path: dora/target | |
| key: dora-target-${{ runner.os }}-${{ hashFiles('dora/**/*.rs', 'dora/**/Cargo.toml') }} | |
| # Build the dora CLI (binary lives in binaries/cli, not workspace root). | |
| # PYO3_NO_PYTHON=1 skips Python version detection — the CLI's default | |
| # features don't include Python support, and CI doesn't need it. | |
| - run: PYO3_NO_PYTHON=1 cargo build --bin dora --manifest-path dora/binaries/cli/Cargo.toml | |
| # Build our test binaries first (integration test expects them pre-built). | |
| - run: cargo build --bin test-source --bin test-sink --bin echo-node --bin classifier-node | |
| # Run integration tests serially (dora daemon binds port 6013). | |
| - run: cargo test --test integration -- --test-threads=1 | |
| # Record/replay e2e tests (need dora CLI + test binaries built above). | |
| - run: timeout 120 cargo test --test e2e_record -- --test-threads=1 | |
| - run: timeout 120 cargo test --test e2e_replay -- --test-threads=1 |