From 24129b57b1541fb21726a035c7e7037feed8e8e5 Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Wed, 14 Feb 2024 20:02:41 +0100 Subject: [PATCH 01/13] Debug github context --- .github/workflows/main.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 16e38281..d75596ab 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -17,6 +17,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.merge_commit_sha }} - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v5 @@ -50,6 +52,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.merge_commit_sha }} + + - name: debug github context + run: echo "${{ toJson(github) }}" - name: Setup Python 3.11 uses: actions/setup-python@v5 From fceb41b6999358245318b2ef0cb8f255e4d3dc97 Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Wed, 14 Feb 2024 20:05:52 +0100 Subject: [PATCH 02/13] dummy change --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 312480a3..91310df2 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +Test PR # Titanoboa A [Vyper](https://github.com/vyperlang/vyper) interpreter with pretty tracebacks, forking, debugging features and more! Titanoboa's goal is to provide a modern, advanced and integrated development experience for vyper users. From 1515f70c894e112ba24d255e0f31333cbeca6289 Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Wed, 14 Feb 2024 20:02:41 +0100 Subject: [PATCH 03/13] Debug github context --- .github/workflows/main.yaml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 16e38281..5b3ed91c 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -18,6 +18,10 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Merge base branch + if: github.event_name == 'pull_request_target' + run: git pull origin ${{ github.event.pull_request.base.ref }} --ff-only --no-edit + - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: @@ -51,6 +55,13 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Merge base branch + if: github.event_name == 'pull_request_target' + run: git pull origin ${{ github.event.pull_request.base.ref }} --ff-only --no-edit + + - name: debug github context + run: echo "${{ toJson(github) }}" + - name: Setup Python 3.11 uses: actions/setup-python@v5 with: @@ -84,8 +95,10 @@ jobs: } - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.merge_commit_sha }} + + - name: Merge base branch + if: github.event_name == 'pull_request_target' + run: git pull origin ${{ github.event.pull_request.base.ref }} --ff-only --no-edit - name: Setup Python 3.11 uses: actions/setup-python@v4 From aa39e335a731875ef8ffaa33a8ff8835d7e5cd89 Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Wed, 14 Feb 2024 20:11:57 +0100 Subject: [PATCH 04/13] Remove debug --- .github/workflows/main.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 5b3ed91c..c5cdc9c8 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -59,9 +59,6 @@ jobs: if: github.event_name == 'pull_request_target' run: git pull origin ${{ github.event.pull_request.base.ref }} --ff-only --no-edit - - name: debug github context - run: echo "${{ toJson(github) }}" - - name: Setup Python 3.11 uses: actions/setup-python@v5 with: From 95b43c6966ed92bbacb3e1d8ebdf78847a9bee32 Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Wed, 14 Feb 2024 20:24:18 +0100 Subject: [PATCH 05/13] Remove ff-only --- .github/workflows/main.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c5cdc9c8..cbd3301c 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -20,7 +20,7 @@ jobs: - name: Merge base branch if: github.event_name == 'pull_request_target' - run: git pull origin ${{ github.event.pull_request.base.ref }} --ff-only --no-edit + run: git pull origin ${{ github.event.pull_request.base.ref }} --no-edit - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v5 @@ -57,7 +57,7 @@ jobs: - name: Merge base branch if: github.event_name == 'pull_request_target' - run: git pull origin ${{ github.event.pull_request.base.ref }} --ff-only --no-edit + run: git pull origin ${{ github.event.pull_request.base.ref }} --no-edit - name: Setup Python 3.11 uses: actions/setup-python@v5 @@ -95,7 +95,7 @@ jobs: - name: Merge base branch if: github.event_name == 'pull_request_target' - run: git pull origin ${{ github.event.pull_request.base.ref }} --ff-only --no-edit + run: git pull origin ${{ github.event.pull_request.base.ref }} --no-edit - name: Setup Python 3.11 uses: actions/setup-python@v4 From 20298ecb9ce644c86d2fb88e549b558d933618c1 Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Wed, 14 Feb 2024 20:25:33 +0100 Subject: [PATCH 06/13] Simplify --- .github/workflows/main.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index cbd3301c..8d3f14eb 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -20,7 +20,7 @@ jobs: - name: Merge base branch if: github.event_name == 'pull_request_target' - run: git pull origin ${{ github.event.pull_request.base.ref }} --no-edit + run: git pull origin ${{ github.base_ref }} --no-edit - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v5 @@ -57,7 +57,7 @@ jobs: - name: Merge base branch if: github.event_name == 'pull_request_target' - run: git pull origin ${{ github.event.pull_request.base.ref }} --no-edit + run: git pull origin ${{ github.base_ref }} --no-edit - name: Setup Python 3.11 uses: actions/setup-python@v5 @@ -95,7 +95,7 @@ jobs: - name: Merge base branch if: github.event_name == 'pull_request_target' - run: git pull origin ${{ github.event.pull_request.base.ref }} --no-edit + run: git pull origin ${{ github.base_ref }} --no-edit - name: Setup Python 3.11 uses: actions/setup-python@v4 From cb6123570e18c7402edb25578b479bbdcf1e36d7 Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Wed, 14 Feb 2024 20:36:05 +0100 Subject: [PATCH 07/13] Checkout head ref --- .github/workflows/main.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 8d3f14eb..c751c6b4 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -17,6 +17,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} - name: Merge base branch if: github.event_name == 'pull_request_target' @@ -54,6 +56,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} - name: Merge base branch if: github.event_name == 'pull_request_target' @@ -92,6 +96,8 @@ jobs: } - uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} - name: Merge base branch if: github.event_name == 'pull_request_target' From b11a8b2d0d92882880a4235440b9741d4e5c771e Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Wed, 14 Feb 2024 20:39:30 +0100 Subject: [PATCH 08/13] Re-add ff-only --- .github/workflows/main.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c751c6b4..cac912cd 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -22,7 +22,7 @@ jobs: - name: Merge base branch if: github.event_name == 'pull_request_target' - run: git pull origin ${{ github.base_ref }} --no-edit + run: git pull origin ${{ github.base_ref }} --no-edit --ff-only - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v5 @@ -61,7 +61,7 @@ jobs: - name: Merge base branch if: github.event_name == 'pull_request_target' - run: git pull origin ${{ github.base_ref }} --no-edit + run: git pull origin ${{ github.base_ref }} --no-edit --ff-only - name: Setup Python 3.11 uses: actions/setup-python@v5 @@ -101,7 +101,7 @@ jobs: - name: Merge base branch if: github.event_name == 'pull_request_target' - run: git pull origin ${{ github.base_ref }} --no-edit + run: git pull origin ${{ github.base_ref }} --no-edit --ff-only - name: Setup Python 3.11 uses: actions/setup-python@v4 From 95ccaaae84268b90c88cea269377a6a3d28acc85 Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Wed, 14 Feb 2024 20:47:17 +0100 Subject: [PATCH 09/13] Try to fetch first --- .github/workflows/main.yaml | 105 +----------------------------------- 1 file changed, 2 insertions(+), 103 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index cac912cd..1e00e6b1 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -22,107 +22,6 @@ jobs: - name: Merge base branch if: github.event_name == 'pull_request_target' - run: git pull origin ${{ github.base_ref }} --no-edit --ff-only - - - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - cache: "pip" - - - name: Install Requirements - run: | - pip install -r dev-requirements.txt - pip install . - - - name: Run Unit Tests - env: - PYTHONPATH: ${{ github.workspace }} - # pass internals to pytest-cov, since we are testing a pytest plugin. - # See https://github.com/pytest-dev/pytest-cov/blob/2c9f2170/docs/plugins.rst - COV_CORE_SOURCE: boa - COV_CORE_CONFIG: .coveragerc - COV_CORE_DATAFILE: .coverage.eager - run: >- - pytest - --cov=boa - --cov-append - --cov-report term-missing:skip-covered - --cov-fail-under=70 - tests/unitary/ - - anvil: - name: "integration tests (anvil)" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.head_ref }} - - - name: Merge base branch - if: github.event_name == 'pull_request_target' - run: git pull origin ${{ github.base_ref }} --no-edit --ff-only - - - name: Setup Python 3.11 - uses: actions/setup-python@v5 - with: - python-version: "3.11" - cache: "pip" - - - name: Install Requirements - run: | - pip install -r dev-requirements.txt - pip install . - - - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 - - - name: Run Networked Tests against anvil - # run separately to clarify its dependency on outside binary - run: pytest -n auto tests/integration/network/anvil/ - - integration: - name: "integration tests (Alchemy: fork mode and Sepolia)" - runs-on: ubuntu-latest - steps: - - name: Check if the user is a contributor - uses: actions/github-script@v7 - with: - script: | - const { actor: username, repo: { owner, repo } } = context; - const collaborator = await github.rest.repos.getCollaboratorPermissionLevel({ owner, repo, username }); - if (!collaborator.data.user.permissions.push) { - core.setFailed(username + ' is not a contributor'); - } - - - uses: actions/checkout@v4 - with: - ref: ${{ github.head_ref }} - - - name: Merge base branch - if: github.event_name == 'pull_request_target' - run: git pull origin ${{ github.base_ref }} --no-edit --ff-only - - - name: Setup Python 3.11 - uses: actions/setup-python@v4 - with: - python-version: "3.11" - cache: "pip" - - - name: Install Requirements run: | - pip install -r dev-requirements.txt - pip install . - - - name: Run Fork Mode Tests - run: pytest -n auto tests/integration/fork/ - env: - MAINNET_ENDPOINT: ${{ secrets.ALCHEMY_MAINNET_ENDPOINT }} - ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} - - - name: Run Sepolia Tests - # disable xdist, otherwise they can contend for tx nonce - run: pytest -n 0 tests/integration/network/sepolia/ - env: - SEPOLIA_ENDPOINT: ${{ secrets.ALCHEMY_SEPOLIA_ENDPOINT }} - SEPOLIA_PKEY: ${{ secrets.SEPOLIA_PKEY }} + git fetch origin ${{ github.base_ref }} + git merge ${{ github.base_ref }} --no-edit From 99ba435861213cd2e2342147d2ed26bc4ef9344a Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Wed, 14 Feb 2024 20:47:17 +0100 Subject: [PATCH 10/13] Try to fetch first --- .github/workflows/main.yaml | 107 +----------------------------------- 1 file changed, 3 insertions(+), 104 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index cac912cd..4c1d0d06 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" ] name: "unit tests: python ${{ matrix.python-version }}" @@ -22,107 +22,6 @@ jobs: - name: Merge base branch if: github.event_name == 'pull_request_target' - run: git pull origin ${{ github.base_ref }} --no-edit --ff-only - - - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - cache: "pip" - - - name: Install Requirements - run: | - pip install -r dev-requirements.txt - pip install . - - - name: Run Unit Tests - env: - PYTHONPATH: ${{ github.workspace }} - # pass internals to pytest-cov, since we are testing a pytest plugin. - # See https://github.com/pytest-dev/pytest-cov/blob/2c9f2170/docs/plugins.rst - COV_CORE_SOURCE: boa - COV_CORE_CONFIG: .coveragerc - COV_CORE_DATAFILE: .coverage.eager - run: >- - pytest - --cov=boa - --cov-append - --cov-report term-missing:skip-covered - --cov-fail-under=70 - tests/unitary/ - - anvil: - name: "integration tests (anvil)" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.head_ref }} - - - name: Merge base branch - if: github.event_name == 'pull_request_target' - run: git pull origin ${{ github.base_ref }} --no-edit --ff-only - - - name: Setup Python 3.11 - uses: actions/setup-python@v5 - with: - python-version: "3.11" - cache: "pip" - - - name: Install Requirements - run: | - pip install -r dev-requirements.txt - pip install . - - - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 - - - name: Run Networked Tests against anvil - # run separately to clarify its dependency on outside binary - run: pytest -n auto tests/integration/network/anvil/ - - integration: - name: "integration tests (Alchemy: fork mode and Sepolia)" - runs-on: ubuntu-latest - steps: - - name: Check if the user is a contributor - uses: actions/github-script@v7 - with: - script: | - const { actor: username, repo: { owner, repo } } = context; - const collaborator = await github.rest.repos.getCollaboratorPermissionLevel({ owner, repo, username }); - if (!collaborator.data.user.permissions.push) { - core.setFailed(username + ' is not a contributor'); - } - - - uses: actions/checkout@v4 - with: - ref: ${{ github.head_ref }} - - - name: Merge base branch - if: github.event_name == 'pull_request_target' - run: git pull origin ${{ github.base_ref }} --no-edit --ff-only - - - name: Setup Python 3.11 - uses: actions/setup-python@v4 - with: - python-version: "3.11" - cache: "pip" - - - name: Install Requirements run: | - pip install -r dev-requirements.txt - pip install . - - - name: Run Fork Mode Tests - run: pytest -n auto tests/integration/fork/ - env: - MAINNET_ENDPOINT: ${{ secrets.ALCHEMY_MAINNET_ENDPOINT }} - ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} - - - name: Run Sepolia Tests - # disable xdist, otherwise they can contend for tx nonce - run: pytest -n 0 tests/integration/network/sepolia/ - env: - SEPOLIA_ENDPOINT: ${{ secrets.ALCHEMY_SEPOLIA_ENDPOINT }} - SEPOLIA_PKEY: ${{ secrets.SEPOLIA_PKEY }} + git fetch origin ${{ github.base_ref }} + git merge origin/${{ github.base_ref }} --no-edit From ca6b06ada51337ee7094ccb3efe0e06c5e71d9f8 Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Wed, 14 Feb 2024 21:00:29 +0100 Subject: [PATCH 11/13] give it some depth --- .github/workflows/main.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 4c1d0d06..bbbbee1b 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -19,6 +19,7 @@ jobs: - uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} + depth: 0 - name: Merge base branch if: github.event_name == 'pull_request_target' From 47abc86d8234e838423c604d641eb9e7d94c360c Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Thu, 15 Feb 2024 12:04:10 +0100 Subject: [PATCH 12/13] Typo --- .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 bbbbee1b..27435b79 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} - depth: 0 + fetch-depth: 2 - name: Merge base branch if: github.event_name == 'pull_request_target' From e5cc3ce7283f987d2232d078c5a87f6c97f56d93 Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Thu, 15 Feb 2024 12:07:40 +0100 Subject: [PATCH 13/13] Add fetch and merge to pipeline --- .github/workflows/main.yaml | 111 +++++++++++++++++++++++++++++++++++- 1 file changed, 110 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 27435b79..405f4534 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" ] + python-version: [ "3.10", "3.11" ] name: "unit tests: python ${{ matrix.python-version }}" @@ -26,3 +26,112 @@ jobs: run: | git fetch origin ${{ github.base_ref }} git merge origin/${{ github.base_ref }} --no-edit + + - name: Setup Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: "pip" + + - name: Install Requirements + run: | + pip install -r dev-requirements.txt + pip install . + + - name: Run Unit Tests + env: + PYTHONPATH: ${{ github.workspace }} + # pass internals to pytest-cov, since we are testing a pytest plugin. + # See https://github.com/pytest-dev/pytest-cov/blob/2c9f2170/docs/plugins.rst + COV_CORE_SOURCE: boa + COV_CORE_CONFIG: .coveragerc + COV_CORE_DATAFILE: .coverage.eager + run: >- + pytest + --cov=boa + --cov-append + --cov-report term-missing:skip-covered + --cov-fail-under=70 + tests/unitary/ + + anvil: + name: "integration tests (anvil)" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + fetch-depth: 2 + + - 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 + + - name: Setup Python 3.11 + uses: actions/setup-python@v5 + with: + python-version: "3.11" + cache: "pip" + + - name: Install Requirements + run: | + pip install -r dev-requirements.txt + pip install . + + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + + - name: Run Networked Tests against anvil + # run separately to clarify its dependency on outside binary + run: pytest -n auto tests/integration/network/anvil/ + + integration: + name: "integration tests (Alchemy: fork mode and Sepolia)" + runs-on: ubuntu-latest + steps: + - name: Check if the user is a contributor + uses: actions/github-script@v7 + with: + script: | + const { actor: username, repo: { owner, repo } } = context; + const collaborator = await github.rest.repos.getCollaboratorPermissionLevel({ owner, repo, username }); + if (!collaborator.data.user.permissions.push) { + core.setFailed(username + ' is not a contributor'); + } + + - uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + fetch-depth: 2 + + - 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 + + - name: Setup Python 3.11 + uses: actions/setup-python@v4 + with: + python-version: "3.11" + cache: "pip" + + - name: Install Requirements + run: | + pip install -r dev-requirements.txt + pip install . + + - name: Run Fork Mode Tests + run: pytest -n auto tests/integration/fork/ + env: + MAINNET_ENDPOINT: ${{ secrets.ALCHEMY_MAINNET_ENDPOINT }} + ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} + + - name: Run Sepolia Tests + # disable xdist, otherwise they can contend for tx nonce + run: pytest -n 0 tests/integration/network/sepolia/ + env: + SEPOLIA_ENDPOINT: ${{ secrets.ALCHEMY_SEPOLIA_ENDPOINT }} + SEPOLIA_PKEY: ${{ secrets.SEPOLIA_PKEY }}