Bump version to 0.2.0-alpha.3 #288
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: Test | |
on: | |
push: | |
pull_request: | |
workflow_call: | |
env: | |
CARGO_TERM_COLOR: always | |
RUST_BACKTRACE: 1 | |
RUSTFLAGS: '-D warnings' | |
jobs: | |
build: | |
name: Build [${{ matrix.runs-on }}, ${{ matrix.rust }}, ${{ matrix.profile }}, ${{ matrix.args }}] | |
runs-on: ${{ matrix.runs-on }} | |
strategy: | |
fail-fast: false | |
matrix: | |
runs-on: [ubuntu-latest, macos-latest] | |
rust: [1.63.0, stable] | |
profile: [dev, release] | |
args: [""] | |
include: | |
- runs-on: ubuntu-latest | |
rust: stable | |
profile: dev | |
args: "--no-default-features" | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ matrix.rust }} | |
profile: minimal | |
override: true | |
- name: Build ${{ matrix.profile }} | |
run: | | |
cargo build --profile=${{ matrix.profile }} ${{ matrix.args }} --lib | |
nop-rebuilds: | |
name: No-op rebuilds | |
runs-on: ubuntu-22.04 | |
env: | |
LLVM_GSYMUTIL: /usr/bin/llvm-gsymutil-14 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
profile: minimal | |
override: true | |
- name: Install required tools | |
run: sudo apt-get install -y llvm-14 | |
- name: Check incremental rebuilds | |
run: | | |
cargo check --features=generate-test-files --quiet --tests | |
# We need another build here to have the reference `output` file | |
# present. As long as we converge eventually it's probably good | |
# enough... | |
cargo check --features=generate-test-files --quiet --tests | |
output=$(CARGO_LOG=cargo::core::compiler::fingerprint=info cargo check --features=generate-test-files --quiet --tests 2>&1) | |
[ -z "${output}" ] || (echo "!!!! cargo check --tests rebuild was not a no-op: ${output} !!!!" && false) | |
test-coverage: | |
name: Test and coverage | |
runs-on: ubuntu-22.04 | |
env: | |
LLVM_GSYMUTIL: /usr/bin/llvm-gsymutil-14 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
profile: minimal | |
override: true | |
- name: Install required tools | |
run: sudo apt-get install -y llvm-14 | |
- name: Install cargo-llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Test and gather coverage | |
run: cargo llvm-cov --all-targets --lcov --output-path lcov.info | |
- name: Upload code coverage results | |
uses: codecov/codecov-action@v3 | |
with: | |
files: lcov.info | |
test-sanitizers: | |
name: Test with ${{ matrix.sanitizer }} sanitizer | |
strategy: | |
fail-fast: false | |
matrix: | |
sanitizer: [address, leak] | |
runs-on: ubuntu-latest | |
env: | |
LLVM_GSYMUTIL: /usr/bin/llvm-gsymutil-14 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
profile: minimal | |
override: true | |
- name: Enable debug symbols | |
run: | | |
# to get the symbolizer for debug symbol resolution | |
sudo apt-get install -y llvm-14 | |
# to fix buggy leak analyzer: | |
# https://github.com/japaric/rust-san#unrealiable-leaksanitizer | |
sed -i '/\[features\]/i [profile.dev]' Cargo.toml | |
sed -i '/profile.dev/a opt-level = 1' Cargo.toml | |
cat Cargo.toml | |
- name: cargo test -Zsanitizer=${{ matrix.sanitizer }} | |
env: | |
CFLAGS: "-fsanitize=${{ matrix.sanitizer }}" | |
CXXFLAGS: "-fsanitize=${{ matrix.sanitizer }}" | |
RUSTFLAGS: "-Zsanitizer=${{ matrix.sanitizer }}" | |
ASAN_OPTIONS: "detect_odr_violation=0:detect_leaks=0" | |
LSAN_OPTIONS: "" | |
run: cargo test --lib --tests --target x86_64-unknown-linux-gnu | |
test-release: | |
name: Test with release build | |
runs-on: ubuntu-22.04 | |
env: | |
LLVM_GSYMUTIL: /usr/bin/llvm-gsymutil-14 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install required tools | |
run: sudo apt-get install -y llvm-14 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
override: true | |
- run: cargo test --release | |
c-header: | |
name: Check generated C header | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
override: true | |
- run: cargo check --features=generate-c-header | |
- name: Check that C header is up-to-date | |
run: git diff --exit-code || | |
(echo "!!!! CHECKED IN C HEADER IS OUTDATED !!!!" && false) | |
bench: | |
name: Benchmark | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
profile: minimal | |
override: true | |
- run: cargo bench --features=nightly,dont-generate-test-files | |
clippy: | |
name: Lint with clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
components: clippy | |
override: true | |
- run: cargo clippy --no-deps --bins --lib --examples --tests --features=dont-generate-test-files -- -A unknown_lints | |
rustfmt: | |
name: Check code formatting | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
profile: minimal | |
components: rustfmt | |
override: true | |
- run: cargo +nightly fmt -- --check | |
cargo-doc: | |
name: Generate documentation | |
runs-on: ubuntu-latest | |
env: | |
RUSTDOCFLAGS: '-D warnings' | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
override: true | |
- run: cargo doc --no-deps |