Skip to content

Commit

Permalink
fix(ci): always create matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxMustermann2 committed Nov 27, 2024
1 parent 93a0a13 commit 3866fc9
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/compare-layouts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,17 @@ jobs:
skip-install: ${{ github.event.workflow_run.conclusion != 'success' }}

create-deployed-layouts-matrix:
# Generating the matrix is very quick. It should be done regardless of the parent
# workflow status, because an empty matrix will result in no `fetch-deployed-layouts`
# jobs, which will cascade to no `compare-storage-layouts` job.
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.generate-matrix.outputs.matrix }}
steps:
- name: Echo a message to avoid "no action run" warning.
run: echo "Creating the matrix for deployed layouts."
- name: Checkout code
uses: actions/checkout@v4
if: ${{ github.event.workflow_run.conclusion == 'success' }}
- name: Generate matrix from deployedContracts.json
id: generate-matrix
if: ${{ github.event.workflow_run.conclusion == 'success' }}
run: |
set -e
data=$(cat script/deployedContracts.json)
Expand Down Expand Up @@ -145,14 +144,19 @@ jobs:
- create-deployed-layouts-matrix
runs-on: ubuntu-latest
steps:
- name: Echo a message to prevent "no steps" warning.
run: echo "Fetching the deployed layouts."
- name: Restore cached Foundry toolchain
if: ${{ github.event.workflow_run.conclusion == 'success' }}
uses: actions/cache/restore@v3
with:
path: ${{ needs.setup.outputs.installation-dir }}
key: ${{ needs.setup.outputs.cache-key }}
- name: Add Foundry to PATH
if: ${{ github.event.workflow_run.conclusion == 'success' }}
run: echo "${{ needs.setup.outputs.installation-dir }}" >> "$GITHUB_PATH"
- name: Fetch the deployed layout
if: ${{ github.event.workflow_run.conclusion == 'success' }}
env:
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
Expand All @@ -163,6 +167,7 @@ jobs:
--rpc-url "$RPC_URL" \
--etherscan-api-key "$ETHERSCAN_API_KEY" > "${{ matrix.contract.name }}.deployed.json"
- name: Upload the deployed layout file as an artifact
if: ${{ github.event.workflow_run.conclusion == 'success' }}
uses: actions/upload-artifact@v4
with:
path: ${{ matrix.contract.name }}.deployed.json
Expand All @@ -173,7 +178,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Echo a message
- name: Echo a message to prevent "no steps" warning.
run: echo "Combining the deployed layouts."
- name: Download artifacts
if: ${{ github.event.workflow_run.conclusion == 'success' }}
Expand Down

0 comments on commit 3866fc9

Please sign in to comment.