Skip to content

Commit 72a937c

Browse files
committed
gh actions: add caching, add a nightly test run without caching, add running actions on pull_request
1 parent 5a28891 commit 72a937c

File tree

4 files changed

+149
-3
lines changed

4 files changed

+149
-3
lines changed

.github/workflows/vm-coverage.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: vm-coverage
2-
on: [push]
2+
on: [push, pull_request]
33
jobs:
44
coverage:
55
runs-on: ubuntu-latest
@@ -9,7 +9,17 @@ jobs:
99
node-version: 8.x
1010

1111
- uses: actions/checkout@v1
12+
13+
- name: Cache node modules
14+
id: cache-node-modules
15+
uses: actions/cache@v1
16+
with:
17+
path: node_modules
18+
key: ${{ runner.os }}-node8-${{ hashFiles('**/package.json') }}
19+
1220
- run: npm install
21+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
22+
1323
- run: npm run coverage
1424
- run: npm run coveralls
1525

.github/workflows/vm-lint.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: vm-lint
2-
on: [push]
2+
on: [push, pull_request]
33
jobs:
44
lint:
55
runs-on: ubuntu-latest
@@ -9,7 +9,17 @@ jobs:
99
node-version: 8.x
1010

1111
- uses: actions/checkout@v1
12+
13+
- name: Cache node modules
14+
id: cache-node-modules
15+
uses: actions/cache@v1
16+
with:
17+
path: node_modules
18+
key: ${{ runner.os }}-node8-${{ hashFiles('**/package.json') }}
19+
1220
- run: npm install
21+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
22+
1323
- run: npm run lint
1424
env:
1525
CI: true

.github/workflows/vm-nightly-test.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: vm-nightly-test # without caching
2+
on:
3+
schedule:
4+
- cron: '0 0 * * *' # once a day at midnight
5+
jobs:
6+
test-api:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/setup-node@v1
10+
with:
11+
node-version: 8.x
12+
13+
- uses: actions/checkout@v1
14+
15+
- run: npm install
16+
17+
- run: npm run testAPI
18+
env:
19+
CI: true
20+
21+
- run: npm run testAPI:browser
22+
env:
23+
CI: true
24+
25+
test-state:
26+
runs-on: ubuntu-latest
27+
strategy:
28+
matrix:
29+
hardfork: ['Byzantium', 'Constantinople', 'Petersburg', 'Istanbul']
30+
31+
steps:
32+
- uses: actions/setup-node@v1
33+
with:
34+
node-version: 8.x
35+
36+
- uses: actions/checkout@v1
37+
38+
- run: npm install
39+
40+
- run: mkdir -p tests/tape
41+
42+
- name: Run ${{ matrix.hardfork }} state tests
43+
run: |
44+
npm run ${{ format('testState{0}', matrix.hardfork) }} | tee -a ${{ format('testState{0}.tap', matrix.hardfork) }};
45+
cat ${{ format('testState{0}.tap', matrix.hardfork) }} | npx tap-xunit > ${{ format('testState{0}.xml', matrix.hardfork) }}
46+
env:
47+
CI: true
48+
49+
- name: Upload ${{ matrix.hardfork }} state test metadata (if failure)
50+
uses: actions/upload-artifact@v1
51+
if: failure()
52+
with:
53+
name: ${{ format('vmTestState{0}', matrix.hardfork) }}
54+
path: ${{ format('tests/tape/testState{0}.xml', matrix.hardfork) }}
55+
56+
- name: Upload state test metadata
57+
uses: actions/upload-artifact@v1
58+
with:
59+
name: vmTestStateMetadata
60+
path: tests/tape
61+
62+
test-blockchain:
63+
runs-on: ubuntu-latest
64+
strategy:
65+
matrix:
66+
hardfork: ['', 'Petersburg']
67+
68+
steps:
69+
- uses: actions/setup-node@v1
70+
with:
71+
node-version: 8.x
72+
73+
- uses: actions/checkout@v1
74+
75+
- run: npm install
76+
77+
- run: mkdir -p tests/tape
78+
79+
- name: Run ${{ matrix.hardfork }} blockchain state tests
80+
run: |
81+
npm run ${{ format('testBlockchain{0}', matrix.hardfork) }} | tee -a ${{ format('testBlockchain{0}.tap', matrix.hardfork) }};
82+
cat ${{ format('testBlockchain{0}.tap', matrix.hardfork) }} | npx tap-xunit > ${{ format('tests/tape/testBlockchain{0}.xml', matrix.hardfork) }}
83+
env:
84+
CI: true
85+
86+
- name: Upload ${{ matrix.hardfork }} blockchain state test metadata (if failure)
87+
uses: actions/upload-artifact@v1
88+
if: failure()
89+
with:
90+
name: ${{ format('vmTestBlockchainState{0}', matrix.hardfork) }}
91+
path: ${{ format('tests/tape/testBlockchain{0}.xml', matrix.hardfork) }}
92+
93+
- name: Upload blockhain state test metadata
94+
uses: actions/upload-artifact@v1
95+
with:
96+
name: vmTestBlockchainStateMetadata
97+
path: tests/tape

.github/workflows/vm-test.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: vm-test
2-
on: [push]
2+
on: [push, pull_request]
33
jobs:
44
test-api:
55
runs-on: ubuntu-latest
@@ -9,7 +9,16 @@ jobs:
99
node-version: 8.x
1010

1111
- uses: actions/checkout@v1
12+
13+
- name: Cache node modules
14+
id: cache-node-modules
15+
uses: actions/cache@v1
16+
with:
17+
path: node_modules
18+
key: ${{ runner.os }}-node8-${{ hashFiles('**/package.json') }}
19+
1220
- run: npm install
21+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
1322

1423
- run: npm run testAPI
1524
env:
@@ -31,7 +40,17 @@ jobs:
3140
node-version: 8.x
3241

3342
- uses: actions/checkout@v1
43+
44+
- name: Cache node modules
45+
id: cache-node-modules
46+
uses: actions/cache@v1
47+
with:
48+
path: node_modules
49+
key: ${{ runner.os }}-node8-${{ hashFiles('**/package.json') }}
50+
3451
- run: npm install
52+
if: steps.cache-node-modules.outputs.cache-hit != 'true''
53+
3554
- run: mkdir -p tests/tape
3655

3756
- name: Run ${{ matrix.hardfork }} state tests
@@ -66,7 +85,17 @@ jobs:
6685
node-version: 8.x
6786

6887
- uses: actions/checkout@v1
88+
89+
- name: Cache node modules
90+
id: cache-node-modules
91+
uses: actions/cache@v1
92+
with:
93+
path: node_modules
94+
key: ${{ runner.os }}-node8-${{ hashFiles('**/package.json') }}
95+
6996
- run: npm install
97+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
98+
7099
- run: mkdir -p tests/tape
71100

72101
- name: Run ${{ matrix.hardfork }} blockchain state tests

0 commit comments

Comments
 (0)