-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(build): switch to github workflows for robot stack CI (#6632)
Add github workflow definitions for all tasks related to robot stack checks, tests, builds, and deploys that were not previously configured. Specifically, - The api-lint-test-build and shared-data-lint-test-build workflows now deploy to pypi when necessary (and were renamed) - New workflow js-checks run javascript check actions on any javascript change, since the checkers do not reasonably work on project subsets - New workflow app-test-build-deploy runs js tests for the app and its dependencies, cross-platform when necessary; it also builds the app, with full signing support, and deploys it as travis does In addition, appveyor has been fully removed and travis now only handles non-robot-stack workflows.
- Loading branch information
Showing
15 changed files
with
498 additions
and
312 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: 'Deploy wheel to pypi' | ||
description: 'Deploy a python wheel to pypi or test pypi, depending on configuration. The python environment for the subproject must be set up already, and the complex environment variables must be defined.' | ||
inputs: | ||
project: | ||
description: 'Which project to run make deploy in' | ||
required: true | ||
repository_url: | ||
description: 'The repository url to upload to. Creds will be determined based on this' | ||
required: true | ||
password: | ||
description: 'The repository password' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- shell: bash | ||
run: | | ||
echo "::add-mask::${{ inputs.password }}" | ||
if [[ ${{ inputs.repository_url }} =~ "test" ]]; then | ||
echo '::set-env name=SWALLOW_FAILURE::|| echo "Duplicate upload allowed on test"' | ||
echo "Uploading to test pypi" | ||
else if [[ ${{ inputs.repository_url }} =~ "upload.pypi.org" ]]; then | ||
echo "Uploading to prod pypi" | ||
# this needs to be cleared otherwise the makefiles append a dev tag | ||
echo ::set-env name=OT_BUILD::"" | ||
else | ||
echo "::error ::Invalid repository url ${{ inputs.repository_url }}" | ||
exit 1 | ||
fi | ||
fi | ||
- shell: bash | ||
run: | | ||
status=0 | ||
QUIET=1 BUILD_NUMBER=${OT_BUILD} make -C ${{ inputs.project }} clean deploy twine_repository_url=${{ inputs.repository_url }} pypi_username=opentrons pypi_password=${{ inputs.password }} || status=$? | ||
if [[ ${status} != 0 ]] && [[ ${{ inputs.repository_url }} =~ "test.pypi.org" ]]; then | ||
echo "upload failures allowed to test pypi" | ||
exit 0 | ||
fi | ||
exit ${status} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
# This workflow runs tests and lint on pull requests that touch the api/ | ||
# project or its CI configuration. | ||
|
||
name: 'API test/lint/deploy' | ||
|
||
on: | ||
# Most of the time, we run on pull requests, which lets us handle external PRs | ||
pull_request: | ||
paths: | ||
- 'api/**' | ||
- 'Makefile' | ||
- 'shared-data/*/**' | ||
- '!shared-data/js/**' | ||
push: | ||
paths: | ||
- 'api/**' | ||
- 'Makefile' | ||
- 'shared-data/*/**' | ||
- '!shared-data/js/**' | ||
- '.github/workflows/api-test-lint-deploy.yaml' | ||
- '.github/actions/python/**/*' | ||
- '.github/workflows/utils.js' | ||
branches: | ||
- '*' | ||
tags: | ||
- 'v*' | ||
workflow_dispatch: | ||
|
||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
lint: | ||
name: 'opentrons package linting' | ||
runs-on: 'ubuntu-latest' | ||
steps: | ||
- uses: 'actions/checkout@v2' | ||
- uses: 'actions/setup-node@v1' | ||
with: | ||
node-version: '12' | ||
- uses: 'actions/setup-python@v2' | ||
with: | ||
python-version: '3.7' | ||
|
||
- uses: './.github/actions/python/setup' | ||
with: | ||
project: 'api' | ||
- name: Lint | ||
run: make -C api lint | ||
test: | ||
name: 'opentrons package tests' | ||
needs: [lint] | ||
strategy: | ||
matrix: | ||
os: ['windows-latest', 'ubuntu-latest', 'macos-latest'] | ||
runs-on: '${{ matrix.os }}' | ||
steps: | ||
- uses: 'actions/checkout@v2' | ||
- uses: 'actions/setup-node@v1' | ||
with: | ||
node-version: '12' | ||
- uses: 'actions/setup-python@v2' | ||
with: | ||
python-version: '3.7' | ||
- name: 'set complex environment variables' | ||
uses: actions/github-script@v3 | ||
with: | ||
script: | | ||
const { buildComplexEnvVars, } = require(`${process.env.GITHUB_WORKSPACE}/.github/workflows/utils.js`) | ||
buildComplexEnvVars(core, context) | ||
- uses: './.github/actions/python/setup' | ||
with: | ||
project: 'api' | ||
- name: Test | ||
run: make -C api test | ||
- uses: 'codecov/codecov-action@v1' | ||
with: | ||
file: ./api/coverage.xml | ||
|
||
deploy: | ||
name: 'deploy opentrons package' | ||
needs: [test] | ||
runs-on: 'ubuntu-latest' | ||
if: github.event_name == 'push' | ||
steps: | ||
- uses: 'actions/checkout@v2' | ||
- uses: 'actions/setup-node@v1' | ||
with: | ||
node-version: '12' | ||
- uses: 'actions/setup-python@v2' | ||
with: | ||
python-version: '3.7' | ||
- name: 'set complex environment variables' | ||
uses: actions/github-script@v3 | ||
with: | ||
script: | | ||
const { buildComplexEnvVars, } = require(`${process.env.GITHUB_WORKSPACE}/.github/workflows/utils.js`) | ||
buildComplexEnvVars(core, context) | ||
- uses: './.github/actions/python/setup' | ||
with: | ||
project: 'api' | ||
# creds and repository configuration for deploying python wheels | ||
- if: ${{ !env.OT_TAG }} | ||
name: 'upload to test pypi' | ||
uses: './.github/actions/python/pypi-deploy' | ||
with: | ||
project: 'api' | ||
repository_url: 'https://test.pypi.org/legacy/' | ||
password: '${{ secrets.OT_TEST_PYPI_PASSWORD }}' | ||
- if: startsWith(env.OT_TAG, 'v') | ||
name: 'upload to real pypi' | ||
uses: './.github/actions/python/pypi-deploy' | ||
with: | ||
project: 'api' | ||
repository_url: 'https://upload.pypi.org/legacy/' | ||
password: '${{ secrets.OT_PYPI_PASSWORD }}' |
Oops, something went wrong.