Skip to content

Commit

Permalink
refactor(workflows): reads supported Foundry version from env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurgousset committed Jun 19, 2024
1 parent 0f7753e commit 8f039a2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
26 changes: 14 additions & 12 deletions .github/workflows/protocol-devchain-anvil.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
env:
# Increment these to force cache rebuilding
FOUNDRY_CACHE_KEY: 1
# Supported Foundry version defined at celo-org (GitHub organisation) level, for consistency across workflows.
SUPPORTED_FOUNDRY_VERSION: ${{ vars.SUPPORTED_FOUNDRY_VERSION }}
ANVIL_PORT: 8546

jobs:
Expand All @@ -16,8 +18,8 @@ jobs:
run:
working-directory: packages/protocol
name: Generate anvil
runs-on: ["self-hosted", "org", "npm-publish"]
permissions:
runs-on: ['self-hosted', 'org', 'npm-publish']
permissions:
contents: read
pull-requests: read
id-token: write
Expand Down Expand Up @@ -54,14 +56,14 @@ jobs:
uses: actions/github-script@v7
with:
script: |
const result = (
await github.rest.repos.listPullRequestsAssociatedWithCommit({
commit_sha: context.sha,
owner: context.repo.owner,
repo: context.repo.repo,
})
).data[0];
core.setOutput("number", result ? result.number : "");
const result = (
await github.rest.repos.listPullRequestsAssociatedWithCommit({
commit_sha: context.sha,
owner: context.repo.owner,
repo: context.repo.repo,
})
).data[0];
core.setOutput("number", result ? result.number : "");
- name: Set PR Number
id: set_pr_number
Expand All @@ -79,7 +81,7 @@ jobs:
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: "nightly-f625d0fa7c51e65b4bf1e8f7931cd1c6e2e285e9"
version: ${{ env.SUPPORTED_FOUNDRY_VERSION }}

- name: Install forge dependencies
run: forge install
Expand All @@ -91,7 +93,7 @@ jobs:
- name: Generate migrations and run devchain
if: success() || failure()
run: ./scripts/foundry/create_and_migrate_anvil_devchain.sh

- name: Run integration tests against local anvil devchain
if: success() || failure()
run: |
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/protocol_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ on:
env:
# Increment these to force cache rebuilding
FOUNDRY_CACHE_KEY: 2
# Supported Foundry version defined at celo-org (GitHub organisation) level, for consistency across workflows.
SUPPORTED_FOUNDRY_VERSION: ${{ vars.SUPPORTED_FOUNDRY_VERSION }}
ANVIL_PORT: 8546

jobs:
Expand Down Expand Up @@ -53,7 +55,7 @@ jobs:
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: "nightly-f625d0fa7c51e65b4bf1e8f7931cd1c6e2e285e9"
version: ${{ env.SUPPORTED_FOUNDRY_VERSION }}

- name: Install forge dependencies
run: forge install
Expand Down

0 comments on commit 8f039a2

Please sign in to comment.