Skip to content

Commit 6aa56cd

Browse files
gurukamathSamWilsn
authored andcommitted
feat(weld): parallelize CI post merge
* re-structure ci * create composite action * rename jobs * run static tests on GitHub runner
1 parent 70e88bd commit 6aa56cd

File tree

3 files changed

+88
-30
lines changed

3 files changed

+88
-30
lines changed

.github/actions/setup-env/action.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Setup Environment
2+
description: Common setup for Ethereum Spec jobs
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Install Rust
7+
uses: actions-rs/toolchain@v1
8+
with:
9+
toolchain: "1.69.0"
10+
override: true
11+
12+
- name: Install Tox and any other packages
13+
shell: bash
14+
run: |
15+
DEBIAN_FRONTEND=noninteractive apt-get install --yes --force-yes build-essential pkg-config
16+
pip install 'tox>=4.11,<5' requests
17+
18+
- name: Download Geth and add to $PATH
19+
shell: bash
20+
run: |
21+
mkdir -p $GITHUB_WORKSPACE/bin
22+
$GITHUB_WORKSPACE/scripts/download_geth_linux.py --dir $GITHUB_WORKSPACE/bin
23+
echo $GITHUB_WORKSPACE/bin >> $GITHUB_PATH

.github/workflows/test.yaml

Lines changed: 63 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,53 +10,88 @@ on:
1010
pull_request:
1111

1212
jobs:
13-
build:
14-
runs-on: [self-hosted-ghr, size-xl-x64]
15-
strategy:
16-
matrix:
17-
py: [ "3.11", "pypy3.11" ]
18-
13+
static:
14+
runs-on: ubuntu-latest
1915
steps:
2016
- uses: actions/checkout@v4
2117
with:
2218
submodules: recursive
23-
24-
- name: Install Rust
25-
uses: actions-rs/toolchain@v1
26-
with:
27-
toolchain: "1.69.0"
28-
override: true
29-
3019
- name: Setup Python
3120
uses: actions/setup-python@v5
3221
with:
33-
python-version: ${{ matrix.py }}
34-
22+
python-version: "3.11"
3523
- name: Install Tox and any other packages
24+
shell: bash
3625
run: |
37-
DEBIAN_FRONTEND=noninteractive apt-get install --yes --force-yes build-essential pkg-config
26+
sudo DEBIAN_FRONTEND=noninteractive apt-get install --yes --force-yes build-essential pkg-config
3827
pip install 'tox>=4.11,<5' requests
28+
- name: Run static checks
29+
run: tox -e static
3930

40-
- name: Download Geth and add to $PATH
41-
run: |
42-
mkdir -p $GITHUB_WORKSPACE/bin
43-
$GITHUB_WORKSPACE/scripts/download_geth_linux.py --dir $GITHUB_WORKSPACE/bin
44-
echo $GITHUB_WORKSPACE/bin >> $GITHUB_PATH
45-
46-
- name: Run Tox (CPython)
47-
if: "${{ !startsWith(matrix.py, 'pypy') }}"
48-
run: tox -e static,py3_eest,optimized,py3
31+
py3:
32+
runs-on: [self-hosted-ghr, size-xl-x64]
33+
needs: static
34+
steps:
35+
- uses: actions/checkout@v4
36+
with:
37+
submodules: recursive
38+
- name: Setup Python
39+
uses: actions/setup-python@v5
40+
with:
41+
python-version: "3.11"
42+
- uses: ./.github/actions/setup-env
43+
- name: Run py3 tests
44+
run: tox -e py3
4945

50-
- name: Run Tox (PyPy)
51-
if: "${{ startsWith(matrix.py, 'pypy') }}"
46+
pypy3:
47+
runs-on: [self-hosted-ghr, size-xl-x64]
48+
needs: static
49+
steps:
50+
- uses: actions/checkout@v4
51+
with:
52+
submodules: recursive
53+
- name: Setup Python
54+
uses: actions/setup-python@v5
55+
with:
56+
python-version: "pypy3.11"
57+
- uses: ./.github/actions/setup-env
58+
- name: Run pypy3 tests
5259
run: tox -e pypy3
5360
env:
5461
PYPY_GC_MAX: "10G"
5562

63+
json_infra:
64+
runs-on: [self-hosted-ghr, size-xl-x64]
65+
needs: static
66+
steps:
67+
- uses: actions/checkout@v4
68+
with:
69+
submodules: recursive
70+
- name: Setup Python
71+
uses: actions/setup-python@v5
72+
with:
73+
python-version: "3.11"
74+
- uses: ./.github/actions/setup-env
75+
- name: Run json infra tests
76+
run: tox -e json_infra
5677
- name: Upload coverage reports to Codecov
57-
if: "${{ !startsWith(matrix.py, 'pypy') }}"
5878
uses: codecov/codecov-action@v5
5979
with:
6080
files: .tox/coverage.xml
6181
flags: unittests
6282
token: ${{ secrets.CODECOV_TOKEN }}
83+
84+
optimized:
85+
runs-on: [self-hosted-ghr, size-xl-x64]
86+
needs: static
87+
steps:
88+
- uses: actions/checkout@v4
89+
with:
90+
submodules: recursive
91+
- name: Setup Python
92+
uses: actions/setup-python@v5
93+
with:
94+
python-version: "3.11"
95+
- uses: ./.github/actions/setup-env
96+
- name: Run optimized tests
97+
run: tox -e optimized

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ commands =
1616
ethereum-spec-lint
1717
vulture src tests vulture_whitelist.py --exclude "*/tests/fixtures/*" --ignore-names "pytest_*"
1818

19-
[testenv:py3]
19+
[testenv:json_infra]
2020
extras =
2121
test
2222
commands =
@@ -33,7 +33,7 @@ commands =
3333
--basetemp="{temp_dir}/pytest" \
3434
tests
3535

36-
[testenv:py3_eest]
36+
[testenv:py3]
3737
extras =
3838
test
3939
commands =

0 commit comments

Comments
 (0)