diff --git a/.github/workflows/compare-layouts.yml b/.github/workflows/compare-layouts.yml index c49804b..da4408b 100644 --- a/.github/workflows/compare-layouts.yml +++ b/.github/workflows/compare-layouts.yml @@ -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 }} @@ -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. @@ -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. @@ -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." @@ -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 diff --git a/.github/workflows/forge-ci.yml b/.github/workflows/forge-ci.yml index a8ae91b..926f354 100644 --- a/.github/workflows/forge-ci.yml +++ b/.github/workflows/forge-ci.yml @@ -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. @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index deaeea0..b4e82c7 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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: @@ -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