From f45d265f7b491a0bf1ac2b34c34abec5a32bc489 Mon Sep 17 00:00:00 2001 From: Shlok Amin Date: Tue, 3 Oct 2023 16:37:23 -0400 Subject: [PATCH] update ci workflows --- .github/workflows/app-test-build-deploy.yaml | 15 +++++++++------ .github/workflows/ll-test-build-deploy.yaml | 2 +- .github/workflows/pd-test-build-deploy.yaml | 3 +-- .github/workflows/react-api-client-test.yaml | 3 +-- .../shared-data-test-lint-deploy.yaml | 3 +-- .github/workflows/step-generation-test.yaml | 3 +-- Makefile | 18 +++++++++++++----- react-api-client/Makefile | 4 ++++ 8 files changed, 31 insertions(+), 20 deletions(-) diff --git a/.github/workflows/app-test-build-deploy.yaml b/.github/workflows/app-test-build-deploy.yaml index 8b514727146..2181cacde23 100644 --- a/.github/workflows/app-test-build-deploy.yaml +++ b/.github/workflows/app-test-build-deploy.yaml @@ -83,9 +83,9 @@ jobs: npm config set cache ${{ github.workspace }}/.npm-cache yarn config set cache-folder ${{ github.workspace }}/.yarn-cache make setup-js - - name: 'test frontend packages' + - name: 'opentrons app frontendunit tests' run: | - yarn jest --coverage=true --ci=true --collectCoverageFrom="app/src/**/*.(js|ts|tsx)" app/src components/src shared-data/js + make -C app test ----collectCoverage - name: 'Upload coverage report' uses: codecov/codecov-action@v3 with: @@ -142,7 +142,9 @@ jobs: make setup-js - name: 'test native(er) packages' run: | - yarn jest --coverage=true --ci=true --collectCoverageFrom="(app-shell|app-shell-odd| discovery-client)/src/**/*.(js|ts|tsx)" app-shell/src app-shell-odd/src discovery-client/src + make -C app shell --collectCoverage + make -C app shell-odd --collectCoverage + make -C discovery-client --collectCoverage - name: 'Upload coverage report' uses: 'codecov/codecov-action@v3' with: @@ -315,7 +317,8 @@ jobs: deploy-release-app: name: 'Deploy built app artifacts to S3' runs-on: 'ubuntu-22.04' - needs: ['js-unit-test', 'backend-unit-test', 'build-app', 'determine-build-type'] + needs: + ['js-unit-test', 'backend-unit-test', 'build-app', 'determine-build-type'] if: contains(fromJSON(needs.determine-build-type.outputs.variants), 'release') || contains(fromJSON(needs.determine-build-type.outputs.variants), 'internal-release') steps: - name: 'download run app builds' @@ -401,7 +404,7 @@ jobs: uses: slackapi/slack-github-action@v1.14.0 if: contains(fromJSON(needs.determine-build-type.outputs.variants), 'internal-release') with: - payload: "{\"branch_or_tag\":\"${{ github.ref_name }}\",\"build_type\":\"${{ needs.determine-build-type.outputs.type }}\", \"gh_linkback\":\"https://github.com/Opentrons/opentrons/tree/${{ github.ref_name }}\", \"windows_build\":\"${{ env._ACCESS_URL }}/${{steps.names.outputs.windows-internal-release}}\", \"mac_build\":\"${{ env._ACCESS_URL }}/${{steps.names.outputs.mac-internal-release}}\", \"linux_build\":\"${{ env._ACCESS_URL }}/${{steps.names.outputs.linux-internal-release}}\"}" + payload: '{"branch_or_tag":"${{ github.ref_name }}","build_type":"${{ needs.determine-build-type.outputs.type }}", "gh_linkback":"https://github.com/Opentrons/opentrons/tree/${{ github.ref_name }}", "windows_build":"${{ env._ACCESS_URL }}/${{steps.names.outputs.windows-internal-release}}", "mac_build":"${{ env._ACCESS_URL }}/${{steps.names.outputs.mac-internal-release}}", "linux_build":"${{ env._ACCESS_URL }}/${{steps.names.outputs.linux-internal-release}}"}' env: SLACK_WEBHOOK_URL: ${{ secrets.OT_APP_OT3_SLACK_NOTIFICATION_WEBHOOK_URL }} _ACCESS_URL: https://${{env._APP_DEPLOY_BUCKET_OT3}}/${{env._APP_DEPLOY_FOLDER_OT3}} @@ -409,7 +412,7 @@ jobs: uses: slackapi/slack-github-action@v1.14.0 if: contains(fromJSON(needs.determine-build-type.outputs.variants), 'release') with: - payload: "{\"branch_or_tag\":\"${{ github.ref_name }}\",\"build_type\":\"${{ needs.determine-build-type.outputs.type }}\", \"gh_linkback\":\"https://github.com/Opentrons/opentrons/tree/${{ github.ref_name }}\", \"windows_build\":\"${{ env._ACCESS_URL }}/${{steps.names.outputs.windows-release}}\", \"mac_build\":\"${{ env._ACCESS_URL }}/${{steps.names.outputs.mac-release}}\", \"linux_build\":\"${{ env._ACCESS_URL }}/${{steps.names.outputs.linux-release}}\"}" + payload: '{"branch_or_tag":"${{ github.ref_name }}","build_type":"${{ needs.determine-build-type.outputs.type }}", "gh_linkback":"https://github.com/Opentrons/opentrons/tree/${{ github.ref_name }}", "windows_build":"${{ env._ACCESS_URL }}/${{steps.names.outputs.windows-release}}", "mac_build":"${{ env._ACCESS_URL }}/${{steps.names.outputs.mac-release}}", "linux_build":"${{ env._ACCESS_URL }}/${{steps.names.outputs.linux-release}}"}' env: SLACK_WEBHOOK_URL: ${{ secrets.OT_APP_ROBOTSTACK_SLACK_NOTIFICATION_WEBHOOK_URL }} _ACCESS_URL: https://${{env._APP_DEPLOY_BUCKET_ROBOTSTACK}}/${{env._APP_DEPLOY_FOLDER_ROBOTSTACK}} diff --git a/.github/workflows/ll-test-build-deploy.yaml b/.github/workflows/ll-test-build-deploy.yaml index c6dfede0bbb..e98c3feb990 100644 --- a/.github/workflows/ll-test-build-deploy.yaml +++ b/.github/workflows/ll-test-build-deploy.yaml @@ -70,7 +70,7 @@ jobs: make setup-js - name: 'run labware library unit tests' run: | - yarn jest --coverage=true --ci=true --collectCoverageFrom="labware-library/src/**/*.(js|ts|tsx)" labware-library/src + make -C labware-library test --collectCoverage --ci=true - name: 'Upload coverage report' uses: codecov/codecov-action@v3 with: diff --git a/.github/workflows/pd-test-build-deploy.yaml b/.github/workflows/pd-test-build-deploy.yaml index 7a69d951856..2c46f56527f 100644 --- a/.github/workflows/pd-test-build-deploy.yaml +++ b/.github/workflows/pd-test-build-deploy.yaml @@ -71,8 +71,7 @@ jobs: yarn config set cache-folder ./.yarn-cache make setup-js - name: 'run PD unit tests' - run: | - yarn jest --coverage=true --ci=true --collectCoverageFrom="protocol-designer/src/**/*.(js|ts|tsx)" protocol-designer/src + run: make -C protocol-designer test --collectCoverage --ci=true - name: 'Upload coverage report' uses: codecov/codecov-action@v3 with: diff --git a/.github/workflows/react-api-client-test.yaml b/.github/workflows/react-api-client-test.yaml index 7d91462b011..f3ca8b0708f 100644 --- a/.github/workflows/react-api-client-test.yaml +++ b/.github/workflows/react-api-client-test.yaml @@ -57,8 +57,7 @@ jobs: yarn config set cache-folder ./.yarn-cache make setup-js - name: 'run react-api-client unit tests' - run: | - yarn jest --coverage=true --ci=true --collectCoverageFrom="react-api-client/src/**/*.(js|ts|tsx)" react-api-client/src + run: make -C react-api-client test --collectCoverage --ci=true - name: 'Upload coverage report' uses: codecov/codecov-action@v3 with: diff --git a/.github/workflows/shared-data-test-lint-deploy.yaml b/.github/workflows/shared-data-test-lint-deploy.yaml index 18fba9dcb90..4dc9aa9f0d0 100644 --- a/.github/workflows/shared-data-test-lint-deploy.yaml +++ b/.github/workflows/shared-data-test-lint-deploy.yaml @@ -133,8 +133,7 @@ jobs: yarn config set cache-folder ./.yarn-cache make setup-js - name: 'run shared-data JS unit tests' - run: | - yarn jest --coverage=true --ci=true --collectCoverageFrom="shared-data/js/**/*.(js|ts|tsx)" shared-data/js + run: make -C react-api-client test --collectCoverage --ci=true - name: 'Upload coverage report' uses: codecov/codecov-action@v3 with: diff --git a/.github/workflows/step-generation-test.yaml b/.github/workflows/step-generation-test.yaml index 0d0ef384c76..891d02ca785 100644 --- a/.github/workflows/step-generation-test.yaml +++ b/.github/workflows/step-generation-test.yaml @@ -58,8 +58,7 @@ jobs: yarn config set cache-folder ./.yarn-cache make setup-js - name: 'run step generation unit tests' - run: | - yarn jest --coverage=true --ci=true --collectCoverageFrom="step-generation/src/**/*.(js|ts|tsx)" step-generation/src + run: make -C react-api-client test --collectCoverage --ci=true - name: 'Upload coverage report' uses: codecov/codecov-action@v3 with: diff --git a/Makefile b/Makefile index 0104d8c662c..24bae2dd706 100755 --- a/Makefile +++ b/Makefile @@ -5,6 +5,7 @@ include ./scripts/python.mk API_DIR := api +API_CLIENT_DIR := api-client APP_SHELL_DIR := app-shell APP_SHELL_ODD_DIR := app-shell-odd COMPONENTS_DIR := components @@ -15,6 +16,7 @@ NOTIFY_SERVER_DIR := notify-server PROTOCOL_DESIGNER_DIR := protocol-designer SHARED_DATA_DIR := shared-data UPDATE_SERVER_DIR := update-server +REACT_API_CLIENT_DIR := react-api-client ROBOT_SERVER_DIR := robot-server SERVER_UTILS_DIR := server-utils STEP_GENERATION_DIR := step-generation @@ -197,11 +199,17 @@ test-py: test-py-windows .PHONY: test-js test-js: - yarn jest \ - --coverage=$(cover) \ - --watch=$(watch) \ - --updateSnapshot=$(updateSnapshot) \ - --ci=$(if $(CI),true,false) + $(MAKE) -C $(API_CLIENT_DIR) test + $(MAKE) -C $(APP_SHELL_DIR) test + $(MAKE) -C $(APP_SHELL_ODD_DIR) test + $(MAKE) -C $(COMPONENTS_DIR) test + $(MAKE) -C $(DISCOVERY_CLIENT_DIR) test + $(MAKE) -C $(LABWARE_LIBRARY_DIR) test + $(MAKE) -C $(PROTOCOL_DESIGNER_DIR) test + $(MAKE) -C $(REACT_API_CLIENT_DIR) test + $(MAKE) -C $(SHARED_DATA_DIR) test + $(MAKE) -C $(STEP_GENERATION_DIR) test + $(MAKE) -C $(LABWARE_LIBRARY_DIR) test # lints and typechecks .PHONY: lint diff --git a/react-api-client/Makefile b/react-api-client/Makefile index 1e0983dc7b1..1c7cdcba0da 100644 --- a/react-api-client/Makefile +++ b/react-api-client/Makefile @@ -17,3 +17,7 @@ clean: .PHONY: build build: rollup --config rollup.config.js +.PHONY: test + +test: + $(MAKE) -C .. test-js-react-api-client \ No newline at end of file