From 2e4be392ebe7775d1dde82bfcded4694fdbd0fff Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Mon, 19 Feb 2024 14:48:47 +0100 Subject: [PATCH 1/5] Simplify pipeline --- .github/workflows/integration.yaml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 9367e0ce..81394a78 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -27,18 +27,14 @@ jobs: core.setFailed(username + ' is not a contributor'); } - # specifically check out the head ref, not the default base ref. Depth is needed for the merge step. + # this will check out the base branch, not the head branch - uses: actions/checkout@v4 with: - ref: ${{ github.head_ref }} fetch-depth: 2 - # we want to run the tests on a merge commit, so we need to merge the base branch into the head branch - - name: Merge base branch - if: github.event_name == 'pull_request_target' - run: | - git fetch origin ${{ github.base_ref }} - git merge origin/${{ github.base_ref }} --no-edit + # now merge the head branch into the base branch, so we can run the tests with the head branch's changes + - name: Merge head branch + run: git pull origin ${{ github.head_ref }} --no-edit - name: Setup Python 3.11 uses: actions/setup-python@v4 From e9eb98a263f6ab7d11df287dbd58249b870536db Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Mon, 19 Feb 2024 20:51:29 +0100 Subject: [PATCH 2/5] Increase fetch depth --- .github/workflows/integration.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 81394a78..bd0e262c 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -30,7 +30,7 @@ jobs: # this will check out the base branch, not the head branch - uses: actions/checkout@v4 with: - fetch-depth: 2 + fetch-depth: 0 # we need the history to be able to merge # now merge the head branch into the base branch, so we can run the tests with the head branch's changes - name: Merge head branch From 6ef0e745f7b96df88da63c355ca4ce4dd74c1624 Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Tue, 20 Feb 2024 09:14:17 +0100 Subject: [PATCH 3/5] Add timeouts --- .github/workflows/.pre-commit-config.yaml | 1 + .github/workflows/integration.yaml | 1 + .github/workflows/main.yaml | 2 ++ 3 files changed, 4 insertions(+) diff --git a/.github/workflows/.pre-commit-config.yaml b/.github/workflows/.pre-commit-config.yaml index 3c0de790..38e3e5e3 100644 --- a/.github/workflows/.pre-commit-config.yaml +++ b/.github/workflows/.pre-commit-config.yaml @@ -8,6 +8,7 @@ on: jobs: pre-commit: runs-on: ubuntu-latest + timeout-minutes: 5 steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index bd0e262c..4cd75861 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -14,6 +14,7 @@ jobs: integration: name: "integration tests (Alchemy: fork mode and Sepolia)" runs-on: ubuntu-latest + timeout-minutes: 5 steps: # given we use the pull_request_trigger, only allow contributors to run tests with secrets diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index be905d1b..22ff7b97 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -14,6 +14,7 @@ jobs: python-version: [ "3.10", "3.11" ] name: "unit tests: python ${{ matrix.python-version }}" + timeout-minutes: 5 steps: - uses: actions/checkout@v4 @@ -48,6 +49,7 @@ jobs: anvil: name: "integration tests (anvil)" runs-on: ubuntu-latest + timeout-minutes: 5 steps: - uses: actions/checkout@v4 From f2f394ea8a72284e884edd89edc081e55a3d8f0f Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Wed, 21 Feb 2024 10:41:25 +0100 Subject: [PATCH 4/5] Make charles happy :) --- .github/workflows/integration.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 4cd75861..628be969 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -35,7 +35,9 @@ jobs: # now merge the head branch into the base branch, so we can run the tests with the head branch's changes - name: Merge head branch - run: git pull origin ${{ github.head_ref }} --no-edit + run: | + git fetch origin ${{ github.head_ref }} + git merge origin/${{ github.head_ref }} --no-edit - name: Setup Python 3.11 uses: actions/setup-python@v4 From 397df98de1f3c50743843dafe24b11e0aa07c62d Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Wed, 21 Feb 2024 15:31:14 +0100 Subject: [PATCH 5/5] Add 3.12 --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 22ff7b97..5b006647 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ "3.10", "3.11" ] + python-version: [ "3.10", "3.11", "3.12" ] name: "unit tests: python ${{ matrix.python-version }}" timeout-minutes: 5