-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (91 loc) · 2.6 KB
/
ci.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
on:
push:
pull_request:
merge_group:
name: CI
jobs:
coverage:
name: Test Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: |
cd auctioning_platform
cargo llvm-cov --all-features --workspace --codecov --output-path codecov.json
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage-ubuntu
path: codecov.json
upload-coverage:
name: Upload test coverage to CodeCov
needs: [coverage]
runs-on: ubuntu-latest
permissions:
statuses: write
steps:
#----------------------------------------------
# check-out repo and set-up python
#----------------------------------------------
- name: Check out repository
uses: actions/checkout@v4
- name: download coverage files
uses: actions/download-artifact@v4
with:
pattern: coverage-*
- name: display files
run: |
ls -aR
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
# directory: ./coverage
# env_vars: OS,PYTHON
fail_ci_if_error: false
files: ./coverage-ubuntu/codecov.json
# flags: unittests
# name: codecov-umbrella
verbose: true
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
components: rustfmt
- run: |
cd auctioning_platform
cargo fmt --check --all
lint:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
components: clippy
- run: |
cd auctioning_platform
cargo clippy -- -D warnings
# https://github.com/marketplace/actions/alls-green#why used for branch protection checks
check:
if: always()
needs: [lint, coverage, fmt]
runs-on: ubuntu-latest
permissions: {}
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
allowed-failures: lint