diff --git a/.github/workflows/smoke.yml b/.github/workflows/smoke.yml index b35ab515397..19b3b459843 100644 --- a/.github/workflows/smoke.yml +++ b/.github/workflows/smoke.yml @@ -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: | @@ -158,9 +158,9 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Docker Cache - uses: jpribyl/action-docker-layer-caching@v0.1.0 - continue-on-error: true + # - name: Docker Cache + # uses: jpribyl/action-docker-layer-caching@v0.1.0 + # continue-on-error: true - name: Download Nydus uses: actions/download-artifact@v4 with: @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/smoke/tests/native_layer_test.go b/smoke/tests/native_layer_test.go index 30e20dfd9a1..f9f292475a2 100644 --- a/smoke/tests/native_layer_test.go +++ b/smoke/tests/native_layer_test.go @@ -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