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 4, 2020
1 parent b7912cf commit 5e62d65
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 26 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
7 changes: 5 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,13 +30,15 @@ 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
npm run test:e2e:cdn

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

npm run build
npm run test:e2e:publish
npm run test:e2e:truffle

Expand Down
15 changes: 0 additions & 15 deletions scripts/install.sh

This file was deleted.

0 comments on commit 5e62d65

Please sign in to comment.