Skip to content

Commit

Permalink
move build to only the steps that need it
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanio committed Aug 5, 2020
1 parent b7912cf commit 96777b2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 27 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
*/*/node_modules
key: ${{ runner.os }}-node12-${{ hashFiles('**/package-lock.json') }}

- run: bash ./scripts/install.sh
- run: npm ci
if: steps.cache-deps.outputs.cache-hit != 'true'

- run: bash ./scripts/ci.sh
Expand All @@ -56,7 +56,7 @@ jobs:
*/*/node_modules
key: ${{ runner.os }}-node${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}

- run: bash ./scripts/install.sh
- run: npm ci
if: steps.cache-deps.outputs.cache-hit != 'true'

- run: bash ./scripts/ci.sh
Expand All @@ -67,11 +67,11 @@ jobs:
matrix:
testCmd:
[
"unit_and_e2e_clients",
"e2e_ganache",
"e2e_mosaic",
"e2e_browsers",
"e2e_gnosis_dex",
'unit_and_e2e_clients',
'e2e_browsers',
'e2e_ganache',
'e2e_mosaic',
'e2e_gnosis_dex',
]
env:
TEST: ${{ matrix.testCmd }}
Expand All @@ -83,14 +83,15 @@ jobs:

- uses: actions/cache@v2
id: cache-deps
if: env.TEST == 'unit_and_e2e_clients' || env.TEST == 'e2e_browsers'
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-node12-${{ hashFiles('**/package-lock.json') }}

- run: bash ./scripts/install.sh
if: steps.cache-deps.outputs.cache-hit != 'true'
- run: npm ci
if: (env.TEST == 'unit_and_e2e_clients' || env.TEST == 'e2e_browsers') && steps.cache-deps.outputs.cache-hit != 'true'

- run: bash ./scripts/ci.sh

Expand Down
6 changes: 4 additions & 2 deletions scripts/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@
# Exit immediately on error
set -o errexit

npm run build

if [ "$TEST" = "unit" ]; then

npm run build
npm run test:unit

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

npm run build
npm run dtslint
npm run depcheck
npm run bundlesize

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

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

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

npm run build
npm run test:e2e:chrome
npm run test:e2e:firefox
npm run test:e2e:min
Expand Down
4 changes: 3 additions & 1 deletion scripts/e2e.npm.publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ fi
# what it needs here.
npm install -g verdaccio@4.4.4
npm install -g npm-auth-to-token@1.0.0
npm install -g lerna@3.18.3
npm install -g lerna@^3.20.2
npm install -g typescript@^3.9.5
npm install -g webpack@^4.44.1 webpack-cli@^3.3.12 clean-webpack-plugin@^3.0.0

# Launch npm proxy registry and save pid to kill server (req. in Windows env)
verdaccio --config verdaccio.yml &
Expand Down
15 changes: 0 additions & 15 deletions scripts/install.sh

This file was deleted.

0 comments on commit 96777b2

Please sign in to comment.