Skip to content

Commit

Permalink
Merge branch 'edge' into pick_up_tip_testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos-fernandez committed Dec 12, 2023
2 parents b5bcc33 + 85dfebe commit 327b441
Show file tree
Hide file tree
Showing 2,448 changed files with 194,817 additions and 64,011 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ update-server/**
robot-server/**
notify-server/**
shared-data/python/**
hardware-testing/**

# app-testing don't format the json protocols
app-testing/files
23 changes: 11 additions & 12 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,17 @@
/webpack-config @Opentrons/js

# subprojects - those with clear team ownership should have appropriate notifications
/protocol-designer @Opentrons/spddrs
/labware-designer @Opentrons/spddrs
/labware-library @Opentrons/spddrs
/protocol-library-kludge @Opentrons/spddrs
/update-server @Opentrons/cpx
/api/src/opentrons @Opentrons/hmg
/discovery-client @Opentrons/cpx
/shared-data/pipette @Opentrons/hmg
/shared-data/protocol @Opentrons/spddrs
/shared-data/module @Opentrons/hmg
/shared-data/deck @Opentrons/hmg
/shared-data/labware @Opentrons/hmg
/protocol-designer @Opentrons/app-and-uis
/labware-designer @Opentrons/app-and-uis
/labware-library @Opentrons/app-and-uis
/protocol-library-kludge @Opentrons/app-and-uis
/update-server @Opentrons/robot-svcs
/discovery-client @Opentrons/robot-svcs @Opentrons/app-and-uis
/shared-data/pipette @Opentrons/embedded-sw
/shared-data/protocol @Opentrons/robot-svcs @Opentrons/app-and-uis
/shared-data/module @Opentrons/embedded-sw
/shared-data/deck @Opentrons/embedded-sw
/shared-data/labware @Opentrons/embedded-sw

# subprojects by language - some subprojects are shared by teams but united by a
# language community (including makefiles and config) so mark them appropriately
Expand Down
96 changes: 80 additions & 16 deletions .github/workflows/app-test-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
make setup-js
- name: 'test frontend packages'
run: |
yarn jest --coverage=true --ci=true --collectCoverageFrom="app/src/**/*.(js|ts|tsx)" app/src components/src shared-data/js
make -C app test-cov
- name: 'Upload coverage report'
uses: codecov/codecov-action@v3
with:
Expand Down Expand Up @@ -141,8 +141,7 @@ jobs:
yarn config set cache-folder ${{ github.workspace }}/.yarn-cache
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
run: make test-js-internal tests="app-shell/src app-shell-odd/src discovery-client/src" cov_opts="--coverage=true --ci=true --collectCoverageFrom='(app-shell|app-shell-odd| discovery-client)/src/**/*.(js|ts|tsx)'"
- name: 'Upload coverage report'
uses: 'codecov/codecov-action@v3'
with:
Expand Down Expand Up @@ -181,7 +180,7 @@ jobs:
echo 'type=develop' >> $GITHUB_OUTPUT
elif [ "${{ format('{0}', github.ref == 'refs/heads/edge') }}" = "true" ] ; then
echo "both develop builds for edge"
echo 'variants=["release", "internal-release"]' >> GITHUB_OUTPUT
echo 'variants=["release", "internal-release"]' >> $GITHUB_OUTPUT
echo 'type=develop' >> $GITHUB_OUTPUT
elif [ "${{ format('{0}', endsWith(github.ref, 'app-build-internal')) }}" = "true" ] ; then
echo "internal-release builds for app-build-internal suffixes"
Expand Down Expand Up @@ -231,7 +230,7 @@ jobs:
echo "Configuring project, bucket, and folder for ot3"
echo "project=ot3" >> $GITHUB_OUTPUT
echo "bucket=${{env._APP_DEPLOY_BUCKET_OT3}}" >> $GITHUB_OUTPUT
echo "folder=${{env._APP_DEPLOY_BUCKET_OT3}}" >> $GITHUB_OUTPUT
echo "folder=${{env._APP_DEPLOY_FOLDER_OT3}}" >> $GITHUB_OUTPUT
fi
- uses: 'actions/checkout@v3'
with:
Expand Down Expand Up @@ -313,9 +312,10 @@ jobs:
make -C app-shell-odd dist-ot3
deploy-release-app:
name: 'Deploy built release-variant app artifacts to S3'
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'
Expand Down Expand Up @@ -348,15 +348,19 @@ jobs:
- name: 'deploy internal-release release builds to s3'
run: |
aws s3 --profile=deploy sync --acl=public-read to_upload_internal-release/ s3://${{ env._APP_DEPLOY_BUCKET_OT3 }}/${{ env._APP_DEPLOY_FOLDER_OT3 }}
- name: 'create GH release'
- name: 'upload windows artifacts to GH release'
uses: 'ncipollo/[email protected]'
if: needs.determine-build-type.outputs.type == 'release'
with:
allowUpdates: true
replacesArtifacts: true
omitBodyDuringUpdate: true
omitDraftDuringUpdate: true
omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true
- name: 'upload windows artifact to GH release'
artifacts: ./artifacts/*/*.exe
artifactContentType: application/vnd.microsoft.portable-executable
- name: 'upload macos artifacts to GH release'
uses: 'ncipollo/[email protected]'
if: needs.determine-build-type.outputs.type == 'release'
with:
Expand All @@ -365,11 +369,21 @@ jobs:
omitDraftDuringUpdate: true
omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true
artifacts: ./artifacts/**/*.exe ./artifacts/**/*.dmg ./artifacts/**/*.AppImage
artifactContentType: application/vnd.microsoft.portable-executable
- name: 'detect internal-release build data for notification'
artifacts: ./artifacts/*/*.dmg
artifactContentType: application/octet-stream
- name: 'upload linux artifacts to GH release'
uses: 'ncipollo/[email protected]'
if: needs.determine-build-type.outputs.type == 'release'
with:
allowUpdates: true
omitBodyDuringUpdate: true
omitDraftDuringUpdate: true
omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true
artifacts: ./artifacts/*/*.AppImage
artifactContentType: application/octet-stream
- name: 'detect build data for notification'
id: names
if: contains(fromJSON(needs.determine-build-type.outputs.variants), 'internal-release')
shell: bash
run: |
for variant in release internal-release ; do
Expand All @@ -387,15 +401,65 @@ jobs:
uses: slackapi/[email protected]
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}}
- name: 'slack notify release'
uses: slackapi/[email protected]
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}}

