Skip to content

[WIP] action: upload integration test coverage #1680

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 41 additions & 12 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
declare -A rust_target_map=( ["amd64"]="x86_64-unknown-linux-musl" ["arm64"]="aarch64-unknown-linux-musl" ["ppc64le"]="powerpc64le-unknown-linux-gnu")
RUST_TARGET=${rust_target_map[${{ matrix.arch }}]}
cargo install --locked --version 0.2.5 cross
make -e RUST_TARGET_STATIC=$RUST_TARGET -e CARGO=cross static-release
RUSTFLAGS="-C instrument-coverage" make -e RUST_TARGET_STATIC=$RUST_TARGET -e CARGO=cross static-release
- name: Build Nydus RISC-V
if: matrix.arch == 'riscv64'
run: |
Expand Down Expand Up @@ -158,9 +158,9 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker Cache
uses: jpribyl/[email protected]
continue-on-error: true
# - name: Docker Cache
# uses: jpribyl/[email protected]
# continue-on-error: true
- name: Download Nydus
uses: actions/download-artifact@v4
with:
Expand Down Expand Up @@ -193,6 +193,21 @@ jobs:
with:
go-version-file: 'go.work'
cache-dependency-path: "**/*.sum"
- name: Free Disk Space
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false

# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Integration Test
run: |
sudo mkdir -p /usr/bin/nydus-latest /home/runner/work/workdir
Expand All @@ -215,6 +230,16 @@ jobs:

curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/bin v1.64.8
sudo -E make smoke-only
- name: Generate integration test code coverage
run: |
cargo +stable install grcov --locked
grcov . -s . --binary-path ./target/x86_64-unknown-linux-musl/release -t covdir --branch --ignore-not-existing -o ./lcov.info
- name: Upload nydus coverage file
uses: actions/upload-artifact@v4
with:
name: integration-test-coverage-artifact
path: |
lcov.info

nydus-unit-test:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -254,7 +279,7 @@ jobs:
- name: Upload contrib coverage file
uses: actions/upload-artifact@v4
with:
name: contrib-test-coverage-artifact
name: contrib-unit-test-coverage-artifact
path: |
contrib/nydusify/coverage.txt

Expand Down Expand Up @@ -283,27 +308,31 @@ jobs:
- name: Upload nydus coverage file
uses: actions/upload-artifact@v4
with:
name: nydus-test-coverage-artifact
name: nydus-unit-test-coverage-artifact
path: |
codecov.json

upload-coverage-to-codecov:
runs-on: ubuntu-latest
needs: [contrib-unit-test-coverage, nydus-unit-test-coverage]
needs: [contrib-unit-test-coverage, nydus-unit-test-coverage, nydus-integration-test]
steps:
- uses: actions/checkout@v4
- name: Download nydus coverage file
- name: Download nydus unit test coverage file
uses: actions/download-artifact@v4
with:
name: nydus-unit-test-coverage-artifact
- name: Download contrib unit test coverage file
uses: actions/download-artifact@v4
with:
name: nydus-test-coverage-artifact
- name: Download contrib coverage file
name: contrib-unit-test-coverage-artifact
- name: Download integration test coverage file
uses: actions/download-artifact@v4
with:
name: contrib-test-coverage-artifact
name: integration-test-coverage-artifact
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./codecov.json,./coverage.txt
files: ./codecov.json,./coverage.txt,./lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
fail_ci_if_error: true
Expand Down
3 changes: 2 additions & 1 deletion smoke/tests/native_layer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ func (n *NativeLayerTestSuite) TestMakeLayers() test.Generator {
param.GetString(paramFSVersion) != "5" ||
param.GetString(paramBatch) != "0" ||
param.GetBool(paramEncrypt) != false ||
param.GetString(paramChunkDedupDb) != "")
param.GetString(paramChunkDedupDb) != "" ||
param.GetString(paramCacheType) != "")
}

// rafs v6 not support cached mode nor dummy cache
Expand Down
Loading