-
-
Notifications
You must be signed in to change notification settings - Fork 2
97 lines (94 loc) · 3.14 KB
/
ci.yaml
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Continuous integration
on:
push:
branches: [main]
pull_request:
branches: [main]
merge_group:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
checks:
name: Check code
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@cbb722410c2e876e24abbe8de2cc27693e501dcb
- name: Set up Rust
run: rustup default nightly
- name: Install development tools
uses: taiki-e/install-action@e523301c9af289ba196edd3ab08abdece06107d2
with:
tool: cargo-deny@0.16.1, cargo-udeps@0.1.50, cargo-hack@0.6.31
- name: Install Rust linters
run: rustup component add clippy rustfmt
- name: Run checks
run: |
cargo fmt --check --all
cargo hack --feature-powerset check --locked --workspace
cargo hack --feature-powerset clippy --locked --workspace -- -D warnings
cargo deny check
cargo udeps --locked --workspace
tests:
name: Test on ${{ matrix.os.name }} (${{ matrix.channel }})
runs-on: ${{ matrix.os.value }}
strategy:
matrix:
os:
- name: Linux
value: ubuntu-latest
- name: Windows
value: windows-latest
- name: macOS
value: macos-latest
channel:
- stable
- beta
- nightly
steps:
- name: Check out repository
uses: actions/checkout@cbb722410c2e876e24abbe8de2cc27693e501dcb
- name: Set up Rust
run: rustup default ${{ matrix.channel }}
- name: Install development tools
uses: taiki-e/install-action@e523301c9af289ba196edd3ab08abdece06107d2
with:
tool: cargo-hack@0.6.31
- name: Run tests
run: cargo hack --feature-powerset test --locked
coverage:
name: Coverage
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@cbb722410c2e876e24abbe8de2cc27693e501dcb
- name: Set up Rust
run: rustup default nightly
- name: Install development tools
uses: taiki-e/install-action@e523301c9af289ba196edd3ab08abdece06107d2
with:
tool: cargo-llvm-cov@0.6.13, cargo-hack@0.6.31
- name: Create directories
run: mkdir -p target/llvm-cov/lcov
- name: Generate code coverage
run: |
cargo hack --feature-powerset llvm-cov --no-report --branch --locked --workspace
cargo llvm-cov report --fail-under-lines 85 --lcov --output-path target/llvm-cov/lcov/${{ github.event.repository.name }}.info
- name: Upload code coverage
uses: romeovs/lcov-reporter-action@25674467b99fc58cc7706dc246d9647a94b5ba8f
if: github.event_name == 'pull_request'
with:
lcov-file: target/llvm-cov/lcov/${{ github.event.repository.name }}.info
delete-old-comments: true
success:
name: Success
needs: [checks, tests, coverage]
if: always()
runs-on: ubuntu-latest
steps:
- name: Check jobs
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}