feat(policy): add RaceWritePolicy implementation #545
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: {} | |
| jobs: | |
| check: | |
| # Run `cargo check` first to ensure that the pushed code at least compiles. | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| rust: [1.89.0, stable] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ matrix.rust }} | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Check | |
| run: cargo check --all --bins --tests --benches | |
| test: | |
| needs: check | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| rust: [1.89.0, stable] | |
| redis-version: [7] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ matrix.rust }} | |
| - uses: Swatinem/rust-cache@v2 | |
| # Install nextest for faster parallel test execution | |
| - name: Install nextest | |
| uses: taiki-e/install-action@nextest | |
| # Starts Redis server needed by hitbox-redis for integration tests. | |
| - name: Start Redis | |
| uses: supercharge/redis-github-action@1.8.0 | |
| with: | |
| redis-version: ${{ matrix.redis-version }} | |
| # Phase 1: Run unit tests with nextest (fast, parallel) | |
| - name: Run unit tests (nextest) | |
| run: cargo nextest run --all --all-features --profile ci | |
| # Phase 2: Run BDD/cucumber integration tests | |
| - name: Run BDD integration tests | |
| run: cargo test --test integration --all-features | |
| - name: Upload unit test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nextest-junit-${{ matrix.rust }}-redis${{ matrix.redis-version }} | |
| path: target/nextest/ci/junit.xml | |
| if-no-files-found: ignore | |
| - name: Upload BDD test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cucumber-junit-${{ matrix.rust }}-redis${{ matrix.redis-version }} | |
| path: target/cucumber-junit.xml | |
| if-no-files-found: ignore | |
| - name: Publish unit test report | |
| if: always() | |
| uses: mikepenz/action-junit-report@v4 | |
| with: | |
| report_paths: "target/nextest/ci/junit.xml" | |
| check_name: "Unit Test Report (${{ matrix.rust }}, Redis ${{ matrix.redis-version }})" | |
| fail_on_failure: true | |
| include_passed: true | |
| detailed_summary: true | |
| - name: Publish BDD test report | |
| if: always() | |
| uses: mikepenz/action-junit-report@v4 | |
| with: | |
| report_paths: "target/cucumber-junit.xml" | |
| check_name: "BDD Test Report (${{ matrix.rust }}, Redis ${{ matrix.redis-version }})" | |
| fail_on_failure: true | |
| include_passed: true | |
| detailed_summary: true | |
| - name: Install llvm-cov | |
| if: matrix.rust == 'stable' && matrix.redis-version == 7 | |
| uses: taiki-e/install-action@cargo-llvm-cov | |
| - name: Generate coverage file | |
| if: matrix.rust == 'stable' && matrix.redis-version == 7 | |
| run: | | |
| cargo llvm-cov --workspace --all-features --lcov --output-path lcov.info \ | |
| --exclude hitbox-test \ | |
| --ignore-filename-regex 'hurl/' | |
| - name: Upload to Codecov | |
| if: matrix.rust == 'stable' && matrix.redis-version == 7 | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: lcov.info | |
| fail_ci_if_error: false | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Upload test results to Codecov | |
| if: ${{ !cancelled() && matrix.rust == 'stable' && matrix.redis-version == 7 }} | |
| uses: codecov/test-results-action@v1 | |
| with: | |
| files: target/nextest/ci/junit.xml,target/cucumber-junit.xml | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| clippy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Clippy | |
| run: cargo clippy --workspace --all-features --bins --examples --tests --benches -- -D warnings | |
| fmt: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - name: Format check | |
| run: cargo fmt --all -- --check | |
| doc: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Documentation | |
| run: cargo doc --workspace --all-features --no-deps | |
| env: | |
| RUSTDOCFLAGS: -D warnings | |
| spellcheck: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Spellcheck | |
| uses: streetsidesoftware/cspell-action@v6 | |
| with: | |
| files: "**/*.rs **/*.md **/*.toml" | |
| config: cspell.json | |
| inline: warning | |
| suggestions: true |