Skip to content

Improve CI

Improve CI #125

Workflow file for this run

name: Rust
env:
RUSTFLAGS: -Dwarnings
RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
CARGO_UNSTABLE_SPARSE_REGISTRY: true
on:
push:
paths-ignore:
- 'README.md'
- 'LICENSE'
- '.gitignore'
pull_request:
paths-ignore:
- 'README.md'
- 'LICENSE'
- '.gitignore'
jobs:
check_format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check format
run: cargo fmt --all -- --check
Run_clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- name: Run clippy
run: cargo clippy --all --all-features --no-deps
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- name: Run tests
run: cargo test
test-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- name: Run tests
run: cargo test --release
test-sanitize-address:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install latest nightly
run: |
rustup toolchain install nightly --no-self-update --profile minimal
rustup default nightly
- uses: Swatinem/rust-cache@v2
- name: Run tests
run: cargo +nightly test
env:
RUSTFLAGS: -Zsanitizer=address ${{ env.RUSTFLAGS }}
RUSTDOCFLAGS: -Zsanitizer=address ${{ env.RUSTFLAGS }}
test-sanitize-thread:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install latest nightly
run: |
rustup toolchain install nightly --component rust-src --no-self-update --profile minimal
rustup default nightly
- uses: Swatinem/rust-cache@v2
- name: Run tests
run: |
cargo +nightly test \
-Z build-std \
--target "$(rustc -vV | grep host | cut -d : -f 2 | tr -d '[:space:]')" \
--features thread-sanitizer
env:
RUSTFLAGS: -Zsanitizer=thread ${{ env.RUSTFLAGS }}
RUSTDOCFLAGS: -Zsanitizer=thread ${{ env.RUSTFLAGS }}