From 96777b2743613a26bf6bf205156ff81598581aa1 Mon Sep 17 00:00:00 2001 From: Ryan Ghods Date: Tue, 4 Aug 2020 14:23:36 -0700 Subject: [PATCH] move build to only the steps that need it --- .github/workflows/build.yml | 19 ++++++++++--------- scripts/ci.sh | 6 ++++-- scripts/e2e.npm.publish.sh | 4 +++- scripts/install.sh | 15 --------------- 4 files changed, 17 insertions(+), 27 deletions(-) delete mode 100755 scripts/install.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 387c87a8b5a..6cca3a80720 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 @@ -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 @@ -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 }} @@ -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 diff --git a/scripts/ci.sh b/scripts/ci.sh index b385e1302f2..c8e6555c000 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -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 @@ -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 diff --git a/scripts/e2e.npm.publish.sh b/scripts/e2e.npm.publish.sh index c2bb9e7b63b..e6ec82c5b0c 100755 --- a/scripts/e2e.npm.publish.sh +++ b/scripts/e2e.npm.publish.sh @@ -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 & diff --git a/scripts/install.sh b/scripts/install.sh deleted file mode 100755 index 6f55e78cccd..00000000000 --- a/scripts/install.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -# This script contains conditional installation logic for CI - -# CI jobs we'd like to skip default installation for: -# Helpful for E2E tests where the dev deps might cause problems -skip=( - "e2e_ganache" - "e2e_mosaic" - "e2e_windows" -) - -if [[ ! " ${skip[@]} " =~ " ${TEST} " ]]; then - npm ci -fi