Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 545052a

Browse files
authored
CI: Fix restoring empty cache (#3674)
* add some spacing for easier reading * move build to only the steps that need it
1 parent fcb1100 commit 545052a

File tree

4 files changed

+32
-31
lines changed

4 files changed

+32
-31
lines changed

.github/workflows/build.yml

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,20 @@ jobs:
1919
- uses: actions/setup-node@v1
2020
with:
2121
node-version: 12
22+
2223
- uses: actions/checkout@v2
24+
2325
- uses: actions/cache@v2
2426
id: cache-deps
2527
with:
2628
path: |
2729
node_modules
2830
*/*/node_modules
29-
key: 2-${{ runner.os }}-node12-${{ hashFiles('**/package-lock.json') }}
30-
- run: bash ./scripts/install.sh
31+
key: ${{ runner.os }}-node12-${{ hashFiles('**/package-lock.json') }}
32+
33+
- run: npm ci
3134
if: steps.cache-deps.outputs.cache-hit != 'true'
35+
3236
- run: bash ./scripts/ci.sh
3337
unit:
3438
runs-on: ubuntu-latest
@@ -41,16 +45,20 @@ jobs:
4145
- uses: actions/setup-node@v1
4246
with:
4347
node-version: ${{ matrix.node }}
48+
4449
- uses: actions/checkout@v2
50+
4551
- uses: actions/cache@v2
4652
id: cache-deps
4753
with:
4854
path: |
4955
node_modules
5056
*/*/node_modules
51-
key: 2-${{ runner.os }}-node${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}
52-
- run: bash ./scripts/install.sh
57+
key: ${{ runner.os }}-node${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}
58+
59+
- run: npm ci
5360
if: steps.cache-deps.outputs.cache-hit != 'true'
61+
5462
- run: bash ./scripts/ci.sh
5563
e2e:
5664
runs-on: ubuntu-latest
@@ -59,11 +67,11 @@ jobs:
5967
matrix:
6068
testCmd:
6169
[
62-
"unit_and_e2e_clients",
63-
"e2e_ganache",
64-
"e2e_mosaic",
65-
"e2e_browsers",
66-
"e2e_gnosis_dex",
70+
'unit_and_e2e_clients',
71+
'e2e_browsers',
72+
'e2e_ganache',
73+
'e2e_mosaic',
74+
'e2e_gnosis_dex',
6775
]
6876
env:
6977
TEST: ${{ matrix.testCmd }}
@@ -72,16 +80,21 @@ jobs:
7280
with:
7381
node-version: 12
7482
- uses: actions/checkout@v2
83+
7584
- uses: actions/cache@v2
7685
id: cache-deps
86+
if: env.TEST == 'unit_and_e2e_clients' || env.TEST == 'e2e_browsers'
7787
with:
7888
path: |
7989
node_modules
8090
*/*/node_modules
81-
key: 2-${{ runner.os }}-node12-${{ hashFiles('**/package-lock.json') }}
82-
- run: bash ./scripts/install.sh
83-
if: steps.cache-deps.outputs.cache-hit != 'true'
91+
key: ${{ runner.os }}-node12-${{ hashFiles('**/package-lock.json') }}
92+
93+
- run: npm ci
94+
if: (env.TEST == 'unit_and_e2e_clients' || env.TEST == 'e2e_browsers') && steps.cache-deps.outputs.cache-hit != 'true'
95+
8496
- run: bash ./scripts/ci.sh
97+
8598
- name: Send coverage reports to Coveralls
8699
if: env.TEST == 'unit_and_e2e_clients'
87100
uses: coverallsapp/github-action@master

scripts/ci.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,21 @@
77
# Exit immediately on error
88
set -o errexit
99

10-
npm run build
11-
1210
if [ "$TEST" = "unit" ]; then
1311

12+
npm run build
1413
npm run test:unit
1514

1615
elif [ "$TEST" = "build_and_lint" ]; then
1716

17+
npm run build
1818
npm run dtslint
1919
npm run depcheck
2020
npm run bundlesize
2121

2222
elif [ "$TEST" = "unit_and_e2e_clients" ]; then
2323

24+
npm run build
2425
npm run test:e2e:ganache
2526
npm run test:e2e:geth:insta
2627
npm run test:e2e:geth:auto
@@ -29,6 +30,7 @@ elif [ "$TEST" = "unit_and_e2e_clients" ]; then
2930

3031
elif [ "$TEST" = "e2e_browsers" ]; then
3132

33+
npm run build
3234
npm run test:e2e:chrome
3335
npm run test:e2e:firefox
3436
npm run test:e2e:min

scripts/e2e.npm.publish.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ fi
2323
# what it needs here.
2424
npm install -g [email protected]
2525
npm install -g [email protected]
26-
npm install -g [email protected]
26+
npm install -g lerna@^3.20.2
27+
npm install -g typescript@^3.9.5
28+
npm install -g webpack@^4.44.1 webpack-cli@^3.3.12 clean-webpack-plugin@^3.0.0
2729

2830
# Launch npm proxy registry and save pid to kill server (req. in Windows env)
2931
verdaccio --config verdaccio.yml &
@@ -50,7 +52,6 @@ lerna version minor \
5052
--force-publish=* \
5153
--no-git-tag-version \
5254
--no-push \
53-
--ignore-scripts \
5455
--yes
5556

5657
# Set identity prior to publishing (necessary for Windows)

scripts/install.sh

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)