-
-
Notifications
You must be signed in to change notification settings - Fork 19
148 lines (112 loc) · 3.47 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: ci
on:
pull_request:
push:
branches:
- main
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
SCCACHE_GHA_ENABLED: 'true'
RUSTC_WRAPPER: 'sccache'
jobs:
build:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install tools
uses: ./.github/actions/install-tools
- name: Prepare Git boundaries for affected projects
uses: nrwl/nx-set-shas@v3
- name: Run build
run: npx nx affected --target=build --parallel=1
- name: Print sccache stats
shell: bash
run: ${SCCACHE_PATH} --show-stats
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install tools
uses: ./.github/actions/install-tools
- name: Install Rust tools
run: cargo binstall -y cargo-tarpaulin
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Prepare Git boundaries for affected projects
uses: nrwl/nx-set-shas@v3
- name: Run tests
run: npx nx affected --target=test --parallel=1
- name: Upload coverage reports to Codecov
run: |
curl -o codecov https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
CODECOV=$(pwd)/codecov bash scripts/upload_codecov_files.sh
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Print sccache stats
shell: bash
run: ${SCCACHE_PATH} --show-stats
quality:
runs-on: ubuntu-latest
needs: test
permissions:
contents: read
security-events: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install tools
uses: ./.github/actions/install-tools
- name: Install Rust tools
run: cargo binstall -y clippy-sarif sarif-fmt
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Run clippy
run: cargo clippy --all-features --message-format=json -- --deny warnings | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
continue-on-error: true
- name: Run detekt
run: ./gradlew detekt
continue-on-error: true
- name: Upload Clippy analysis results to GitHub
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: rust-clippy-results.sarif
wait-for-processing: true
- name: Upload Detekt analysis results to GitHub
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: build/reports/detekt/merge.sarif
wait-for-processing: true
lint:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install tools
uses: ./.github/actions/install-tools
- name: Prepare Git boundaries for affected projects
uses: nrwl/nx-set-shas@v3
- name: Run lint
run: npx nx affected --target=lint --parallel=1
semantic:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Ensure semantic
uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ github.token }}