From a5ecacb3575ede8cf33405d4036a18cbd6abc9c9 Mon Sep 17 00:00:00 2001 From: Mike Cousins Date: Wed, 13 Apr 2022 11:45:39 -0400 Subject: [PATCH] ci(js): gate expensive e2e matrices and builds on unit test pass (#9908) --- .github/workflows/app-test-build-deploy.yaml | 6 +- .../components-test-build-deploy.yaml | 5 +- .../workflows/labware-library-e2e-test.yaml | 63 ------------------- .github/workflows/ll-test-build-deploy.yaml | 6 +- .github/workflows/pd-test-build-deploy.yaml | 8 ++- 5 files changed, 16 insertions(+), 72 deletions(-) delete mode 100644 .github/workflows/labware-library-e2e-test.yaml diff --git a/.github/workflows/app-test-build-deploy.yaml b/.github/workflows/app-test-build-deploy.yaml index 12c9b957088..a07e4d8e01d 100644 --- a/.github/workflows/app-test-build-deploy.yaml +++ b/.github/workflows/app-test-build-deploy.yaml @@ -19,7 +19,7 @@ on: - '.github/workflows/app-test-build-deploy.yaml' - '.github/workflows/utils.js' branches: - - '*' + - '**' tags: - 'v*' pull_request: @@ -91,6 +91,7 @@ jobs: matrix: os: ['windows-2019', 'ubuntu-18.04', 'macos-latest'] name: 'opentrons app backend unit tests and build' + needs: ['js-unit-test'] runs-on: ${{ matrix.os }} steps: - uses: 'actions/checkout@v2' @@ -131,6 +132,7 @@ jobs: # build the app and deploy it - if: github.event_name != 'pull_request' name: 'build app for ${{ matrix.os }}' + timeout-minutes: 60 env: OT_APP_MIXPANEL_ID: ${{ secrets.OT_APP_MIXPANEL_ID }} OT_APP_INTERCOM_ID: ${{ secrets.OT_APP_INTERCOM_ID }} @@ -153,7 +155,7 @@ jobs: deploy-app: name: 'Deploy built app artifacts to S3' runs-on: 'ubuntu-18.04' - needs: build-app-test-backend + needs: ['js-unit-test', 'build-app-test-backend'] if: github.event_name != 'pull_request' steps: - name: 'download run app builds' diff --git a/.github/workflows/components-test-build-deploy.yaml b/.github/workflows/components-test-build-deploy.yaml index 4d8fdc14ba0..52587d6d1bb 100644 --- a/.github/workflows/components-test-build-deploy.yaml +++ b/.github/workflows/components-test-build-deploy.yaml @@ -17,7 +17,7 @@ on: - 'package.json' - '.github/workflows/components-test-build-deploy.yaml' branches: - - '*' + - '**' tags: - 'components*' workflow_dispatch: @@ -63,11 +63,12 @@ jobs: with: files: ./coverage/lcov.info flags: components - + build-components: name: 'build components artifact' runs-on: 'ubuntu-18.04' if: github.event_name != 'pull_request' + needs: ['js-unit-test'] steps: - uses: 'actions/checkout@v2' - uses: 'actions/setup-node@v1' diff --git a/.github/workflows/labware-library-e2e-test.yaml b/.github/workflows/labware-library-e2e-test.yaml deleted file mode 100644 index a08d713fa77..00000000000 --- a/.github/workflows/labware-library-e2e-test.yaml +++ /dev/null @@ -1,63 +0,0 @@ -# This workflow runs end to end tests in Labware Library - -name: 'Labware Library E2E Tests' - -on: - pull_request: - paths: - - 'labware-library/**' - - 'shared-data/**' - - 'components/**' - - 'webpack-config/**' - - 'package.json' - - '.github/workflows/labware-library-e2e-test.yaml' - push: - paths: - - 'labware-library/**' - - 'shared-data/**' - - 'components/**' - - 'webpack-config/**' - - 'package.json' - - '.github/workflows/labware-library-e2e-test.yaml' - tags: - - 'labware-library*' - -defaults: - run: - shell: bash - -env: - CI: true - -jobs: - checks: - name: 'LL e2e tests' - timeout-minutes: 40 - strategy: - matrix: - os: ['ubuntu-18.04', 'macos-latest'] - runs-on: '${{ matrix.os }}' - steps: - - uses: 'actions/checkout@v2' - - uses: 'actions/setup-node@v1' - with: - node-version: '14' - - name: 'install udev for usb-detection' - if: startsWith(matrix.os, 'ubuntu') - run: sudo apt-get update && sudo apt-get install libudev-dev - - name: 'cache yarn cache' - uses: actions/cache@v2 - with: - path: | - ${{ github.workspace }}/.yarn-cache - ${{ github.workspace }}/.npm-cache - key: js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn- - - name: 'setup-js' - run: | - npm config set cache ./.npm-cache - yarn config set cache-folder ./.yarn-cache - make setup-js - - name: 'test-e2e' - run: make -C labware-library test-e2e diff --git a/.github/workflows/ll-test-build-deploy.yaml b/.github/workflows/ll-test-build-deploy.yaml index 6289c812da5..dc7c6e3711c 100644 --- a/.github/workflows/ll-test-build-deploy.yaml +++ b/.github/workflows/ll-test-build-deploy.yaml @@ -20,7 +20,7 @@ on: - 'package.json' - '.github/workflows/ll-test-build-deploy.yaml' branches: - - '*' + - '**' tags: - 'labware-library*' workflow_dispatch: @@ -69,6 +69,7 @@ jobs: e2e-test: name: 'labware library e2e tests on ${{ matrix.os }}' + needs: ['js-unit-test'] timeout-minutes: 30 strategy: matrix: @@ -103,6 +104,7 @@ jobs: run: make -C labware-library test-e2e build-ll: name: 'build labware library artifact' + needs: ['js-unit-test'] runs-on: 'ubuntu-18.04' if: github.event_name != 'pull_request' steps: @@ -140,7 +142,7 @@ jobs: deploy-ll: name: 'deploy LL artifact to S3' runs-on: 'ubuntu-18.04' - needs: ["js-unit-test", "e2e-test", "build-ll"] + needs: ['js-unit-test', 'e2e-test', 'build-ll'] if: github.event_name != 'pull_request' steps: - uses: 'actions/checkout@v2' diff --git a/.github/workflows/pd-test-build-deploy.yaml b/.github/workflows/pd-test-build-deploy.yaml index 04ce47c06eb..d71413e028f 100644 --- a/.github/workflows/pd-test-build-deploy.yaml +++ b/.github/workflows/pd-test-build-deploy.yaml @@ -22,7 +22,7 @@ on: - 'package.json' - '.github/workflows/pd-test-build-deploy.yaml' branches: - - '*' + - '**' tags: - 'protocol-designer*' workflow_dispatch: @@ -68,9 +68,10 @@ jobs: with: files: ./coverage/lcov.info flags: protocol-designer - + e2e-test: name: 'pd e2e tests' + needs: ['js-unit-test'] timeout-minutes: 30 strategy: matrix: @@ -102,6 +103,7 @@ jobs: run: make -C protocol-designer test-e2e build-pd: name: 'build protocol designer artifact' + needs: ['js-unit-test'] runs-on: 'ubuntu-18.04' if: github.event_name != 'pull_request' steps: @@ -139,7 +141,7 @@ jobs: deploy-pd: name: 'deploy PD artifact to S3' runs-on: 'ubuntu-18.04' - needs: ["js-unit-test", "build-pd"] + needs: ['js-unit-test', 'build-pd'] if: github.event_name != 'pull_request' steps: - uses: 'actions/checkout@v2'