11name : VM
22on :
3- push :
4- branches : [master, develop ]
5- tags : ['*']
3+ pull_request :
4+ types : [opened, reopened, synchronize ]
5+ workflow_dispatch :
66
77env :
88 cwd : ${{github.workspace}}/packages/vm
@@ -16,7 +16,7 @@ concurrency:
1616 cancel-in-progress : true
1717
1818jobs :
19- test- vm-api :
19+ vm-api :
2020 runs-on : ubuntu-latest
2121 steps :
2222 - uses : actions/checkout@v4
@@ -33,15 +33,19 @@ jobs:
3333
3434 - run : npm run lint
3535 - run : npm run coverage
36- # - run: npm run test:API:browser
36+ # - run: npm run test:API:browser -- disabled until we fix browser tests for vitest
3737
3838 - uses : codecov/codecov-action@v3
3939 with :
4040 files : ${{ env.cwd }}/coverage/lcov.info
4141 flags : vm
4242
43- test- vm-state :
43+ vm-state :
4444 runs-on : ubuntu-latest
45+ strategy :
46+ matrix :
47+ fork : ['Berlin', 'London', 'Paris', 'Shanghai', 'Cancun']
48+ fail-fast : false
4549 steps :
4650 - uses : actions/checkout@v4
4751 with :
@@ -55,10 +59,62 @@ jobs:
5559 - run : npm ci
5660 working-directory : ${{github.workspace}}
5761
58- - run : npm run test:state:selectedForks
62+ - run : npm run test:state -- --fork=${{ matrix.fork }} --verify-test-amount-alltests
5963
60- test-vm-blockchain :
64+ vm-state-extended :
65+ if : contains(join(github.event.pull_request.labels.*.name, ' '), 'Test all hardforks')
6166 runs-on : ubuntu-latest
67+ strategy :
68+ matrix :
69+ fork :
70+ [
71+ ' Cancun' ,
72+ ' Shanghai' ,
73+ ' Paris' ,
74+ ' London' ,
75+ ' Berlin' ,
76+ ' MuirGlacier' ,
77+ ' Istanbul' ,
78+ ' Petersburg' ,
79+ ' Constantinople' ,
80+ ' Byzantium' ,
81+ ' SpuriousDragon' ,
82+ ' TangerineWhistle' ,
83+ ' Homestead' ,
84+ ' Chainstart' ,
85+ ]
86+ fail-fast : false
87+ steps :
88+ - uses : actions/checkout@v4
89+ with :
90+ submodules : recursive
91+ - uses : actions/setup-node@v4
92+ with :
93+ node-version : 18
94+ cache : ' npm'
95+
96+ - run : npm ci
97+ working-directory : ${{github.workspace}}
98+
99+ - run : npm run test:state -- --fork=${{ matrix.fork }} --verify-test-amount-alltests
100+
101+ vm-blockchain :
102+ runs-on : ubuntu-latest
103+ strategy :
104+ matrix :
105+ # Args to pass to the tester. Note that some have split the slow tests and only
106+ # run on forks where applicable (see PR #489 for numbers on these)
107+
108+ # Tests were split with --dir and --excludeDir to balance execution times below the 9min mark.
109+ args :
110+ [
111+ ' --fork=Berlin --verify-test-amount-alltests' ,
112+ ' --fork=London --verify-test-amount-alltests' ,
113+ ' --fork=Paris --verify-test-amount-alltests' ,
114+ ' --fork=Shanghai --verify-test-amount-alltests' ,
115+ ' --fork=Cancun --verify-test-amount-alltests' ,
116+ ]
117+ fail-fast : false
62118 steps :
63119 - uses : actions/checkout@v4
64120 with :
@@ -72,7 +128,51 @@ jobs:
72128 - run : npm ci
73129 working-directory : ${{github.workspace}}
74130
75- - run : npm run test:blockchain
131+ - run : npm run test:blockchain -- ${{ matrix.args }}
132+
133+ vm-blockchain-extended :
134+ if : contains(join(github.event.pull_request.labels.*.name, ' '), 'Test all hardforks')
135+ runs-on : ubuntu-latest
136+ strategy :
137+ matrix :
138+ # Args to pass to the tester.
139+ args :
140+ [
141+ ' --fork=Chainstart --verify-test-amount-alltests' ,
142+ ' --fork=Homestead --verify-test-amount-alltests' ,
143+ ' --fork=TangerineWhistle --verify-test-amount-alltests' ,
144+ ' --fork=SpuriousDragon --verify-test-amount-alltests' ,
145+ ' --fork=Byzantium --verify-test-amount-alltests' ,
146+ ' --fork=Constantinople --verify-test-amount-alltests' ,
147+ ' --fork=Petersburg --verify-test-amount-alltests' ,
148+ ' --fork=Istanbul --verify-test-amount-alltests' ,
149+ ' --fork=MuirGlacier --verify-test-amount-alltests' ,
150+ ' --fork=Berlin --verify-test-amount-alltests' ,
151+ ' --fork=London --verify-test-amount-alltests' ,
152+ ' --fork=Paris --verify-test-amount-alltests' ,
153+ ' --fork=Shanghai --verify-test-amount-alltests' ,
154+ ' --fork=Cancun --verify-test-amount-alltests' ,
155+ ' --fork=ByzantiumToConstantinopleFixAt5 --verify-test-amount-alltests' ,
156+ ' --fork=EIP158ToByzantiumAt5 --verify-test-amount-alltests' ,
157+ ' --fork=FrontierToHomesteadAt5 --verify-test-amount-alltests' ,
158+ ' --fork=HomesteadToDaoAt5 --verify-test-amount-alltests' ,
159+ ' --fork=HomesteadToEIP150At5 --verify-test-amount-alltests' ,
160+ ' --fork=BerlinToLondonAt5 --verify-test-amount-alltests' ,
161+ ]
162+ fail-fast : false
163+ steps :
164+ - uses : actions/checkout@v4
165+ with :
166+ submodules : recursive
167+ - uses : actions/setup-node@v4
168+ with :
169+ node-version : 18
170+ cache : ' npm'
171+
172+ - run : npm ci
173+ working-directory : ${{github.workspace}}
174+
175+ - run : npm run test:blockchain -- ${{ matrix.args }}
76176
77177 vm-benchmarks :
78178 runs-on : ubuntu-latest
98198
99199 - name : Compare benchmarks
100200 uses : rhysd/github-action-benchmark@v1
101- if : github.ref == 'refs/heads/master'
102201 with :
103202 tool : ' benchmarkjs'
104203 # Where the output from the benchmark tool is stored
@@ -110,12 +209,8 @@ jobs:
110209 # GitHub API token to make a commit comment
111210 github-token : ${{ secrets.GITHUB_TOKEN }}
112211 # Push and deploy to GitHub pages branch automatically (if on master)
113- auto-push : ' true'
114- # Only keep and display the last 30 commits worth of benchmark data
115- max-items-in-chart : 30
116- - name : Fetch repository branch
117- run : |
118- git fetch origin main:main
212+ auto-push : ' false'
213+
119214 # Re-apply git stash to prepare for saving back to cache.
120215 # Avoids exit code 1 by checking if there are changes to be stashed first
121216 - run : STASH_LIST=`git stash list` && [ ! -z $STASH_LIST ] && git stash apply || echo "No files to stash-apply. Skipping…"
0 commit comments