From ae10fe8822d1b1cd0fedb193a853b23b049ca655 Mon Sep 17 00:00:00 2001 From: Mike Cousins Date: Wed, 6 Apr 2022 19:13:15 -0400 Subject: [PATCH 1/3] ci(js): gate expensive e2e matrices and builds on unit test pass --- .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, 12 insertions(+), 76 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..8a2a9c12992 100644 --- a/.github/workflows/app-test-build-deploy.yaml +++ b/.github/workflows/app-test-build-deploy.yaml @@ -18,8 +18,6 @@ on: - 'yarn.lock' - '.github/workflows/app-test-build-deploy.yaml' - '.github/workflows/utils.js' - branches: - - '*' tags: - 'v*' pull_request: @@ -91,6 +89,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 +130,7 @@ jobs: # build the app and deploy it - if: github.event_name != 'pull_request' name: 'build app for ${{ matrix.os }}' + timeout-minutes: 30 env: OT_APP_MIXPANEL_ID: ${{ secrets.OT_APP_MIXPANEL_ID }} OT_APP_INTERCOM_ID: ${{ secrets.OT_APP_INTERCOM_ID }} @@ -153,7 +153,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..46d9089acef 100644 --- a/.github/workflows/components-test-build-deploy.yaml +++ b/.github/workflows/components-test-build-deploy.yaml @@ -16,8 +16,6 @@ on: - 'webpack-config/**' - 'package.json' - '.github/workflows/components-test-build-deploy.yaml' - branches: - - '*' tags: - 'components*' workflow_dispatch: @@ -63,11 +61,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..64f2a49377a 100644 --- a/.github/workflows/ll-test-build-deploy.yaml +++ b/.github/workflows/ll-test-build-deploy.yaml @@ -19,8 +19,6 @@ on: - 'webpack-config/**' - 'package.json' - '.github/workflows/ll-test-build-deploy.yaml' - branches: - - '*' tags: - 'labware-library*' workflow_dispatch: @@ -69,6 +67,7 @@ jobs: e2e-test: name: 'labware library e2e tests on ${{ matrix.os }}' + needs: ['js-unit-test'] timeout-minutes: 30 strategy: matrix: @@ -103,6 +102,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 +140,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..0fdd406b05b 100644 --- a/.github/workflows/pd-test-build-deploy.yaml +++ b/.github/workflows/pd-test-build-deploy.yaml @@ -21,8 +21,6 @@ on: - 'webpack-config/**' - 'package.json' - '.github/workflows/pd-test-build-deploy.yaml' - branches: - - '*' tags: - 'protocol-designer*' workflow_dispatch: @@ -68,9 +66,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 +101,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 +139,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' From bb5cf13ad01e8ef6299c5bb5754fde9d36d953b4 Mon Sep 17 00:00:00 2001 From: Mike Cousins Date: Thu, 7 Apr 2022 12:20:14 -0400 Subject: [PATCH 2/3] fixup: branch filters were _not_ redundant --- .github/workflows/app-test-build-deploy.yaml | 2 ++ .github/workflows/components-test-build-deploy.yaml | 2 ++ .github/workflows/ll-test-build-deploy.yaml | 2 ++ .github/workflows/pd-test-build-deploy.yaml | 2 ++ 4 files changed, 8 insertions(+) diff --git a/.github/workflows/app-test-build-deploy.yaml b/.github/workflows/app-test-build-deploy.yaml index 8a2a9c12992..7d9136d547f 100644 --- a/.github/workflows/app-test-build-deploy.yaml +++ b/.github/workflows/app-test-build-deploy.yaml @@ -18,6 +18,8 @@ on: - 'yarn.lock' - '.github/workflows/app-test-build-deploy.yaml' - '.github/workflows/utils.js' + branches: + - '**' tags: - 'v*' pull_request: diff --git a/.github/workflows/components-test-build-deploy.yaml b/.github/workflows/components-test-build-deploy.yaml index 46d9089acef..52587d6d1bb 100644 --- a/.github/workflows/components-test-build-deploy.yaml +++ b/.github/workflows/components-test-build-deploy.yaml @@ -16,6 +16,8 @@ on: - 'webpack-config/**' - 'package.json' - '.github/workflows/components-test-build-deploy.yaml' + branches: + - '**' tags: - 'components*' workflow_dispatch: diff --git a/.github/workflows/ll-test-build-deploy.yaml b/.github/workflows/ll-test-build-deploy.yaml index 64f2a49377a..dc7c6e3711c 100644 --- a/.github/workflows/ll-test-build-deploy.yaml +++ b/.github/workflows/ll-test-build-deploy.yaml @@ -19,6 +19,8 @@ on: - 'webpack-config/**' - 'package.json' - '.github/workflows/ll-test-build-deploy.yaml' + branches: + - '**' tags: - 'labware-library*' workflow_dispatch: diff --git a/.github/workflows/pd-test-build-deploy.yaml b/.github/workflows/pd-test-build-deploy.yaml index 0fdd406b05b..d71413e028f 100644 --- a/.github/workflows/pd-test-build-deploy.yaml +++ b/.github/workflows/pd-test-build-deploy.yaml @@ -21,6 +21,8 @@ on: - 'webpack-config/**' - 'package.json' - '.github/workflows/pd-test-build-deploy.yaml' + branches: + - '**' tags: - 'protocol-designer*' workflow_dispatch: From 7ac5606369759a09a3a4498e2042713904bd7d5b Mon Sep 17 00:00:00 2001 From: Mike Cousins Date: Wed, 13 Apr 2022 09:56:14 -0400 Subject: [PATCH 3/3] Update .github/workflows/app-test-build-deploy.yaml --- .github/workflows/app-test-build-deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/app-test-build-deploy.yaml b/.github/workflows/app-test-build-deploy.yaml index 7d9136d547f..a07e4d8e01d 100644 --- a/.github/workflows/app-test-build-deploy.yaml +++ b/.github/workflows/app-test-build-deploy.yaml @@ -132,7 +132,7 @@ jobs: # build the app and deploy it - if: github.event_name != 'pull_request' name: 'build app for ${{ matrix.os }}' - timeout-minutes: 30 + timeout-minutes: 60 env: OT_APP_MIXPANEL_ID: ${{ secrets.OT_APP_MIXPANEL_ID }} OT_APP_INTERCOM_ID: ${{ secrets.OT_APP_INTERCOM_ID }}