Skip to content

Commit 251d388

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

File tree

1 file changed

+38
-9
lines changed

1 file changed

+38
-9
lines changed

.github/workflows/smoke.yml

+38-9
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: |
@@ -188,6 +188,21 @@ jobs:
188188
sudo tar xzf nydus-static-$version_arch.tgz -C nydus-$version
189189
sudo cp -r nydus-$version/nydus-static/* /usr/bin/nydus-$version/
190190
done
191+
- name: Free Disk Space
192+
uses: jlumbroso/free-disk-space@main
193+
with:
194+
# this might remove tools that are actually needed,
195+
# if set to "true" but frees about 6 GB
196+
tool-cache: true
197+
198+
# all of these default to true, but feel free to set to
199+
# "false" if necessary for your workflow
200+
android: true
201+
dotnet: true
202+
haskell: true
203+
large-packages: true
204+
docker-images: true
205+
swap-storage: true
191206
- name: Setup Golang
192207
uses: actions/setup-go@v5
193208
with:
@@ -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)