Skip to content

Commit

Permalink
Merge branch 'main' into adu-test
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxMustermann2 committed Nov 27, 2024
2 parents 3118f47 + 99bb116 commit 7d749f0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 23 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/compare-layouts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
# Do this job first to update the commit status and comment ASAP.
set-commit-status:
# Typically takes no more than 30s
timeout-minutes: 10
timeout-minutes: 5
runs-on: ubuntu-latest
outputs:
number: ${{ steps.pr-context.outputs.number }}
Expand Down Expand Up @@ -96,6 +96,8 @@ jobs:
skip-install: ${{ github.event.workflow_run.conclusion != 'success' }}

create-deployed-layouts-matrix:
# Takes about 2 seconds
timeout-minutes: 5
# 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.
Expand Down Expand Up @@ -131,10 +133,11 @@ jobs:
{name: "ExoCapsule", address: $capsule}] | map(select(.address != ""))')
echo "Matrix: $matrix"
echo "matrix=$(echo $matrix | jq -c .)" >> "${GITHUB_OUTPUT}"
echo "matrix=$(echo "$matrix" | jq -c .)" >> "${GITHUB_OUTPUT}"
fetch-deployed-layouts:
timeout-minutes: 30
# Takes about 15 seconds
timeout-minutes: 5
strategy:
matrix:
# if the parent workflow failed, the matrix will be empty. hence, no jobs will run.
Expand Down Expand Up @@ -174,9 +177,10 @@ jobs:
name: deployed-layout-${{ matrix.contract.name }}-${{ github.event.workflow_run.head_commit.id }}

combine-deployed-layouts:
# Takes about 4 seconds
timeout-minutes: 5
needs: fetch-deployed-layouts
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Echo a message to prevent "no steps" warning.
run: echo "Combining the deployed layouts."
Expand All @@ -197,8 +201,8 @@ jobs:

# The actual job to compare the storage layouts.
compare-storage-layouts:
# Typically takes no more than 7 minutes
timeout-minutes: 30
# Takes no more than a minute
timeout-minutes: 5
needs:
- setup
- set-commit-status
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/forge-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
foundry-version: nightly

build:
# Caching is slow; takes about 3 minutes.
timeout-minutes: 15
runs-on: ubuntu-latest
needs: setup
# Takes about 3 minutes
timeout-minutes: 15
outputs:
# The cache-key only contains the version name. It is only used so that the name does not
# need to be repeated everywhere; instead setting the `foundry-version` above suffices.
Expand Down Expand Up @@ -57,10 +57,10 @@ jobs:
key: build-${{ github.event.pull_request.head.sha || github.event.after || github.sha }}

test:
# Takes less than 30s
timeout-minutes: 5
runs-on: ubuntu-latest
needs: build
# No more than a few minutes
timeout-minutes: 5
steps:
- name: Restore cached Foundry toolchain
uses: actions/cache/restore@v3
Expand All @@ -86,10 +86,10 @@ jobs:
run: NO_COLOR=1 forge snapshot >> $GITHUB_STEP_SUMMARY

format:
# Takes less than 30s
timeout-minutes: 5
runs-on: ubuntu-latest
needs: build
# No more than a few minutes
timeout-minutes: 5
steps:
- name: Restore cached Foundry toolchain
uses: actions/cache/restore@v3
Expand All @@ -113,10 +113,10 @@ jobs:
run: forge fmt --check

extract-base-storage-layout-exocore-gateway:
# Takes less than 30 seconds, but add some margin for git clone
timeout-minutes: 10
runs-on: ubuntu-latest
needs: build
# A few minutes
timeout-minutes: 10
steps:
- name: Restore cached Foundry toolchain
uses: actions/cache/restore@v3
Expand Down Expand Up @@ -145,14 +145,14 @@ jobs:
path: ExocoreGateway.base.json
name: compiled-layout-ExocoreGateway-base-${{ github.event.pull_request.base.sha || github.event.after || github.sha }}

extract-storage-layouts:
extract-storage-layout:
# Takes less than 30 seconds
timeout-minutes: 5
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
contract: [Bootstrap, ClientChainGateway, RewardVault, Vault, ExocoreGateway, ExoCapsule]
# A few minutes
timeout-minutes: 10
steps:
- name: Restore cached Foundry toolchain
uses: actions/cache/restore@v3
Expand Down Expand Up @@ -182,12 +182,12 @@ jobs:
name: compiled-layout-${{ matrix.contract}}-${{ github.event.pull_request.head.sha || github.event.after || github.sha }}

combine-storage-layouts:
# Takes less than 10 seconds
timeout-minutes: 5
runs-on: ubuntu-latest
needs:
- extract-base-storage-layout-exocore-gateway
- extract-storage-layouts
# A few minutes
timeout-minutes: 10
- extract-storage-layout
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ on:

jobs:
lint:
# Usually done in 30 seconds
timeout-minutes: 5
strategy:
fail-fast: true
# No more than a few minutes
timeout-minutes: 5

runs-on: ubuntu-latest
steps:
Expand All @@ -24,7 +24,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18' # Latest LTS
node-version: '20' # LTS till Oct-25

- name: Clear npm cache
run: npm cache clean --force
Expand Down

0 comments on commit 7d749f0

Please sign in to comment.