diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 8e833ec15c..4b176ca18b 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -61,10 +61,18 @@ jobs: # to disallow that. with: ref: ${{ github.event.pull_request.head.sha }} - - name: Cache cargo - uses: Swatinem/rust-cache@v2 + - name: Cache cargo registry + uses: actions/cache@v3 + continue-on-error: false with: - cache-targets: false + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target + wasm/wasm_source/target + key: ${{ runner.os }}-wasm-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-wasm- - name: Build WASM run: make build-wasm-scripts - name: Upload wasm artifacts (github) @@ -75,6 +83,10 @@ jobs: wasm/tx_*.wasm wasm/vp_*.wasm wasm/checksums.json + - name: Clean cargo cache + run: | + cargo install cargo-cache --no-default-features --features ci-autoclean cargo-cache + cargo-cache test-wasm: timeout-minutes: 30 @@ -118,10 +130,18 @@ jobs: with: toolchain: ${{ matrix.nightly_version }} profile: default - - name: Cache cargo - uses: Swatinem/rust-cache@v2 + - name: Cache cargo registry + uses: actions/cache@v3 + continue-on-error: false with: - cache-targets: false + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target + wasm/wasm_source/target + key: ${{ runner.os }}-wasm-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-wasm- - name: Test Wasm run: make test-wasm - name: Check wasm up-to-date @@ -129,6 +149,10 @@ jobs: - name: Print diff if: failure() run: diff -y -W 150 wasm/checksums.json wasm/original-checksums.json --suppress-common-lines + - name: Clean cargo cache + run: | + cargo install cargo-cache --no-default-features --features ci-autoclean cargo-cache + cargo-cache upload-wasm: timeout-minutes: 5 @@ -203,10 +227,16 @@ jobs: with: toolchain: ${{ matrix.nightly_version }} profile: default - - name: Cache cargo - uses: Swatinem/rust-cache@v2 + - name: Cache cargo registry + uses: actions/cache@v3 + continue-on-error: false with: - cache-targets: false + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo- - name: Start sccache server run: sccache --start-server - name: Install mold linker @@ -244,6 +274,10 @@ jobs: - name: Stop sccache server if: always() run: sccache --stop-server || true + - name: Clean cargo cache + run: | + cargo install cargo-cache --no-default-features --features ci-autoclean cargo-cache + cargo-cache run-benchmarks: runs-on: @@ -288,10 +322,16 @@ jobs: with: toolchain: ${{ matrix.nightly_version }} profile: default - - name: Cache cargo - uses: Swatinem/rust-cache@v2 + - name: Cache cargo registry + uses: actions/cache@v3 + continue-on-error: false with: - cache-targets: false + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo- - name: Start sccache server run: sccache --start-server - name: Install mold linker @@ -319,6 +359,10 @@ jobs: - name: Stop sccache server if: always() run: sccache --stop-server || true + - name: Clean cargo cache + run: | + cargo install cargo-cache --no-default-features --features ci-autoclean cargo-cache + cargo-cache namada-release: runs-on: @@ -356,10 +400,16 @@ jobs: with: profile: default override: true - - name: Cache cargo - uses: Swatinem/rust-cache@v2 + - name: Cache cargo registry + uses: actions/cache@v3 + continue-on-error: false with: - cache-targets: false + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo- - name: Install mold linker run: | wget -q -O- https://github.com/rui314/mold/releases/download/v${{ matrix.mold_version }}/mold-${{ matrix.mold_version }}-x86_64-linux.tar.gz | tar -xz @@ -405,6 +455,10 @@ jobs: - name: Stop sccache server if: always() run: sccache --stop-server || true + - name: Clean cargo cache + run: | + cargo install cargo-cache --no-default-features --features ci-autoclean cargo-cache + cargo-cache namada-e2e: @@ -455,10 +509,16 @@ jobs: with: toolchain: ${{ matrix.nightly_version }} profile: default - - name: Cache cargo - uses: Swatinem/rust-cache@v2 + - name: Cache cargo registry + uses: actions/cache@v3 + continue-on-error: false with: - cache-targets: false + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo- - name: Start sccache server run: sccache --start-server - name: Install mold linker @@ -526,3 +586,7 @@ jobs: - name: Stop sccache server if: always() run: sccache --stop-server || true + - name: Clean cargo cache + run: | + cargo install cargo-cache --no-default-features --features ci-autoclean cargo-cache + cargo-cache diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 212d770a16..e00ce00bee 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -76,8 +76,17 @@ jobs: profile: default - name: Show rust toolchain info run: rustup show - - name: Cache cargo - uses: Swatinem/rust-cache@v2 + - name: Cache cargo registry + uses: actions/cache@v3 + continue-on-error: false + with: + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo- - name: Run sccache-cache uses: mozilla-actions/sccache-action@v0.0.3 - name: Start sccache server @@ -90,3 +99,7 @@ jobs: - name: Stop sccache server if: always() run: sccache --stop-server || true + - name: Clean cargo cache + run: | + cargo install cargo-cache --no-default-features --features ci-autoclean cargo-cache + cargo-cache diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index c65f9e4bf4..e5f74eb35f 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -41,8 +41,17 @@ jobs: profile: minimal - name: Show rust toolchain info run: rustup show - - name: Cache cargo - uses: Swatinem/rust-cache@v2 + - name: Cache cargo registry + uses: actions/cache@v3 + continue-on-error: false + with: + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo- - name: Install cargo ${{ matrix.make.command }} run: curl https://i.jpillora.com/${{ matrix.make.version }}! | bash - name: Install Protoc @@ -57,5 +66,7 @@ jobs: python3 ${{ matrix.make.command }}.py env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Clean cache folder - run: cargo install cargo-cache --no-default-features --features ci-autoclean cargo-cache && cargo-cache + - name: Clean cargo cache + run: | + cargo install cargo-cache --no-default-features --features ci-autoclean cargo-cache + cargo-cache diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index dd62265169..da52d82c73 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -104,6 +104,10 @@ jobs: - name: Stop sccache server if: always() run: sccache --stop-server || true + - name: Clean cargo cache + run: | + cargo install cargo-cache --no-default-features --features ci-autoclean cargo-cache + cargo-cache rust-docs: runs-on: ${{ matrix.os }} @@ -180,4 +184,8 @@ jobs: file: docker/docs/Dockerfile push: ${{ github.ref == 'refs/heads/main' }} tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + labels: ${{ steps.meta.outputs.labels }} + - name: Clean cargo cache + run: | + cargo install cargo-cache --no-default-features --features ci-autoclean cargo-cache + cargo-cache \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 54427662dc..36cecd5702 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,10 +49,16 @@ jobs: with: profile: minimal override: true - - name: Cache cargo - uses: Swatinem/rust-cache@v2 + - name: Cache cargo registry + uses: actions/cache@v3 + continue-on-error: false with: - cache-targets: false + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo- - name: Start sccache server run: sccache --start-server - name: Install cargo-about @@ -70,6 +76,10 @@ jobs: - name: Stop sccache server if: always() run: sccache --stop-server || true + - name: Clean cargo cache + run: | + cargo install cargo-cache --no-default-features --features ci-autoclean cargo-cache + cargo-cache release: needs: build diff --git a/.github/workflows/triggerable.yml b/.github/workflows/triggerable.yml index d9c7f0c495..9336471b94 100644 --- a/.github/workflows/triggerable.yml +++ b/.github/workflows/triggerable.yml @@ -13,11 +13,6 @@ on: default: 150 type: number -permissions: - id-token: read - contents: read - pull-requests: write - env: RUSTC_WRAPPER: sccache SCCACHE_S3_USE_SSL: ${{ secrets.CACHE_SSL }} @@ -32,16 +27,15 @@ env: jobs: pos: runs-on: ${{ matrix.os }} - timeout-minutes: ${{ matrix.make.timeout }} + timeout-minutes: ${{ matrix.timeout }} strategy: fail-fast: false matrix: os: [ubuntu-20.04] mold_version: [2.1.0] - make: - - name: Run PoS state-machine tests - command: make test-pos-sm - timeout: 360 + name: ["Run PoS state-machine tests"] + command: ["make test-pos-sm"] + timeout: [360] steps: - uses: actions/checkout@v4 @@ -58,18 +52,24 @@ jobs: with: profile: default override: true - - name: Cache cargo - uses: Swatinem/rust-cache@v2 + - name: Cache cargo registry + uses: actions/cache@v3 + continue-on-error: false with: - cache-targets: false + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo- - name: Start sccache server run: sccache --start-server - name: Install mold linker run: | wget -q -O- https://github.com/rui314/mold/releases/download/v${{ matrix.mold_version }}/mold-${{ matrix.mold_version }}-x86_64-linux.tar.gz | tar -xz mv mold-${{ matrix.mold_version }}-x86_64-linux/bin/mold /usr/local/bin - - name: Run task `${{ matrix.make.name }}` - run: ${{ matrix.make.command }} + - name: Run task `${{ matrix.name }}` + run: ${{ matrix.command }} env: PROPTEST_CASES: ${{ inputs.total_tests }} RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=/usr/local/bin/mold"