Skip to content

Commit

Permalink
ci: consistent caching keys
Browse files Browse the repository at this point in the history
chore: fix formatting in CI files
chore: improve wording in CI files
ci: remove redundant "pnpm install" steps
  • Loading branch information
PaulRBerg committed Dec 15, 2023
1 parent 2a8b0b4 commit a110f20
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 30 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/ci-deep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,18 @@ jobs:
run: "FOUNDRY_PROFILE=optimized forge build"

- name: "Build the test contracts"
run: "FOUNDRY_PROFILE=test-optimized forge build"
run: "FOUNDRY_PROFILE=test-optimized forge build"

- name: "Cache the build so that it can be re-used by the other jobs"
- name: "Cache the build and the node modules so that they can be re-used by the other jobs"
uses: "actions/cache/save@v3"
with:
key: "foundry-build-${{ github.sha }}"
key: "build-and-modules-${{ github.sha }}"
path: |
cache
node_modules
out
out-optimized
- name: "Add build summary"
run: |
echo "## Build result" >> $GITHUB_STEP_SUMMARY
Expand All @@ -122,11 +122,11 @@ jobs:
- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"

- name: "Restore the cached build and node modules"
- name: "Restore the cached build and the node modules"
uses: "actions/cache/restore@v3"
with:
fail-on-cache-miss: true
key: "foundry-build-${{ github.sha }}"
key: "build-and-modules-${{ github.sha }}"
path: |
cache
node_modules
Expand All @@ -153,17 +153,17 @@ jobs:
- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"

- name: "Restore the cached build and node modules"
- name: "Restore the cached build and the node modules"
uses: "actions/cache/restore@v3"
with:
fail-on-cache-miss: true
key: "foundry-build-${{ github.sha }}"
key: "build-and-modules-${{ github.sha }}"
path: |
cache
node_modules
out
out-optimized
- name: "Run the integration tests against the optimized build"
run: "FOUNDRY_PROFILE=test-optimized forge test --match-path \"test/integration/**/*.sol\""

Expand All @@ -185,17 +185,17 @@ jobs:
- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"

- name: "Restore the cached build and node modules"
- name: "Restore the cached build and the node modules"
uses: "actions/cache/restore@v3"
with:
fail-on-cache-miss: true
key: "foundry-build-${{ github.sha }}"
key: "build-and-modules-${{ github.sha }}"
path: |
cache
node_modules
out
out-optimized
- name: "Run the invariant tests against the optimized build"
run: "FOUNDRY_PROFILE=test-optimized forge test --match-path \"test/invariant/**/*.sol\""

Expand All @@ -216,11 +216,11 @@ jobs:
- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"

- name: "Restore the cached build and node modules"
- name: "Restore the cached build and the node modules"
uses: "actions/cache/restore@v3"
with:
fail-on-cache-miss: true
key: "foundry-build-${{ github.sha }}"
key: "build-and-modules-${{ github.sha }}"
path: |
cache
node_modules
Expand All @@ -233,4 +233,4 @@ jobs:
- name: "Add test summary"
run: |
echo "## Fork tests result" >> $GITHUB_STEP_SUMMARY
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY
24 changes: 9 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:

- name: "Generate and prepare the contract artifacts"
run: "./shell/prepare-artifacts.sh"

- name: "Build the test contracts"
run: "FOUNDRY_PROFILE=test-optimized forge build"

Expand All @@ -90,9 +90,6 @@ jobs:
out
out-optimized
- name: "Install the Node.js dependencies"
run: "pnpm install"

- name: "Store the contract artifacts in CI"
uses: "actions/upload-artifact@v3"
with:
Expand Down Expand Up @@ -126,10 +123,7 @@ jobs:
cache: "pnpm"
node-version: "lts/*"

- name: "Install the Node.js dependencies"
run: "pnpm install"

- name: "Restore the cached build and node modules"
- name: "Restore the cached build and the node modules"
uses: "actions/cache/restore@v3"
with:
fail-on-cache-miss: true
Expand Down Expand Up @@ -160,7 +154,7 @@ jobs:
- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"

- name: "Restore the cached build and node modules"
- name: "Restore the cached build and the node modules"
uses: "actions/cache/restore@v3"
with:
fail-on-cache-miss: true
Expand Down Expand Up @@ -189,7 +183,7 @@ jobs:
- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"

- name: "Restore the cached build and node modules"
- name: "Restore the cached build and the node modules"
uses: "actions/cache/restore@v3"
with:
fail-on-cache-miss: true
Expand Down Expand Up @@ -218,7 +212,7 @@ jobs:
- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"

- name: "Restore the cached build and node modules"
- name: "Restore the cached build and the node modules"
uses: "actions/cache/restore@v3"
with:
fail-on-cache-miss: true
Expand All @@ -228,7 +222,7 @@ jobs:
node_modules
out
out-optimized
- name: "Run the invariant tests against the optimized build"
run: "FOUNDRY_PROFILE=test-optimized forge test --match-path \"test/invariant/**/*.sol\""

Expand All @@ -249,7 +243,7 @@ jobs:
- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"

- name: "Restore the cached build and node modules"
- name: "Restore the cached build and the node modules"
uses: "actions/cache/restore@v3"
with:
fail-on-cache-miss: true
Expand All @@ -259,7 +253,7 @@ jobs:
node_modules
out
out-optimized
- name: "Generate fuzz seed that changes weekly to avoid burning through RPC allowance"
run: |
echo "FOUNDRY_FUZZ_SEED=$(echo $(($EPOCHSECONDS / 604800)))" >> $GITHUB_ENV
Expand All @@ -282,7 +276,7 @@ jobs:
- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"

- name: "Restore the cached build and node modules"
- name: "Restore the cached build and the node modules"
uses: "actions/cache/restore@v3"
with:
fail-on-cache-miss: true
Expand Down

0 comments on commit a110f20

Please sign in to comment.