-
Notifications
You must be signed in to change notification settings - Fork 2
75 lines (72 loc) · 2.44 KB
/
build-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Build and test
on:
push:
branches: ["develop"]
pull_request:
env:
RUST_CHANNEL: "stable"
RUST_TEST_CHANNEL: "nightly"
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest] # TODO: Add windows-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
run: |
rustup toolchain install --profile minimal --no-self-update ${{ env.RUST_CHANNEL }}
rustup default ${{ env.RUST_CHANNEL }}
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Build fzn-huub
run: cargo install --root dist/ --path crates/fzn-huub
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: fzn-huub-${{ matrix.os }}
path: dist/
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
run: |
rustup toolchain install --profile minimal --no-self-update ${{ env.RUST_TEST_CHANNEL }}
rustup default ${{ env.RUST_TEST_CHANNEL }}
- name: Install grcov
uses: SierraSoftworks/setup-grcov@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Run cargo test
run: cargo test
env:
CARGO_INCREMENTAL: "0"
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
RUSTDOCFLAGS: "-Cpanic=abort"
- name: Collect covereage data
run: grcov . --binary-path target/debug/deps/ -s . -t lcov --ignore-not-existing --ignore '../**' --ignore '/*' -o ./lcov.info
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./lcov.info
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
run: |
rustup toolchain install --profile minimal --component clippy --no-self-update ${{ env.RUST_CHANNEL }}
rustup default ${{ env.RUST_CHANNEL }}
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Run clippy
run: cargo clippy -- -D warnings