Build and Check #700
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
# spell-checker:ignore taiki rustfmt binstall clippy taplo rustup nocapture | |
# spell-checker:ignore nofile gnuabi armv gnueabi mipsel | |
name: Build and Check | |
on: | |
push: | |
branches: ["main", "cicd", "release", "develop", "[0-9]+-*"] | |
pull_request: | |
branches: ["main"] | |
schedule: | |
- cron: "00 01 * * *" | |
env: | |
CARGO_TERM_COLOR: always | |
RUST_BACKTRACE: "1" | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
deny: | |
name: Check dependencies/ubuntu-latest | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@1.66.0 | |
- uses: taiki-e/install-action@cargo-deny | |
- uses: taiki-e/install-action@just | |
- name: Check advisories | |
run: just args='--deny warnings' deny advisories | |
- name: Check bans licenses sources | |
run: just deny bans licenses sources | |
minimal_versions: | |
name: Check minimal version requirements of dependencies | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: | |
- "1.66.0" # MSRV | |
- stable | |
# https://github.com/tkaitchuck/aHash/issues/200 | |
# Pin nightly as long as inferno can use ahash < 0.8.7 | |
- nightly-2024-02-04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
if: ${{ startsWith(matrix.toolchain, 'nightly') }} | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
- uses: dtolnay/rust-toolchain@master | |
if: ${{ ! startsWith(matrix.toolchain, 'nightly') }} | |
with: | |
toolchain: nightly | |
- uses: dtolnay/rust-toolchain@master | |
if: ${{ ! startsWith(matrix.toolchain, 'nightly') }} | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
key: ubuntu-latest_${{ matrix.toolchain }} | |
- uses: taiki-e/install-action@cargo-hack | |
- uses: taiki-e/install-action@cargo-minimal-versions | |
- uses: taiki-e/install-action@just | |
- name: Check build with minimal versions | |
run: just minimal-versions | |
format: | |
name: Check format and spelling | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: rustfmt | |
- uses: taiki-e/install-action@cargo-binstall | |
- uses: taiki-e/install-action@just | |
- run: cargo binstall --no-confirm --no-symlinks taplo-cli | |
- run: just check-fmt-all | |
base: | |
needs: [format] | |
name: Build, check and test | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: | |
- "1.66.0" # MSRV | |
- stable | |
- nightly | |
include: | |
- toolchain: "1.66.0" # MSRV | |
ui_tests: --features ui_tests | |
components: rust-src | |
- toolchain: stable | |
components: clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
components: ${{ matrix.components }} | |
- name: "Prepare: Install stable toolchain with clippy" | |
if: matrix.toolchain != 'stable' | |
run: | | |
rustup toolchain install stable --no-self-update --component clippy | |
- name: "Prepare: Run cargo update" | |
if: matrix.toolchain == 'stable' || matrix.toolchain == 'nightly' | |
run: | | |
cargo update | |
- uses: taiki-e/install-action@cargo-hack | |
- uses: taiki-e/install-action@just | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
key: ubuntu-latest_${{ matrix.toolchain }} | |
- name: Install valgrind | |
run: sudo apt-get -y update && sudo apt-get -y install valgrind | |
- name: Info | |
run: | | |
set -x | |
uname -a | |
pwd | |
rustup --version | |
rustup show | |
rustup component list --installed | |
valgrind --version | |
- name: Build with the feature powerset | |
run: just build-hack | |
- name: Lint | |
run: just lint | |
- name: Test | |
run: | | |
set -o pipefail | |
cargo test --workspace --exclude client-request-tests ${{ matrix.ui_tests }} |& tee test.output | |
- name: Check test output for ui errors | |
if: ${{ matrix.ui_tests && failure() }} | |
run: | | |
if grep -q '^test ui \.\.\. FAILED$' test.output; then | |
TRYBUILD=overwrite cargo test ${{ matrix.ui_tests }} ui | |
git diff iai-callgrind/tests/ui | |
fi | |
exit 1 | |
- name: Check summary.json schema is up-to-date | |
run: just schema-gen-diff | |
- name: Bench | |
run: just full-bench-test-all | |
# env: | |
# IAI_CALLGRIND_LOG: trace | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: iai-callgrind-benchmarks-${{ matrix.toolchain }} | |
path: "target/iai" | |
client_requests: | |
needs: [format] | |
name: Test client requests | |
strategy: | |
fail-fast: false | |
matrix: | |
job: | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
- os: ubuntu-latest | |
target: i686-unknown-linux-gnu | |
- os: ubuntu-latest | |
target: s390x-unknown-linux-gnu | |
- os: ubuntu-latest | |
target: aarch64-unknown-linux-gnu | |
- os: ubuntu-latest | |
target: armv7-unknown-linux-gnueabihf | |
- os: ubuntu-latest | |
target: powerpc-unknown-linux-gnu | |
- os: ubuntu-latest | |
target: powerpc64-unknown-linux-gnu | |
- os: ubuntu-latest | |
target: powerpc64le-unknown-linux-gnu | |
runs-on: ${{ matrix.job.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: taiki-e/install-action@cross | |
- uses: taiki-e/install-action@just | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
key: cross_${{ matrix.job.os }}_${{ matrix.job.target }} | |
- name: Info | |
run: | | |
set -x | |
uname -a | |
pwd | |
rustup --version | |
rustup show | |
rustup component list --installed | |
- name: Test client requests | |
run: just reqs-test ${{ matrix.job.target }} | |
# env: | |
# CROSS_DEBUG: "1" | |
docs: | |
needs: [base, client_requests] | |
name: Docs/ubuntu-latest | |
runs-on: ubuntu-latest | |
env: | |
DOCS_RS: "1" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@nightly | |
- uses: Swatinem/rust-cache@v2 | |
- name: Build iai-callgrind without valgrind headers | |
run: cargo build --package iai-callgrind --features client_requests_defs --release | |
- name: Run doc tests | |
run: cargo test --all-features --doc | |
- name: Check Documentation | |
run: cargo doc --all-features --no-deps --document-private-items |