Merge pull request #1218 from akoshelev/mac-validate-record #1122
This file contains 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: | |
paths: | |
- "**/Cargo.toml" | |
- "**/Cargo.lock" | |
- "ipa-*/src/**/*" | |
- "ipa-core/benches/**/*" | |
- "ipa-core/tests/**/*" | |
- ".github/**/*" | |
pull_request: | |
paths: | |
- "**/Cargo.toml" | |
- "**/Cargo.lock" | |
- "ipa-*/src/**/*" | |
- "ipa-core/benches/**/*" | |
- "ipa-core/tests/**/*" | |
- ".github/**/*" | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always | |
RUSTFLAGS: -D warnings | |
RUSTDOCFLAGS: -D warnings | |
jobs: | |
basic: | |
name: Basic Checks | |
env: | |
CARGO_INCREMENTAL: 0 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/rm | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy,rustfmt | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }} | |
- name: Check formatting | |
run: cargo fmt --all -- --check --config "imports_granularity=Crate,group_imports=StdExternalCrate" | |
- name: Clippy | |
if: ${{ success() || failure() }} | |
run: cargo clippy --tests | |
- name: Clippy concurrency tests | |
if: ${{ success() || failure() }} | |
run: cargo clippy --tests --features shuttle | |
- name: Clippy web | |
if: ${{ success() || failure() }} | |
run: cargo clippy --no-default-features --features "cli web-app real-world-infra test-fixture compact-gate" | |
- name: Build | |
if: ${{ success() || failure() }} | |
run: cargo build --tests | |
- name: Run tests | |
run: cargo test | |
- name: Run tests with multithreading feature enabled | |
run: cargo test --features "multi-threading" | |
- name: Run Web Tests | |
run: cargo test -p ipa-core --no-default-features --features "cli web-app real-world-infra test-fixture compact-gate" | |
release: | |
name: Release builds and tests | |
runs-on: ubuntu-latest | |
env: | |
RUSTFLAGS: -C target-cpu=native | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/rm | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy,rustfmt | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }} | |
- name: Release Build | |
run: cargo build --release | |
- name: Build concurrency tests | |
run: cargo build --release --features "shuttle multi-threading" | |
- name: Run concurrency tests | |
run: cargo test --release --features "shuttle multi-threading" | |
extra: | |
name: Additional Builds and Concurrency Tests | |
env: | |
RUSTFLAGS: -D warnings -C target-cpu=native | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/rm | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy,rustfmt | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }} | |
- name: Build benchmarks | |
run: cargo build --benches --no-default-features --features "enable-benches compact-gate" | |
- name: Build concurrency tests (debug mode) | |
run: cargo build --features shuttle | |
- name: Run IPA bench | |
run: cargo bench --bench oneshot_ipa --no-default-features --features "enable-benches compact-gate" | |
- name: Run arithmetic bench | |
run: cargo bench --bench oneshot_arithmetic --no-default-features --features "enable-benches compact-gate" | |
- name: Run compact gate tests | |
run: cargo test --no-default-features --features "cli web-app real-world-infra test-fixture compact-gate" | |
slow: | |
name: Slow tests | |
env: | |
EXEC_SLOW_TESTS: 1 | |
RUSTFLAGS: -C target-cpu=native | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/rm | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }} | |
- name: End-to-end tests | |
run: cargo test --release --test "*" --no-default-features --features "cli web-app real-world-infra test-fixture compact-gate" | |
# sanitizers currently require nightly https://github.com/rust-lang/rust/issues/39699 | |
sanitize: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
sanitizer: [address, leak] | |
features: ['', 'multi-threading'] | |
env: | |
TARGET: x86_64-unknown-linux-gnu | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/rm | |
- uses: dtolnay/rust-toolchain@nightly | |
- name: Add Rust sources | |
run: rustup component add rust-src | |
- name: Run tests with sanitizer | |
run: RUSTFLAGS="-Z sanitizer=${{ matrix.sanitizer }} -Z sanitizer-memory-track-origins" cargo test -Z build-std --target $TARGET --no-default-features --features "cli web-app real-world-infra test-fixture compact-gate ${{ matrix.features }}" | |
miri: | |
runs-on: ubuntu-latest | |
env: | |
TARGET: x86_64-unknown-linux-gnu | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/rm | |
- uses: dtolnay/rust-toolchain@nightly | |
- name: Add Miri | |
run: rustup component add miri | |
- name: Setup Miri | |
run: cargo miri setup | |
- name: Run seq_join tests | |
run: cargo miri test --target $TARGET --lib seq_join --features "multi-threading" | |
coverage: | |
name: Measure coverage | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- uses: ./.github/actions/rm | |
- name: Install rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: llvm-tools | |
- name: Install cargo-llvm-cov | |
run: cargo install cargo-llvm-cov | |
- name: Measure coverage | |
run: ./scripts/coverage-ci --lcov --output-path ipa.cov | |
- name: Report to codecov.io | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ipa.cov | |
fail_ci_if_error: false | |