Skip to content

Commit 1cf633c

Browse files
committed
ci: update coverage upload to use coverage.info files
Replace profraw artifact uploads with coverage.info files generated by make generate-codecov in smoke, unit test, and takeover jobs for more accurate coverage reporting. Simplify artifact download steps in nydus-coverage job to match new coverage info files and ensure correct coverage data is uploaded to Codecov. Signed-off-by: Peng Tao <bergwolf@hyper.sh>
1 parent 4e29117 commit 1cf633c

File tree

1 file changed

+35
-64
lines changed

1 file changed

+35
-64
lines changed

.github/workflows/smoke.yml

Lines changed: 35 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,6 @@ jobs:
9292
path: |
9393
nydus-image
9494
nydusd
95-
- name: Upload Nydus Build profraw
96-
uses: actions/upload-artifact@v6
97-
with:
98-
name: nydus-profraw-build
99-
path: |
100-
coverage/*.profraw
10195
10296
nydus-build:
10397
runs-on: ubuntu-latest
@@ -267,12 +261,15 @@ jobs:
267261
268262
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/bin v2.1.6
269263
sudo -E ENABLE_DEBUG=1 make smoke-only
270-
- name: Upload Nydus Smoke profraw
264+
sudo -E "PATH=$PATH" make generate-codecov-markdown
265+
grep Total coverage/coverage.md
266+
sudo -E "PATH=$PATH" make generate-codecov
267+
sudo cp coverage/coverage.info smoke-coverage.info
268+
- name: Upload Nydus Smoke Coverage
271269
uses: actions/upload-artifact@v6
272270
with:
273-
name: nydus-profraw-smoke
274-
path: |
275-
coverage/*.profraw
271+
name: nydus-coverage-smoke
272+
path: smoke-coverage.info
276273

277274
nydus-unit-test:
278275
runs-on: ubuntu-latest
@@ -292,13 +289,15 @@ jobs:
292289
- name: Unit Test
293290
run: |
294291
sudo -E ENABLE_DEBUG=1 "PATH=$PATH" make ut-nextest
295-
#sudo -E "PATH=$PATH" make generate-codecov
296-
- name: Upload Nydus UT profraw
292+
sudo -E "PATH=$PATH" make generate-codecov-markdown
293+
grep Total coverage/coverage.md
294+
sudo -E "PATH=$PATH" make generate-codecov
295+
sudo cp coverage/coverage.info ut-coverage.info
296+
- name: Upload Nydus UT Coverage
297297
uses: actions/upload-artifact@v6
298298
with:
299-
name: nydus-profraw-ut
300-
path: |
301-
coverage/*.profraw
299+
name: nydus-coverage-ut
300+
path: ut-coverage.info
302301

303302
contrib-unit-test:
304303
runs-on: ubuntu-latest
@@ -320,27 +319,6 @@ jobs:
320319
path: |
321320
contrib/nydusify/coverage.txt
322321
323-
upload-coverage-to-codecov:
324-
runs-on: ubuntu-latest
325-
needs: [contrib-unit-test, nydus-coverage]
326-
steps:
327-
- uses: actions/checkout@v6
328-
- name: Download nydus coverage file
329-
uses: actions/download-artifact@v7
330-
with:
331-
name: nydus-test-coverage-artifact
332-
- name: Download contrib coverage file
333-
uses: actions/download-artifact@v7
334-
with:
335-
name: contrib-test-coverage-artifact
336-
- name: Upload coverage to Codecov
337-
uses: codecov/codecov-action@v5
338-
env:
339-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
340-
with:
341-
verbose: true
342-
fail_ci_if_error: true
343-
344322
nydus-cargo-deny:
345323
name: cargo-deny
346324
runs-on: ubuntu-latest
@@ -403,50 +381,43 @@ jobs:
403381
export NEW_NYDUSD_BINARY_PATH=target/debug/nydusd
404382
sudo chmod +x target/debug/nydus-image
405383
sudo -E ENABLE_DEBUG=1 make smoke-takeover
384+
sudo -E "PATH=$PATH" make generate-codecov-markdown
385+
grep Total coverage/coverage.md
386+
sudo -E "PATH=$PATH" make generate-codecov
387+
sudo cp coverage/coverage.info takeover-coverage.info
406388
- name: Upload Nydus Takeover
407389
uses: actions/upload-artifact@v6
408390
with:
409-
name: nydus-profraw-takeover
410-
path: |
411-
coverage/*.profraw
391+
name: nydus-coverage-takeover
392+
path: takeover-coverage.info
412393

413394
nydus-coverage:
414395
runs-on: ubuntu-latest
415396
needs: [takeover-test,nydus-integration-test,nydus-unit-test]
416397
steps:
417398
- name: Checkout
418399
uses: actions/checkout@v6
419-
- name: Download Nydus
400+
- name: Download Nydus Smoke Coverage
420401
uses: actions/download-artifact@v7
421402
with:
422-
name: nydus-artifact-debug
423-
path: target/debug
424-
- name: Download Nydus Build profraw
403+
name: nydus-coverage-smoke
404+
- name: Download Nydus UT Coverage
425405
uses: actions/download-artifact@v7
426406
with:
427-
name: nydus-profraw-build
428-
path: coverage/
429-
- name: Download Nydus Smoke profraw
407+
name: nydus-coverage-ut
408+
- name: Download Nydus Takeover Coverage
430409
uses: actions/download-artifact@v7
431410
with:
432-
name: nydus-profraw-smoke
433-
path: coverage/
434-
- name: Download Nydus UT profraw
435-
uses: actions/download-artifact@v7
436-
with:
437-
name: nydus-profraw-ut
438-
path: coverage/
439-
- name: Download Nydus Takeover profraw
411+
name: nydus-coverage-takeover
412+
- name: Download contrib coverage file
440413
uses: actions/download-artifact@v7
441414
with:
442-
name: nydus-profraw-takeover
443-
path: coverage/
444-
- name: Generate Nydus Codecov
445-
run: |
446-
ls coverage | wc -l
447-
sudo -E "PATH=$PATH" make generate-codecov
448-
- name: Upload Nydus Codecov
449-
uses: actions/upload-artifact@v6
415+
name: contrib-test-coverage-artifact
416+
- name: Upload coverage to Codecov
417+
uses: codecov/codecov-action@v5
418+
env:
419+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
420+
files: smoke-coverage.info,ut-coverage.info,takeover-coverage.info,coverage.txt
450421
with:
451-
name: nydus-test-coverage-artifact
452-
path: coverage/coverage.info
422+
verbose: true
423+
fail_ci_if_error: true

0 commit comments

Comments
 (0)