diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eb7b284b656..6cca3a80720 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,16 +19,20 @@ jobs: - uses: actions/setup-node@v1 with: node-version: 12 + - uses: actions/checkout@v2 + - uses: actions/cache@v2 id: cache-deps with: path: | node_modules */*/node_modules - key: 2-${{ runner.os }}-node12-${{ hashFiles('**/package-lock.json') }} - - run: bash ./scripts/install.sh + key: ${{ runner.os }}-node12-${{ hashFiles('**/package-lock.json') }} + + - run: npm ci if: steps.cache-deps.outputs.cache-hit != 'true' + - run: bash ./scripts/ci.sh unit: runs-on: ubuntu-latest @@ -41,16 +45,20 @@ jobs: - uses: actions/setup-node@v1 with: node-version: ${{ matrix.node }} + - uses: actions/checkout@v2 + - uses: actions/cache@v2 id: cache-deps with: path: | node_modules */*/node_modules - key: 2-${{ runner.os }}-node${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }} - - run: bash ./scripts/install.sh + key: ${{ runner.os }}-node${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }} + + - run: npm ci if: steps.cache-deps.outputs.cache-hit != 'true' + - run: bash ./scripts/ci.sh e2e: runs-on: ubuntu-latest @@ -59,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 }} @@ -72,16 +80,21 @@ jobs: with: node-version: 12 - uses: actions/checkout@v2 + - 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: 2-${{ runner.os }}-node12-${{ hashFiles('**/package-lock.json') }} - - run: bash ./scripts/install.sh - if: steps.cache-deps.outputs.cache-hit != 'true' + key: ${{ runner.os }}-node12-${{ hashFiles('**/package-lock.json') }} + + - 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 + - name: Send coverage reports to Coveralls if: env.TEST == 'unit_and_e2e_clients' uses: coverallsapp/github-action@master 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..f832655db44 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 & @@ -50,7 +52,6 @@ lerna version minor \ --force-publish=* \ --no-git-tag-version \ --no-push \ - --ignore-scripts \ --yes # Set identity prior to publishing (necessary for Windows) 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