- name: 'pull repo for scripts'
uses: 'actions/checkout@v3'
with:
path: ./monorepo
# https://github.com/actions/checkout/issues/290
- name: 'Fix actions/checkout odd handling of tags'
if: startsWith(github.ref, 'refs/tags')
run: |
cd ./monorepo
git fetch -f origin ${{ github.ref }}:${{ github.ref }}
git checkout ${{ github.ref }}
- uses: 'actions/setup-node@v3'
with:
node-version: '16'
- name: 'install udev'
run: sudo apt-get update && sudo apt-get install libudev-dev
- name: 'set complex environment variables'
id: 'set-vars'
uses: actions/github-script@v6
with:
script: |
const { buildComplexEnvVars } = require(`${process.env.GITHUB_WORKSPACE}/monorepo/.github/workflows/utils.js`)
buildComplexEnvVars(core, context)
- name: 'cache yarn cache'
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.npm-cache/_prebuild
${{ github.workspace }}/.yarn-cache
key: js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
- name: 'setup-js'
run: |
npm config set cache ${{ github.workspace }}/.npm-cache
yarn config set cache-folder ${{ github.workspace }}/.yarn-cache
cd monorepo
make setup-js
- name: 'update internal-releases releases.json'
if: needs.determine-build-type.outputs.type == 'release' && contains(fromJSON(needs.determine-build-type.outputs.variants), 'internal-release')
run: |
aws --profile=deploy s3 cp s3://${{ env._APP_DEPLOY_BUCKET_OT3 }}/${{ env._APP_DEPLOY_FOLDER_OT3 }}/releases.json ./to_upload_internal-release/releases.json
node ./monorepo/scripts/update-releases-json ./to_upload_internal-release/releases.json ot3 ./to_upload_internal-release https://ot3-development.builds.opentrons.com/app/
aws --profile=deploy s3 cp ./to_upload_internal-release/releases.json s3://${{ env._APP_DEPLOY_BUCKET_OT3 }}/${{ env._APP_DEPLOY_FOLDER_OT3 }}/releases.json
- name: 'update release releases.json'
if: needs.determine-build-type.outputs.type == 'release' && contains(fromJSON(needs.determine-build-type.outputs.variants), 'release')
run: |
aws --profile=deploy s3 cp s3://${{ env._APP_DEPLOY_BUCKET_ROBOTSTACK }}/${{ env._APP_DEPLOY_FOLDER_ROBOTSTACK }}/releases.json ./to_upload_release/releases.json
node ./monorepo/scripts/update-releases-json ./to_upload_release/releases.json robot-stack ./to_upload_release https://builds.opentrons.com/app/
aws --profile=deploy s3 cp ./to_upload_release/releases.json s3://${{ env._APP_DEPLOY_BUCKET_ROBOTSTACK }}/${{ env._APP_DEPLOY_FOLDER_ROBOTSTACK }}/releases.json
87 changes: 81 additions & 6 deletions .github/workflows/components-test-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,14 @@ jobs:
yarn config set cache-folder ./.yarn-cache
make setup-js
- name: 'run components unit tests'
run: |
yarn jest --coverage=true --ci=true --collectCoverageFrom="components/src/**/*.(js|ts|tsx)" components/src
run: make -C components test-cov
- name: 'Upload coverage report'
uses: codecov/codecov-action@v3
with:
files: ./coverage/lcov.info
flags: components

