[#139] events with bitset #430
Workflow file for this run
This file contains hidden or 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: Unit-Tests | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main, release* ] | |
env: | |
RUSTFLAGS: "-C debug-assertions" | |
jobs: | |
preflight-check: | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Check format of all commit messages | |
run: ./internal/scripts/ci_test_commit_msg.sh | |
- name: Check license header | |
run: ./internal/scripts/ci_test_spdx_license_header.sh | |
static-code-analysis: | |
needs: preflight-check | |
strategy: | |
matrix: | |
os: [windows-latest, ubuntu-latest, macOS-latest] | |
timeout-minutes: 10 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@v1 | |
with: | |
toolchain: stable | |
components: rustfmt, clippy | |
- name: Run cargo fmt | |
run: cargo fmt --all -- --check | |
- name: Run cargo clippy | |
run: cargo clippy -- -D warnings | |
x86_64: | |
needs: [preflight-check, static-code-analysis] | |
strategy: | |
matrix: | |
os: [windows-latest, ubuntu-latest, macos-latest] | |
toolchain: [stable, 1.73.0, beta, nightly] | |
mode: | |
- name: "release" | |
arg: "--release" | |
- name: "debug" | |
arg: "" | |
timeout-minutes: 60 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@v1 | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
components: rustfmt, clippy | |
- name: Prepare system | |
run: ${{ matrix.os == 'windows-latest' && 'internal\scripts\ci_prepare_windows.bat' || ( matrix.os == 'ubuntu-latest' && './internal/scripts/ci_prepare_ubuntu.sh' || 'uname -a' ) }} | |
- name: Run cargo build | |
run: cargo build --workspace --all-targets ${{ matrix.mode.arg }} | |
- name: Run cargo test | |
run: cargo test --workspace --no-fail-fast ${{ matrix.mode.arg }} | |
### TODO: does not work yet reliable on the GitHub CI, seems to end up in an infinite loop | |
### current alternative is a cirrus.yml aarch64 target | |
# arm: | |
# runs-on: ubuntu-latest | |
# strategy: | |
# matrix: | |
# architecture: ["aarch64"] # ["aarch64", "armv7"] | |
# toolchain: [ stable ] # [stable, 1.73.0, beta, nightly] | |
# mode: ["--release", ""] | |
# timeout-minutes: 30 | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - uses: uraimo/run-on-arch-action@v2 | |
# name: Run commands | |
# with: | |
# arch: ${{ matrix.architecture }} | |
# distro: archarm_latest | |
# run: | | |
# ./internal/scripts/ci_prepare_archlinux.sh | |
# rustup default ${{ matrix.toolchain }} | |
# cargo fmt --all -- --check | |
# cargo clippy -- -D warnings | |
# cargo build --workspace --all-targets ${{ matrix.mode }} | |
# cargo test --workspace --no-fail-fast ${{ matrix.mode }} | |
freebsd: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
strategy: | |
matrix: | |
freebsd_version: [ "14.0" ] | |
toolchain: [ "stable", "1.73.0" ] # [stable, 1.73.0, beta, nightly] | |
mode: [""] # ["--release", ""] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: vmactions/freebsd-vm@v1 | |
with: | |
release: ${{ matrix.freebsd_version }} | |
run: | | |
./internal/scripts/ci_prepare_freebsd.sh | |
export PATH=$PATH:$HOME/.cargo/bin | |
export LIBCLANG_PATH=/usr/local/llvm15/lib/ | |
rustup default ${{ matrix.toolchain }} | |
export RUSTFLAGS="-C debug-assertions" | |
cargo fmt --all -- --check | |
cargo clippy -- -D warnings | |
cargo build --workspace --all-targets ${{ matrix.mode }} | |
cargo test --workspace --no-fail-fast ${{ matrix.mode }} | |
grcov: | |
needs: preflight-check | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build and cache grcov | |
uses: ./.github/actions/build-and-cache-rust-tool | |
with: | |
rust-toolchain: stable | |
rust-components: llvm-tools-preview | |
check-and-install-cmd: grcov --version > /dev/null || cargo install grcov | |
print-version-cmd: grcov --version | |
cache-key: cache-1-${{ runner.os }}-grcov | |
artifact-path: ~/.cargo/bin/grcov | |
artifact-name: ${{ runner.os }}-grcov | |
coverage: | |
needs: grcov | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: sudo apt-get -y install libacl1-dev llvm | |
- name: Create test users and groups | |
run: | | |
sudo useradd testuser1 | |
sudo useradd testuser2 | |
sudo groupadd testgroup1 | |
sudo groupadd testgroup2 | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@v1 | |
with: | |
toolchain: stable | |
components: llvm-tools-preview | |
- name: Download artifact grcov | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ runner.os }}-grcov | |
path: ~/.cargo/bin | |
- name: Make grcov artifacts executable | |
run: chmod +x ~/.cargo/bin/grcov | |
- name: Generate raw coverage results | |
run: ./internal/scripts/generate-cov-report.sh --generate | |
- name: Generate coverage results for html artifacts | |
run: ./internal/scripts/generate-cov-report.sh --html | |
- name: Archive coverage-html artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-html | |
path: target/debug/coverage/html/* | |
retention-days: 90 | |
- name: Generate coverage report for Codecov | |
run: ./internal/scripts/generate-cov-report.sh --lcov | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
file: target/debug/coverage/lcov.info | |
fail_ci_if_error: true |