Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 22 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,32 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
env:
CARGO_INCREMENTAL: 0
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- run: cargo check

test:
name: cargo test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
env:
CARGO_INCREMENTAL: 0
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- run: cargo test --all

fmt:
name: cargo fmt --all -- --check
runs-on: ubuntu-latest
env:
CARGO_INCREMENTAL: 0
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- run: rustup component add rustfmt
- run: cargo fmt --all -- --check

coverage:
Expand All @@ -47,6 +49,10 @@ jobs:
- { os: ubuntu-latest , features: unix }
- { os: macos-latest , features: macos }
- { os: windows-latest , features: windows }
env:
CARGO_INCREMENTAL: 0
# Use -Z
RUSTC_BOOTSTRAP: 1
steps:
- uses: actions/checkout@v6
- name: Initialize workflow variables
Expand All @@ -55,22 +61,10 @@ jobs:
run: |
## VARs setup
outputs() { step_id="vars"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
# toolchain
TOOLCHAIN="nightly" ## default to "nightly" toolchain (required for certain required unstable compiler flags) ## !maint: refactor when stable channel has needed support
# * specify gnu-type TOOLCHAIN for windows; `grcov` requires gnu-style code coverage data files
case ${{ matrix.job.os }} in windows-*) TOOLCHAIN="$TOOLCHAIN-x86_64-pc-windows-gnu" ;; esac;
# * use requested TOOLCHAIN if specified
if [ -n "${{ matrix.job.toolchain }}" ]; then TOOLCHAIN="${{ matrix.job.toolchain }}" ; fi
outputs TOOLCHAIN
# target-specific options
# * CODECOV_FLAGS
CODECOV_FLAGS=$( echo "${{ matrix.job.os }}" | sed 's/[^[:alnum:]]/_/g' )
outputs CODECOV_FLAGS

- name: rust toolchain ~ install
uses: dtolnay/rust-toolchain@nightly
with:
components: llvm-tools-preview
- name: Test
run: cargo test --no-fail-fast
env:
Expand All @@ -79,7 +73,13 @@ jobs:
RUSTFLAGS: "-Cinstrument-coverage -Zcoverage-options=branch -Ccodegen-units=1 -Copt-level=0 -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
RUSTDOCFLAGS: "-Cpanic=abort"
LLVM_PROFILE_FILE: "sed-%p-%m.profraw"
# Use -Z
RUSTC_BOOTSTRAP: 1
- name: "`grcov` ~ install"
env:
CARGO_INCREMENTAL: 0
# Use -Z
RUSTC_BOOTSTRAP: 1
id: build_grcov
shell: bash
run: |
Expand All @@ -98,6 +98,10 @@ jobs:
# version: latest
# use-tool-cache: false
- name: Generate coverage data (via `grcov`)
env:
CARGO_INCREMENTAL: 0
# Use -Z
RUSTC_BOOTSTRAP: 1
id: coverage
shell: bash
run: |
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,15 @@ jobs:
style_format:
name: Style/format
runs-on: ${{ matrix.job.os }}
env:
CARGO_INCREMENTAL: 0
strategy:
fail-fast: false
matrix:
job:
- { os: ubuntu-latest, features: feat_os_unix }
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt
- uses: Swatinem/rust-cache@v2
- name: Initialize workflow variables
id: vars
Expand Down Expand Up @@ -65,6 +63,7 @@ jobs:
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
CARGO_INCREMENTAL: 0
strategy:
fail-fast: false
matrix:
Expand All @@ -74,10 +73,6 @@ jobs:
- { os: windows-latest }
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.9
Expand Down
Loading