-
Notifications
You must be signed in to change notification settings - Fork 0
204 lines (175 loc) · 4.84 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
name: ci
on:
workflow_dispatch:
pull_request:
push:
branches: [main]
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
permissions:
contents: read
id-token: write
env:
SCCACHE_GHA_ENABLED: "true"
SCCACHE_GHA_VERSION: "1"
jobs:
checks:
runs-on: ubuntu-24.04
defaults:
run:
shell: nix develop .#checks --command bash {0}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup environment
uses: ./.github/actions/setup
with:
shell: checks
cachix-auth-token: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Run checks
run: |
set -eufo pipefail
cargo fmt --all --check
cargo clippy
cargo check --workspace
cargo build --workspace
cargo test --all-targets
cargo test --doc
benchmarks:
runs-on: ubuntu-24.04
defaults:
run:
shell: nix develop .#benchmarks --command bash {0}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup environment
uses: ./.github/actions/setup
with:
shell: benchmarks
cachix-auth-token: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Build benchmarks
run: cargo codspeed build
- name: Upload benchmark results to CodSpeed
uses: CathalMullan/action@main
with:
shell: nix develop .#benchmarks --command bash {0}
run: cargo codspeed run
token: "${{ secrets.CODSPEED_TOKEN }}"
coverage:
runs-on: ubuntu-24.04
defaults:
run:
shell: nix develop .#coverage --command bash {0}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup environment
uses: ./.github/actions/setup
with:
shell: coverage
cachix-auth-token: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Generate coverage
run: cargo llvm-cov --doctests --codecov --output-path codecov.json
- name: Upload coverage results to Codecov
uses: codecov/codecov-action@v4
with:
files: codecov.json
fail_ci_if_error: true
token: "${{ secrets.CODECOV_TOKEN }}"
msrv:
runs-on: ubuntu-24.04
defaults:
run:
shell: nix develop .#msrv --command bash {0}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup environment
uses: ./.github/actions/setup
with:
shell: msrv
cachix-auth-token: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Build wayfind
run: cargo build
no-std:
runs-on: ubuntu-24.04
defaults:
run:
shell: nix develop .#no-std --command bash {0}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup environment
uses: ./.github/actions/setup
with:
shell: no-std
cachix-auth-token: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Build wayfind
run: cargo build
wasm:
runs-on: ubuntu-24.04
defaults:
run:
shell: nix develop .#wasm --command bash {0}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup environment
uses: ./.github/actions/setup
with:
shell: wasm
cachix-auth-token: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Build wayfind
run: cargo build
oci:
runs-on: ubuntu-24.04
defaults:
run:
shell: nix develop .#oci --command bash {0}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup environment
uses: ./.github/actions/setup
with:
shell: oci
cachix-auth-token: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Run OCI tests
run: |
set -eufo pipefail
cd examples/oci
cargo build
cargo run &
PID="${!}"
sleep 3
oci-distribution-spec-conformance
kill "${PID}"
- name: Upload test results to Codecov
if: always() && !cancelled()
uses: codecov/test-results-action@v1
with:
files: examples/oci/junit.xml
fail_ci_if_error: true
token: "${{ secrets.CODECOV_TOKEN }}"
- name: Upload test report to GitHub
if: always() && !cancelled()
uses: actions/upload-artifact@v4
with:
name: report
path: examples/oci/report.html