Skip to content

Commit b8e51ff

Browse files
committed
action: upload integration test coverage
Signed-off-by: Yan Song <[email protected]>
1 parent 8593498 commit b8e51ff

File tree

1 file changed

+41
-12
lines changed

1 file changed

+41
-12
lines changed

.github/workflows/smoke.yml

+41-12
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ jobs:
105105
declare -A rust_target_map=( ["amd64"]="x86_64-unknown-linux-musl" ["arm64"]="aarch64-unknown-linux-musl" ["ppc64le"]="powerpc64le-unknown-linux-gnu")
106106
RUST_TARGET=${rust_target_map[${{ matrix.arch }}]}
107107
cargo install --locked --version 0.2.5 cross
108-
make -e RUST_TARGET_STATIC=$RUST_TARGET -e CARGO=cross static-release
108+
RUSTFLAGS="-C instrument-coverage" make -e RUST_TARGET_STATIC=$RUST_TARGET -e CARGO=cross static-release
109109
- name: Build Nydus RISC-V
110110
if: matrix.arch == 'riscv64'
111111
run: |
@@ -158,9 +158,9 @@ jobs:
158158
steps:
159159
- name: Checkout
160160
uses: actions/checkout@v4
161-
- name: Docker Cache
162-
uses: jpribyl/[email protected]
163-
continue-on-error: true
161+
# - name: Docker Cache
162+
# uses: jpribyl/[email protected]
163+
# continue-on-error: true
164164
- name: Download Nydus
165165
uses: actions/download-artifact@v4
166166
with:
@@ -193,6 +193,21 @@ jobs:
193193
with:
194194
go-version-file: 'go.work'
195195
cache-dependency-path: "**/*.sum"
196+
- name: Free Disk Space
197+
uses: jlumbroso/free-disk-space@main
198+
with:
199+
# this might remove tools that are actually needed,
200+
# if set to "true" but frees about 6 GB
201+
tool-cache: false
202+
203+
# all of these default to true, but feel free to set to
204+
# "false" if necessary for your workflow
205+
android: true
206+
dotnet: true
207+
haskell: true
208+
large-packages: true
209+
docker-images: true
210+
swap-storage: true
196211
- name: Integration Test
197212
run: |
198213
sudo mkdir -p /usr/bin/nydus-latest /home/runner/work/workdir
@@ -215,6 +230,16 @@ jobs:
215230
216231
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/bin v1.64.8
217232
sudo -E make smoke-only
233+
- name: Generate integration test code coverage
234+
run: |
235+
cargo +stable install grcov --locked
236+
grcov . -s . --binary-path ./target/x86_64-unknown-linux-musl/release -t covdir --branch --ignore-not-existing -o ./lcov.info
237+
- name: Upload nydus coverage file
238+
uses: actions/upload-artifact@v4
239+
with:
240+
name: integration-test-coverage-artifact
241+
path: |
242+
lcov.info
218243
219244
nydus-unit-test:
220245
runs-on: ubuntu-latest
@@ -254,7 +279,7 @@ jobs:
254279
- name: Upload contrib coverage file
255280
uses: actions/upload-artifact@v4
256281
with:
257-
name: contrib-test-coverage-artifact
282+
name: contrib-unit-test-coverage-artifact
258283
path: |
259284
contrib/nydusify/coverage.txt
260285
@@ -283,27 +308,31 @@ jobs:
283308
- name: Upload nydus coverage file
284309
uses: actions/upload-artifact@v4
285310
with:
286-
name: nydus-test-coverage-artifact
311+
name: nydus-unit-test-coverage-artifact
287312
path: |
288313
codecov.json
289314
290315
upload-coverage-to-codecov:
291316
runs-on: ubuntu-latest
292-
needs: [contrib-unit-test-coverage, nydus-unit-test-coverage]
317+
needs: [contrib-unit-test-coverage, nydus-unit-test-coverage, nydus-integration-test]
293318
steps:
294319
- uses: actions/checkout@v4
295-
- name: Download nydus coverage file
320+
- name: Download nydus unit test coverage file
321+
uses: actions/download-artifact@v4
322+
with:
323+
name: nydus-unit-test-coverage-artifact
324+
- name: Download contrib unit test coverage file
296325
uses: actions/download-artifact@v4
297326
with:
298-
name: nydus-test-coverage-artifact
299-
- name: Download contrib coverage file
327+
name: contrib-unit-test-coverage-artifact
328+
- name: Download integration test coverage file
300329
uses: actions/download-artifact@v4
301330
with:
302-
name: contrib-test-coverage-artifact
331+
name: integration-test-coverage-artifact
303332
- name: Upload coverage to Codecov
304333
uses: codecov/codecov-action@v4
305334
with:
306-
files: ./codecov.json,./coverage.txt
335+
files: ./codecov.json,./coverage.txt,./lcov.info
307336
token: ${{ secrets.CODECOV_TOKEN }}
308337
verbose: true
309338
fail_ci_if_error: true

0 commit comments

Comments
 (0)