Add matrix build #79
Workflow file for this run
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: Validate | |
on: pull_request | |
jobs: | |
build: | |
name: Build ${{ matrix.system.name }} | |
strategy: | |
fail-fast: false | |
matrix: | |
system: | |
- name: Windows | |
os: windows-latest | |
target: x86_64-pc-windows-msvc | |
test: True | |
- name: Windows - x86_64 | |
os: windows-latest | |
target: x86_64-unknown-linux-musl | |
test: False | |
- name: Windows - x86_32 | |
os: windows-latest | |
target: i686-unknown-linux-musl | |
test: False | |
- name: Windows - ARM64 | |
os: windows-latest | |
target: aarch64-unknown-linux-musl | |
test: False | |
- name: Windows - ARM32 | |
os: windows-latest | |
target: armv7-unknown-linux-musleabi | |
test: False | |
# os: | |
# - windows-latest | |
# # - ubuntu-latest | |
# # - macos-latest | |
# target: | |
# - x86_64-unknown-linux-gnu | |
# # - aarch64-unknown-linux-gnu | |
# # - armv7-unknown-linux-gnueabi | |
# # - i686-unknown-linux-gnu | |
runs-on: ${{ matrix.system.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install toolchain | |
run: rustup update --no-self-update stable | |
- name: Install target | |
run: rustup target add ${{ matrix.system.target }} | |
- name: Build the library | |
run: cargo test --no-run --target ${{ matrix.system.target }} | |
- name: Test the library | |
if: ${{ matrix.system.test }} | |
run: cargo test | |
test: | |
name: Test | |
needs: build | |
runs-on: ubuntu-latest | |
env: | |
RUSTFLAGS: "-C instrument-coverage" | |
LLVM_PROFILE_FILE: "ms1553b-%p-%m.profraw" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
run: rustup update --no-self-update stable | |
- name: Install llvm-tools-preview | |
run: rustup component add llvm-tools-preview | |
- name: Install binstall | |
uses: cargo-bins/cargo-binstall@main | |
- name: Install grcov | |
run: cargo binstall --no-confirm grcov | |
- name: Build the library | |
run: cargo test --no-run | |
- name: Test the library | |
run: cargo test | |
- name: Generate code coverage | |
run: grcov . -s . -b target/debug -t cobertura --branch --ignore-not-existing --keep-only 'src/**/*' -o . | |
- name: Make coverage report | |
uses: 5monkeys/cobertura-action@v13 | |
with: | |
path: ./cobertura.xml | |
report_name: Coverage | |
skip_covered: false | |
only_changed_files: false | |
fail_below_threshold: true | |
minimum_coverage: 95 |