diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 246a2e3cadc..98a15bd1910 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,6 +56,7 @@ jobs: echo Cargo Home: $CARGO_HOME echo Running User: $(whoami) make docker-smoke + sudo chown -R $(id -un):$(id -gn) . ~/.cargo/ deny: name: Cargo Deny diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3cfbfa42d93..972ff7ccb4a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,16 +17,10 @@ jobs: steps: - uses: actions/checkout@v2 - name: Cache cargo - uses: actions/cache@v2 + uses: Swatinem/rust-cache@v1 with: - path: | - ~/.cargo/registry - ~/.cargo/git - target-fusedev - target-virtiofs - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo + target-dir: ./target-fusedev + cache-on-failure: true - name: Build nydus-rs run: | make docker-static @@ -35,7 +29,7 @@ jobs: sudo mv target-fusedev/x86_64-unknown-linux-musl/release/nydusctl . sudo mv target-virtiofs/x86_64-unknown-linux-musl/release/nydusd nydusd-virtiofs sudo cp -r misc/configs . - sudo chown -R $(id -un):$(id -gn) . + sudo chown -R $(id -un):$(id -gn) . ~/.cargo/ - name: store-artifacts uses: actions/upload-artifact@v2 with: diff --git a/Makefile b/Makefile index 0d744aa3376..9cf8a5f7b27 100644 --- a/Makefile +++ b/Makefile @@ -106,6 +106,7 @@ docker-nydus-smoke: docker build -t nydus-smoke --build-arg ARCH=${ARCH} misc/nydus-smoke docker run --rm --privileged ${CARGO_BUILD_GEARS} \ -e TEST_WORKDIR_PREFIX=$(TEST_WORKDIR_PREFIX) \ + -v ~/.cargo:/root/.cargo \ -v $(TEST_WORKDIR_PREFIX) \ -v ${current_dir}:/nydus-rs \ nydus-smoke