Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 37 additions & 9 deletions .github/workflows/pr-main_l1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
merge_group:
pull_request:
branches: ["**"]
paths-ignore:
- "crates/l2/**" # Behind a feature flag not used in this workflow

permissions:
contents: read
Expand All @@ -17,10 +15,35 @@ concurrency:
cancel-in-progress: true

jobs:
detect-changes:
runs-on: ubuntu-latest
outputs:
run_tests: ${{ steps.finish.outputs.run_tests }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
run_tests:
- '!crates/l2/**'
- name: finish
id: finish
run: |
if [[ "${GITHUB_EVENT_NAME}" != "pull_request" ]]; then
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The environment variable should be $GITHUB_EVENT_NAME instead of ${GITHUB_EVENT_NAME}. While both syntaxes work in bash, GitHub Actions sets this as GITHUB_EVENT_NAME and the standard pattern in GitHub Actions is to use the $GITHUB_EVENT_NAME syntax for consistency with GitHub Actions documentation.

Suggested change
if [[ "${GITHUB_EVENT_NAME}" != "pull_request" ]]; then
if [[ "$GITHUB_EVENT_NAME" != "pull_request" ]]; then

Copilot uses AI. Check for mistakes.
echo "run_tests=true" >> "$GITHUB_OUTPUT"
else
echo "run_tests=${{ steps.filter.outputs.run_tests }}" >> "$GITHUB_OUTPUT"
fi
- name: Print result
run: echo "run_tests=${{ steps.finish.outputs.run_tests }}"

lint:
# "Lint" is a required check, don't change the name
name: Lint
runs-on: ubuntu-latest
needs: detect-changes
if: ${{ needs.detect-changes.outputs.run_tests == 'true' }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand Down Expand Up @@ -61,6 +84,8 @@ jobs:
test:
# "Test" is a required check, don't change the name
name: Test
needs: detect-changes
if: ${{ needs.detect-changes.outputs.run_tests == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout sources
Expand All @@ -84,6 +109,8 @@ jobs:
docker_build:
name: Build Docker
runs-on: ubuntu-latest
needs: detect-changes
if: ${{ needs.detect-changes.outputs.run_tests == 'true' }}
steps:
- uses: actions/checkout@v4

Expand All @@ -105,8 +132,8 @@ jobs:
run-assertoor:
name: Assertoor - ${{ matrix.name }}
runs-on: ubuntu-latest
needs: [docker_build]
if: ${{ github.event_name != 'merge_group' }}
needs: [detect-changes, docker_build]
if: ${{ needs.detect-changes.outputs.run_tests == 'true' && github.event_name != 'merge_group' }}
strategy:
fail-fast: true
matrix:
Expand Down Expand Up @@ -147,8 +174,8 @@ jobs:
run-hive:
name: Hive - ${{ matrix.name }}
runs-on: ubuntu-latest
needs: [docker_build]
if: ${{ github.event_name != 'merge_group' }}
needs: [detect-changes, docker_build]
if: ${{ needs.detect-changes.outputs.run_tests == 'true' && github.event_name != 'merge_group' }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -254,9 +281,9 @@ jobs:
# "Integration Test" is a required check, don't change the name
name: Integration Test
runs-on: ubuntu-latest
needs: [run-assertoor, run-hive]
needs: [detect-changes, run-assertoor, run-hive]
# Make sure this job runs even if the previous jobs failed or were skipped
if: ${{ always() && needs.run-assertoor.result != 'skipped' && needs.run-hive.result != 'skipped' }}
if: ${{ needs.detect-changes.outputs.run_tests == 'true' && always() && needs.run-assertoor.result != 'skipped' && needs.run-hive.result != 'skipped' }}
steps:
- name: Check if any job failed
run: |
Expand All @@ -273,7 +300,8 @@ jobs:
reorg-tests:
name: Reorg Tests
runs-on: ubuntu-latest
if: ${{ github.event_name != 'merge_group' }}
needs: detect-changes
if: ${{ needs.detect-changes.outputs.run_tests == 'true' && github.event_name != 'merge_group' }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand Down
63 changes: 48 additions & 15 deletions .github/workflows/pr-main_l2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ on:
branches: ["main"]
pull_request:
branches: ["**"]
paths:
- "crates/l2/**"
- "fixtures/**"
- "crates/blockchain/dev/**"
- "crates/vm/levm/**"
- ".github/workflows/pr-main_l2.yaml"
- "cmd/ethrex/l2/**"

permissions:
contents: read
Expand All @@ -24,10 +17,40 @@ env:
DOCKER_ETHREX_WORKDIR: /usr/local/bin

jobs:
detect-changes:
runs-on: ubuntu-latest
outputs:
run_tests: ${{ steps.finish.outputs.run_tests }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
run_tests:
- "crates/l2/**"
- "fixtures/**"
- "crates/blockchain/dev/**"
- "crates/vm/levm/**"
- ".github/workflows/pr-main_l2.yaml"
- "cmd/ethrex/l2/**"
- name: finish
id: finish
run: |
if [[ "${GITHUB_EVENT_NAME}" != "pull_request" ]]; then
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The environment variable should be $GITHUB_EVENT_NAME instead of ${GITHUB_EVENT_NAME}. While both syntaxes work in bash, GitHub Actions sets this as GITHUB_EVENT_NAME and the standard pattern in GitHub Actions is to use the $GITHUB_EVENT_NAME syntax for consistency with GitHub Actions documentation.

Suggested change
if [[ "${GITHUB_EVENT_NAME}" != "pull_request" ]]; then
if [[ "$GITHUB_EVENT_NAME" != "pull_request" ]]; then

Copilot uses AI. Check for mistakes.
echo "run_tests=true" >> "$GITHUB_OUTPUT"
else
echo "run_tests=${{ steps.filter.outputs.run_tests }}" >> "$GITHUB_OUTPUT"
fi
- name: Print result
run: echo "run_tests=${{ steps.finish.outputs.run_tests }}"

lint:
# "Lint" is a required check, don't change the name
name: Lint
# "Lint L2" is a required check, don't change the name
name: Lint L2
runs-on: ubuntu-latest
needs: detect-changes
if: ${{ needs.detect-changes.outputs.run_tests == 'true' }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand Down Expand Up @@ -69,6 +92,8 @@ jobs:
build-docker:
name: Build docker image
runs-on: ubuntu-latest
needs: detect-changes
if: ${{ needs.detect-changes.outputs.run_tests == 'true' }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand All @@ -94,6 +119,8 @@ jobs:
build-docker-l2:
name: Build docker image L2
runs-on: ubuntu-latest
needs: detect-changes
if: ${{ needs.detect-changes.outputs.run_tests == 'true' }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand All @@ -119,7 +146,8 @@ jobs:
integration-test:
name: Integration Test - ${{ matrix.name }}
runs-on: ubuntu-latest
needs: [build-docker, build-docker-l2]
needs: [detect-changes, build-docker, build-docker-l2]
if: ${{ needs.detect-changes.outputs.run_tests == 'true' }}
strategy:
matrix:
include:
Expand Down Expand Up @@ -309,7 +337,8 @@ jobs:
integration-test-tdx:
name: Integration Test - TDX
runs-on: ubuntu-latest
needs: [build-docker, build-docker-l2]
needs: [detect-changes, build-docker, build-docker-l2]
if: ${{ needs.detect-changes.outputs.run_tests == 'true' }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand Down Expand Up @@ -416,7 +445,8 @@ jobs:
state-diff-test:
name: State Reconstruction Tests
runs-on: ubuntu-latest
needs: [build-docker, build-docker-l2]
needs: [detect-changes, build-docker, build-docker-l2]
if: ${{ needs.detect-changes.outputs.run_tests == 'true' }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand Down Expand Up @@ -477,6 +507,8 @@ jobs:
integration-test-l2-dev:
name: Integration Test - L2 Dev
runs-on: ubuntu-latest
needs: detect-changes
if: ${{ needs.detect-changes.outputs.run_tests == 'true' }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand Down Expand Up @@ -531,18 +563,19 @@ jobs:

# The purpose of this job is to add it as a required check in GitHub so that we don't have to add every individual job as a required check
all-tests:
# "Integration Test" is a required check, don't change the name
name: Integration Test
# "Integration Test L2" is a required check, don't change the name
name: Integration Test L2
runs-on: ubuntu-latest
needs:
[
detect-changes,
integration-test,
state-diff-test,
integration-test-tdx,
integration-test-l2-dev,
]
# Make sure this job runs even if the previous jobs failed or were skipped
if: ${{ always() && needs.integration-test.result != 'skipped' && needs.state-diff-test.result != 'skipped' && needs.integration-test-tdx.result != 'skipped' && needs.integration-test-l2-dev.result != 'skipped' }}
if: ${{ needs.detect-changes.outputs.run_tests == 'true' && always() && needs.integration-test.result != 'skipped' && needs.state-diff-test.result != 'skipped' && needs.integration-test-tdx.result != 'skipped' && needs.integration-test-l2-dev.result != 'skipped' }}
steps:
- name: Check if any job failed
run: |
Expand Down
Loading