CI #18
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 | |
permissions: | |
contents: read | |
on: | |
pull_request: | |
push: | |
branches: | |
- crossbeam-skiplist-fd | |
schedule: | |
- cron: '0 1 * * *' | |
env: | |
CARGO_INCREMENTAL: 0 | |
CARGO_NET_GIT_FETCH_WITH_CLI: true | |
CARGO_NET_RETRY: 10 | |
CARGO_TERM_COLOR: always | |
RUST_BACKTRACE: 1 | |
RUSTDOCFLAGS: -D warnings | |
RUSTFLAGS: -D warnings | |
RUSTUP_MAX_RETRIES: 10 | |
defaults: | |
run: | |
shell: bash | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
# Test crates on their minimum Rust versions and nightly Rust. | |
test: | |
env: | |
RUST_VERSION: ${{ matrix.rust }} | |
RUST_TARGET: ${{ matrix.target }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- rust: '1.81' | |
os: ubuntu-latest | |
- rust: '1.81' | |
os: windows-latest | |
- rust: stable | |
os: ubuntu-latest | |
- rust: stable | |
os: windows-latest | |
- rust: nightly | |
os: ubuntu-latest | |
- rust: nightly | |
os: windows-latest | |
- rust: nightly | |
os: ubuntu-latest | |
target: i686-unknown-linux-gnu | |
- rust: nightly | |
os: ubuntu-latest | |
target: armv7-unknown-linux-gnueabihf | |
# Test 32-bit target that does not have AtomicU64/AtomicI64. | |
- rust: nightly | |
os: ubuntu-latest | |
target: armv5te-unknown-linux-gnueabi | |
# Test target without stable inline asm support. | |
- rust: stable | |
os: ubuntu-latest | |
target: sparc64-unknown-linux-gnu | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 60 | |
steps: | |
- uses: taiki-e/checkout-action@v1 | |
- name: Install Rust | |
# --no-self-update is necessary because the windows environment cannot self-update rustup.exe. | |
run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }} | |
- uses: taiki-e/setup-cross-toolchain-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
if: matrix.target != '' | |
- name: Test | |
run: ci/test.sh | |
# Check all feature combinations works properly. | |
features: | |
env: | |
RUST_VERSION: ${{ matrix.rust }} | |
strategy: | |
fail-fast: false | |
matrix: | |
rust: | |
- msrv | |
- nightly | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
steps: | |
- uses: taiki-e/checkout-action@v1 | |
- name: Install Rust | |
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }} | |
if: matrix.rust != 'msrv' | |
- name: Install cargo-hack | |
uses: taiki-e/install-action@cargo-hack | |
- name: Check features | |
run: ci/check-features.sh | |
# Check for duplicate dependencies. | |
dependencies: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
steps: | |
- uses: taiki-e/checkout-action@v1 | |
- name: Install Rust | |
run: rustup update nightly && rustup default nightly | |
- name: Install cargo-hack | |
uses: taiki-e/install-action@cargo-hack | |
- name: Install cargo-minimal-versions | |
uses: taiki-e/install-action@cargo-minimal-versions | |
- name: dependency tree check | |
run: ci/dependencies.sh | |
# Check formatting. | |
rustfmt: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
steps: | |
- uses: taiki-e/checkout-action@v1 | |
- name: Install Rust | |
run: rustup update stable | |
- name: rustfmt | |
run: cargo fmt --all --check | |
# Check clippy. | |
clippy: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
steps: | |
- uses: taiki-e/checkout-action@v1 | |
- name: Install Rust | |
run: rustup update stable | |
- name: clippy | |
run: cargo clippy --all --all-features --tests --examples | |
# Run miri. | |
miri: | |
strategy: | |
fail-fast: false | |
matrix: | |
group: | |
- others | |
runs-on: ubuntu-latest | |
timeout-minutes: 120 # TODO | |
steps: | |
- uses: taiki-e/checkout-action@v1 | |
- name: Install Rust | |
run: rustup toolchain install nightly --component miri && rustup default nightly | |
- name: miri | |
run: ci/miri.sh ${{ matrix.group }} | |
# Run cargo-careful. | |
careful: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
steps: | |
- uses: taiki-e/checkout-action@v1 | |
- name: Install Rust | |
run: rustup toolchain install nightly --component rust-src && rustup default nightly | |
- uses: taiki-e/install-action@cargo-careful | |
- name: Run cargo-careful | |
run: ci/careful.sh | |
# Run sanitizers. | |
san: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
steps: | |
- uses: taiki-e/checkout-action@v1 | |
- name: Install Rust | |
run: rustup update nightly && rustup default nightly | |
# https://github.com/google/sanitizers/issues/1716 / https://github.com/actions/runner-images/issues/9491 | |
- run: sudo sysctl vm.mmap_rnd_bits=28 | |
- name: Run sanitizers | |
run: ci/san.sh | |
# Check if the document can be generated without warning. | |
docs: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
steps: | |
- uses: taiki-e/checkout-action@v1 | |
- name: Install Rust | |
run: rustup update nightly && rustup default nightly | |
- name: docs | |
run: cargo doc --no-deps --all --all-features | |
shellcheck: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
steps: | |
- uses: taiki-e/checkout-action@v1 | |
- name: Install shellcheck | |
uses: taiki-e/install-action@shellcheck | |
- run: shellcheck $(git ls-files '*.sh') |