diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index c2c4c94e7d4..4306ba7c395 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -19,18 +19,10 @@ jobs: - name: Checkout uses: actions/checkout@v3 - name: Setup Golang - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: - go-version: ~1.20 - - name: Golang Cache - uses: actions/cache@v3 - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-golang- + go-version-file: 'go.work' + cache-dependency-path: "**/*.sum" - name: Build Contrib run: | curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/local/bin v1.51.2 @@ -47,10 +39,10 @@ jobs: - name: Checkout uses: actions/checkout@v3 - name: Rust Cache - uses: Swatinem/rust-cache@v2.2.0 + uses: Swatinem/rust-cache@v2.7.0 with: cache-on-failure: true - shared-key: nydus-build + shared-key: Linux-cargo-amd64 - name: Build Nydus run: | rustup component add rustfmt clippy diff --git a/.github/workflows/convert.yml b/.github/workflows/convert.yml index 077c23b0584..30ff3be5765 100644 --- a/.github/workflows/convert.yml +++ b/.github/workflows/convert.yml @@ -20,18 +20,10 @@ jobs: - name: Checkout uses: actions/checkout@v3 - name: Setup Golang - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: - go-version: ~1.20 - - name: Golang Cache - uses: actions/cache@v3 - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-golang- + go-version-file: 'go.work' + cache-dependency-path: "**/*.sum" - name: Build Contrib run: | curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/local/bin v1.51.2 @@ -48,10 +40,10 @@ jobs: - name: Checkout uses: actions/checkout@v3 - name: Rust Cache - uses: Swatinem/rust-cache@v2.2.0 + uses: Swatinem/rust-cache@v2.7.0 with: cache-on-failure: true - shared-key: nydus-build + shared-key: Linux-cargo-amd64 - name: Build Nydus run: | rustup component add rustfmt clippy diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 84b179ce2a2..8650732d4ca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,10 +21,10 @@ jobs: steps: - uses: actions/checkout@v3 - name: Cache cargo - uses: Swatinem/rust-cache@v2.2.0 + uses: Swatinem/rust-cache@v2.7.0 with: cache-on-failure: true - key: ${{ runner.os }}-cargo-${{ matrix.arch }} + shared-key: ${{ runner.os }}-cargo-${{ matrix.arch }} - name: Build nydus-rs run: | declare -A rust_target_map=( ["amd64"]="x86_64-unknown-linux-musl" ["arm64"]="aarch64-unknown-linux-musl" ["ppc64le"]="powerpc64le-unknown-linux-gnu" ["riscv64"]="riscv64gc-unknown-linux-gnu") @@ -55,10 +55,10 @@ jobs: steps: - uses: actions/checkout@v3 - name: Cache cargo - uses: Swatinem/rust-cache@v2.2.0 + uses: Swatinem/rust-cache@v2.7.0 with: cache-on-failure: true - key: ${{ runner.os }}-cargo-${{ matrix.arch }} + shared-key: ${{ runner.os }}-cargo-${{ matrix.arch }} - name: build run: | if [[ "${{matrix.arch}}" == "amd64" ]]; then @@ -92,16 +92,11 @@ jobs: DOCKER: false steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - name: Setup Golang + uses: actions/setup-go@v4 with: - go-version: '1.20' - - name: cache go mod - uses: actions/cache@v3 - with: - path: /go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/contrib/nydusify/go.sum', '**/contrib/ctr-remote/go.sum', '**/contrib/nydus-overlayfs/go.sum') }} - restore-keys: | - ${{ runner.os }}-go + go-version-file: 'go.work' + cache-dependency-path: "**/*.sum" - name: build contrib go components run: | make -e GOARCH=${{ matrix.arch }} contrib-release diff --git a/.github/workflows/smoke.yml b/.github/workflows/smoke.yml index 2de88ad6ed7..4ec13070605 100644 --- a/.github/workflows/smoke.yml +++ b/.github/workflows/smoke.yml @@ -24,18 +24,10 @@ jobs: - name: Checkout uses: actions/checkout@v3 - name: Setup Golang - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: - go-version: ~1.20 - - name: Golang Cache - uses: actions/cache@v3 - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-golang- + go-version-file: 'go.work' + cache-dependency-path: "**/*.sum" - name: Build Contrib run: | curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/bin v1.51.2 @@ -53,10 +45,11 @@ jobs: - name: Checkout uses: actions/checkout@v3 - name: Rust Cache - uses: Swatinem/rust-cache@v2.2.0 + uses: Swatinem/rust-cache@v2.7.0 with: cache-on-failure: true - shared-key: nydus-build + shared-key: Linux-cargo-amd64 + save-if: ${{ github.ref == 'refs/heads/master' }} - name: Build Nydus run: | rustup component add rustfmt clippy @@ -77,10 +70,11 @@ jobs: steps: - uses: actions/checkout@v3 - name: Cache cargo - uses: Swatinem/rust-cache@v2.2.0 + uses: Swatinem/rust-cache@v2.7.0 with: cache-on-failure: true - key: ${{ runner.os }}-cargo-${{ matrix.arch }} + shared-key: ${{ runner.os }}-cargo-${{ matrix.arch }} + save-if: ${{ github.ref == 'refs/heads/master' }} - name: build run: | if [[ "${{matrix.arch}}" == "amd64" ]]; then @@ -166,10 +160,11 @@ jobs: - name: Checkout uses: actions/checkout@v3 - name: Rust Cache - uses: Swatinem/rust-cache@v2.2.0 + uses: Swatinem/rust-cache@v2.7.0 with: cache-on-failure: true - shared-key: nydus-build + shared-key: Linux-cargo-amd64 + save-if: ${{ github.ref == 'refs/heads/master' }} - name: Install cargo nextest uses: taiki-e/install-action@nextest - name: Fscache Setup @@ -187,9 +182,11 @@ jobs: steps: - uses: actions/checkout@v3 - name: Rust Cache - uses: Swatinem/rust-cache@v2.2.0 + uses: Swatinem/rust-cache@v2.7.0 with: cache-on-failure: true + shared-key: Linux-cargo-amd64 + save-if: ${{ github.ref == 'refs/heads/master' }} - name: Install cargo-llvm-cov uses: taiki-e/install-action@cargo-llvm-cov - name: Fscache Setup