| 1 |
on: [push, pull_request] |
| 2 |
|
| 3 |
name: CI |
| 4 |
|
| 5 |
jobs: |
| 6 |
check: |
| 7 |
name: Check |
| 8 |
runs-on: ubuntu-latest |
| 9 |
steps: |
| 10 |
- uses: actions/checkout@v4 |
| 11 |
- uses: actions-rs/toolchain@v1 |
| 12 |
with: |
| 13 |
profile: minimal |
| 14 |
toolchain: stable |
| 15 |
override: true |
| 16 |
- uses: actions-rs/cargo@v1 |
| 17 |
with: |
| 18 |
command: check |
| 19 |
|
| 20 |
test: |
| 21 |
name: Test Suite |
| 22 |
runs-on: ${{ matrix.os }} |
| 23 |
strategy: |
| 24 |
matrix: |
| 25 |
os: [ubuntu-latest, macOS-latest] |
| 26 |
steps: |
| 27 |
- uses: actions/checkout@v4 |
| 28 |
- uses: actions-rs/toolchain@v1 |
| 29 |
with: |
| 30 |
profile: minimal |
| 31 |
toolchain: stable |
| 32 |
override: true |
| 33 |
- uses: actions-rs/cargo@v1 |
| 34 |
with: |
| 35 |
command: test |
| 36 |
|
| 37 |
test-Windows: |
| 38 |
name: Test Suite (Windows) |
| 39 |
runs-on: windows-latest |
| 40 |
steps: |
| 41 |
- uses: actions/checkout@v4 |
| 42 |
- uses: actions-rs/toolchain@v1 |
| 43 |
with: |
| 44 |
profile: minimal |
| 45 |
toolchain: stable |
| 46 |
override: true |
| 47 |
- uses: crazy-max/ghaction-chocolatey@v3 |
| 48 |
with: |
| 49 |
args: install pkgconfiglite --allow-empty-checksums |
| 50 |
- uses: actions-rs/cargo@v1 |
| 51 |
with: |
| 52 |
command: test |
| 53 |
|
| 54 |
fmt: |
| 55 |
name: Rustfmt |
| 56 |
runs-on: ubuntu-latest |
| 57 |
steps: |
| 58 |
- uses: actions/checkout@v4 |
| 59 |
- uses: actions-rs/toolchain@v1 |
| 60 |
with: |
| 61 |
profile: minimal |
| 62 |
toolchain: stable |
| 63 |
override: true |
| 64 |
- run: rustup component add rustfmt |
| 65 |
- uses: actions-rs/cargo@v1 |
| 66 |
with: |
| 67 |
command: fmt |
| 68 |
args: --all -- --check |
| 69 |
|
| 70 |
clippy: |
| 71 |
name: Clippy |
| 72 |
runs-on: ubuntu-latest |
| 73 |
steps: |
| 74 |
- uses: actions/checkout@v4 |
| 75 |
- uses: actions-rs/toolchain@v1 |
| 76 |
with: |
| 77 |
profile: minimal |
| 78 |
toolchain: stable |
| 79 |
override: true |
| 80 |
- run: rustup component add clippy |
| 81 |
- uses: actions-rs/cargo@v1 |
| 82 |
with: |
| 83 |
command: clippy |
| 84 |
args: -- -D warnings |
| 85 |
|
| 86 |
coverage: |
| 87 |
runs-on: ubuntu-latest |
| 88 |
env: |
| 89 |
CARGO_TERM_COLOR: always |
| 90 |
steps: |
| 91 |
- uses: actions/checkout@v4 |
| 92 |
- name: Install Rust |
| 93 |
run: rustup update stable |
| 94 |
- name: Install cargo-llvm-cov |
| 95 |
uses: taiki-e/install-action@cargo-llvm-cov |
| 96 |
- name: Generate code coverage |
| 97 |
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info |
| 98 |
- name: Upload coverage to Codecov |
| 99 |
uses: codecov/codecov-action@v4 |
| 100 |
with: |
| 101 |
token: ${{ secrets.CODECOV_TOKEN }} |
| 102 |
files: lcov.info |
| 103 |
fail_ci_if_error: true |
| 104 |
verbose: true |