build-components:
build-components-storybook:
name: 'build components artifact'
runs-on: 'ubuntu-22.04'
if: github.event_name != 'pull_request'
Expand Down Expand Up @@ -103,11 +102,32 @@ jobs:
with:
name: 'components-artifact'
path: storybook-static

determine-build-type:
runs-on: 'ubuntu-latest'
name: 'Determine build type'
outputs:
type: ${{steps.determine-build-type.outputs.type}}
steps:
- id: determine-build-type
run: |
echo "Determining build type for event ${{github.event_type}} and ref ${{github.ref}}"
if [ "${{ format('{0}', github.ref == 'refs/heads/edge') }}" = "true" ] ; then
echo "storybook s3 builds for edge"
echo 'type=storybook' >> $GITHUB_OUTPUT
elif [ "${{ format('{0}', startsWith(github.ref, 'refs/tags/components')) }}" = "true" ] ; then
echo "publish builds for components tags"
echo 'type=publish' >> $GITHUB_OUTPUT
else
echo "No build for ref ${{github.ref}} and event ${{github.event_type}}"
echo 'type=none' >> $GITHUB_OUTPUT
fi
deploy-components:
name: 'deploy components artifact to S3'
name: 'deploy components storybook artifact to S3'
runs-on: 'ubuntu-22.04'
needs: ['js-unit-test', 'build-components']
if: github.event_name != 'pull_request'
needs: ['js-unit-test', 'build-components-storybook', 'determine-build-type']
if: needs.determine-build-type.outputs.type != 'none'
steps:
- uses: 'actions/checkout@v3'
# https://github.com/actions/checkout/issues/290
Expand Down Expand Up @@ -138,3 +158,58 @@ jobs:
AWS_DEFAULT_REGION: us-east-2
run: |
aws s3 sync ./dist s3://opentrons-components/${{ env.OT_BRANCH}} --acl public-read
publish-components:
name: 'publish components package to npm'
runs-on: 'ubuntu-latest'
needs: ['js-unit-test', 'determine-build-type']
if: needs.determine-build-type.outputs.type == 'publish'
steps:
- uses: 'actions/checkout@v3'
# https://github.com/actions/checkout/issues/290
- name: 'Fix actions/checkout odd handling of tags'
if: startsWith(github.ref, 'refs/tags')
run: |
git fetch -f origin ${{ github.ref }}:${{ github.ref }}
git checkout ${{ github.ref }}
- uses: 'actions/setup-node@v3'
with:
node-version: '16'
registry-url: 'https://registry.npmjs.org'
- name: 'cache yarn cache'
uses: actions/cache@v3
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
yarn config set network-timeout 60000
yarn
- name: 'build library'
run: |
make -C components lib
# replace package.json stub version number with version from tag
- name: 'set version number'
run: |
npm install -g json
VERSION_STRING=$(echo ${{ github.ref }} | sed 's/refs\/tags\/components@//')
json -I -f ./components/package.json -e "this.version=\"$VERSION_STRING\""
json -I -f ./components/package.json -e "this.dependencies['@opentrons/shared-data']=\"$VERSION_STRING\""
- uses: 'actions/setup-node@v3'
with:
node-version: '16'
registry-url: 'https://registry.npmjs.org'
- name: 'publish to npm registry'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
cd ./components && echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ./.npmrc && npm publish --access public
4 changes: 2 additions & 2 deletions .github/workflows/ll-test-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ jobs:
yarn config set cache-folder ./.yarn-cache
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
run: make -C labware-library test-cov
- name: 'Upload coverage report'
uses: codecov/codecov-action@v3
with:
Expand Down Expand Up @@ -117,6 +116,7 @@ jobs:
build-ll:
name: 'build labware library artifact'
needs: ['js-unit-test']
timeout-minutes: 30
runs-on: 'ubuntu-20.04'
if: github.event_name != 'pull_request'
steps:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/pd-test-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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-cov
- name: 'Upload coverage report'
uses: codecov/codecov-action@v3
with:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/react-api-client-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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-cov
- name: 'Upload coverage report'
uses: codecov/codecov-action@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/robot-server-lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ defaults:
jobs:
lint-test:
name: 'robot server package linting and tests'
timeout-minutes: 20
timeout-minutes: 40
runs-on: 'ubuntu-22.04'
strategy:
matrix:
Expand Down
Loading

0 comments on commit 327b441

Please sign in to comment.