-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): switch to using
Swatinem/rust-cache
action (#2671)
- Loading branch information
1 parent
f173c05
commit 14662ef
Showing
5 changed files
with
30 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,12 +29,6 @@ jobs: | |
runs-on: macos-latest | ||
env: | ||
CROSS_CONFIG: ${{ github.workspace }}/.github/Cross.toml | ||
CACHED_PATHS: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
strategy: | ||
matrix: | ||
target: [x86_64-apple-darwin, aarch64-apple-darwin] | ||
|
@@ -52,28 +46,21 @@ jobs: | |
echo "SDKROOT=$(xcrun -sdk macosx$(sw_vers -productVersion) --show-sdk-path)" >> $GITHUB_ENV | ||
echo "MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx$(sw_vers -productVersion) --show-sdk-platform-version)" >> $GITHUB_ENV | ||
- uses: actions/cache/restore@v3 | ||
id: cache | ||
with: | ||
path: ${{ env.CACHED_PATHS }} | ||
key: ${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Setup toolchain | ||
uses: dtolnay/[email protected] | ||
with: | ||
targets: ${{ matrix.target }} | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
key: ${{ matrix.target }} | ||
cache-on-failure: true | ||
save-if: ${{ github.event_name != 'merge_group' }} | ||
|
||
- name: Build environment and Compile | ||
run: | | ||
cargo build --package nargo_cli --release --target ${{ matrix.target }} --no-default-features --features "${{ inputs.features }}" | ||
- uses: actions/cache/save@v3 | ||
# Don't create cache entries for the merge queue. | ||
if: ${{ steps.cache.outputs.cache-hit != 'true' && github.event_name != 'merge_group' }} | ||
with: | ||
path: ${{ env.CACHED_PATHS }} | ||
key: ${{ steps.cache.outputs.cache-primary-key }} | ||
|
||
- name: Package artifacts | ||
run: | | ||
mkdir dist | ||
|
@@ -111,12 +98,6 @@ jobs: | |
runs-on: ubuntu-22.04 | ||
env: | ||
CROSS_CONFIG: ${{ github.workspace }}/.github/Cross.toml | ||
CACHED_PATHS: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
@@ -128,17 +109,17 @@ jobs: | |
with: | ||
ref: ${{ inputs.tag || env.GITHUB_REF }} | ||
|
||
- uses: actions/cache/restore@v3 | ||
id: cache | ||
with: | ||
path: ${{ env.CACHED_PATHS }} | ||
key: ${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Setup toolchain | ||
uses: dtolnay/[email protected] | ||
with: | ||
targets: ${{ matrix.target }} | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
key: ${{ matrix.target }} | ||
cache-on-failure: true | ||
save-if: ${{ github.event_name != 'merge_group' }} | ||
|
||
- name: Install Cross | ||
uses: taiki-e/install-action@v2 | ||
with: | ||
|
@@ -147,13 +128,6 @@ jobs: | |
- name: Build Nargo | ||
run: cross build --package nargo_cli --release --target=${{ matrix.target }} --no-default-features --features "${{ inputs.features }}" | ||
|
||
- uses: actions/cache/save@v3 | ||
# Don't create cache entries for the merge queue. | ||
if: ${{ steps.cache.outputs.cache-hit != 'true' && github.event_name != 'merge_group' }} | ||
with: | ||
path: ${{ env.CACHED_PATHS }} | ||
key: ${{ steps.cache.outputs.cache-primary-key }} | ||
|
||
- name: Package artifacts | ||
run: | | ||
mkdir dist | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,13 +17,6 @@ jobs: | |
name: Test on ${{ matrix.os }} | ||
runs-on: ${{ matrix.runner }} | ||
timeout-minutes: 30 | ||
env: | ||
CACHED_PATHS: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
|
||
strategy: | ||
fail-fast: false | ||
|
@@ -37,24 +30,16 @@ jobs: | |
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Restore nix store cache | ||
uses: actions/cache/restore@v3 | ||
id: cache | ||
with: | ||
path: ${{ env.CACHED_PATHS }} | ||
key: ${{ matrix.target }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Setup toolchain | ||
uses: dtolnay/[email protected] | ||
with: | ||
targets: ${{ matrix.target }} | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
key: ${{ matrix.target }} | ||
cache-on-failure: true | ||
save-if: ${{ github.event_name != 'merge_group' }} | ||
|
||
- name: Run tests | ||
run: cargo test --workspace --locked --release | ||
|
||
- uses: actions/cache/save@v3 | ||
# Write a cache entry even if the tests fail but don't create any for the merge queue. | ||
if: ${{ always() && steps.cache.outputs.cache-hit != 'true' && github.event_name != 'merge_group' }} | ||
with: | ||
path: ${{ env.CACHED_PATHS }} | ||
key: ${{ steps.cache.outputs.cache-primary-key }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,13 +14,6 @@ concurrency: | |
jobs: | ||
build-nargo: | ||
runs-on: ubuntu-22.04 | ||
env: | ||
CACHED_PATHS: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
strategy: | ||
matrix: | ||
target: [x86_64-unknown-linux-gnu] | ||
|
@@ -29,25 +22,18 @@ jobs: | |
- name: Checkout Noir repo | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/cache/restore@v3 | ||
id: cache | ||
with: | ||
path: ${{ env.CACHED_PATHS }} | ||
key: ${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Setup toolchain | ||
uses: dtolnay/[email protected] | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
key: ${{ matrix.target }} | ||
cache-on-failure: true | ||
save-if: ${{ github.event_name != 'merge_group' }} | ||
|
||
- name: Build Nargo | ||
run: cargo build --package nargo_cli --release | ||
|
||
- uses: actions/cache/save@v3 | ||
# Don't create cache entries for the merge queue. | ||
if: ${{ steps.cache.outputs.cache-hit != 'true' && github.event_name != 'merge_group' }} | ||
with: | ||
path: ${{ env.CACHED_PATHS }} | ||
key: ${{ steps.cache.outputs.cache-primary-key }} | ||
|
||
- name: Package artifacts | ||
run: | | ||
mkdir dist | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters