diff --git a/.github/workflows/cargo-build-release.yml b/.github/workflows/cargo-build-release.yml index e259c4f9..c37c3129 100644 --- a/.github/workflows/cargo-build-release.yml +++ b/.github/workflows/cargo-build-release.yml @@ -38,15 +38,22 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/cache@v4 + - uses: Swatinem/rust-cache@v2 with: - path: | - ./target - ~/.cargo - key: ${{ runner.os }}-build-release-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', './rs') }} - restore-keys: | - ${{ runner.os }}-build-release-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', './rs') }} - ${{ runner.os }}-build-release- + shared-key: build-release + cache-all-crates: true + cache-targets: true + cache-on-failure: true + + # - uses: actions/cache@v4 + # with: + # path: | + # ./target + # ~/.cargo + # key: ${{ runner.os }}-build-release-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', './rs') }} + # restore-keys: | + # ${{ runner.os }}-build-release-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', './rs') }} + # ${{ runner.os }}-build-release- # - name: Local cargo cache # id: build-cargo-cache diff --git a/.github/workflows/cargo-build.yml b/.github/workflows/cargo-build.yml index a1ee8bf4..89cef3e4 100644 --- a/.github/workflows/cargo-build.yml +++ b/.github/workflows/cargo-build.yml @@ -45,16 +45,23 @@ jobs: steps: - uses: actions/checkout@v4 - - - uses: actions/cache@v4 + + - uses: Swatinem/rust-cache@v2 with: - path: | - ./target - ~/.cargo - key: ${{ runner.os }}-build-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', './rs') }} - restore-keys: | - ${{ runner.os }}-build-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', './rs') }} - ${{ runner.os }}-build- + shared-key: build + cache-all-crates: true + cache-targets: true + cache-on-failure: true + + # - uses: actions/cache@v4 + # with: + # path: | + # ./target + # ~/.cargo + # key: ${{ runner.os }}-build-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', './rs') }} + # restore-keys: | + # ${{ runner.os }}-build-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', './rs') }} + # ${{ runner.os }}-build- # - name: Local cargo cache # id: build-cargo-cache diff --git a/.github/workflows/cargo-integration-tests.yml b/.github/workflows/cargo-integration-tests.yml index ce8622d5..bb355973 100644 --- a/.github/workflows/cargo-integration-tests.yml +++ b/.github/workflows/cargo-integration-tests.yml @@ -47,15 +47,22 @@ jobs: - uses: actions/checkout@v4 - - uses: actions/cache@v4 + - uses: Swatinem/rust-cache@v2 with: - path: | - ./target - ~/.cargo - key: ${{ runner.os }}-integration-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', './rs') }} - restore-keys: | - ${{ runner.os }}-integration-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', './rs') }} - ${{ runner.os }}-integration- + shared-key: integration + cache-all-crates: true + cache-targets: true + cache-on-failure: true + + # - uses: actions/cache@v4 + # with: + # path: | + # ./target + # ~/.cargo + # key: ${{ runner.os }}-integration-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', './rs') }} + # restore-keys: | + # ${{ runner.os }}-integration-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', './rs') }} + # ${{ runner.os }}-integration- # - name: Local cargo cache # id: integration-tests-cargo-cache diff --git a/.github/workflows/cargo-unit-tests.yml b/.github/workflows/cargo-unit-tests.yml index 7fe06772..6b1cee69 100644 --- a/.github/workflows/cargo-unit-tests.yml +++ b/.github/workflows/cargo-unit-tests.yml @@ -47,16 +47,22 @@ jobs: steps: - uses: actions/checkout@v4 - - - uses: actions/cache@v4 + + - uses: Swatinem/rust-cache@v2 with: - path: | - ./target - ~/.cargo - key: ${{ runner.os }}-unit-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', './rs') }} - restore-keys: | - ${{ runner.os }}-unit-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', './rs') }} - ${{ runner.os }}-unit- + shared-key: unit + cache-all-crates: true + cache-targets: true + cache-on-failure: true + # - uses: actions/cache@v4 + # with: + # path: | + # ./target + # ~/.cargo + # key: ${{ runner.os }}-unit-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', './rs') }} + # restore-keys: | + # ${{ runner.os }}-unit-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', './rs') }} + # ${{ runner.os }}-unit- # - name: Local cargo cache # id: unit-tests-cargo-cache diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f3d0d33c..651b73a7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,6 +8,10 @@ on: tags: - "v*.*.*" +env: + CARGO_TERM_COLOR: always + CARGO_INCREMENTAL: "0" + jobs: release: @@ -34,16 +38,24 @@ jobs: # key: release-cargo-target - uses: actions/checkout@v4 - - - uses: actions/cache@v4 + + - uses: Swatinem/rust-cache@v2 with: - path: | - ./target - ~/.cargo - key: ${{ runner.os }}-build-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', './rs') }} - restore-keys: | - ${{ runner.os }}-build-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', './rs') }} - ${{ runner.os }}-build- + shared-key: build-release + cache-all-crates: true + cache-targets: true + cache-on-failure: true + save-if: ${{ github.ref == 'refs/heads/master' }} + + # - uses: actions/cache@v4 + # with: + # path: | + # ./target + # ~/.cargo + # key: ${{ runner.os }}-build-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', './rs') }} + # restore-keys: | + # ${{ runner.os }}-build-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', './rs') }} + # ${{ runner.os }}-build- - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3