Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(components): build/deploy components on gh #7183

Merged
merged 3 commits into from
Jan 6, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 114 additions & 0 deletions .github/workflows/components-test-build-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Run tests, build components bundle, and deploy it to sandbox

name: 'Components test, build, and deploy'

on:
pull_request:
paths:
- 'components/**'
- 'webpack-config/**'
- 'package.json'
- '.github/workflows/components-test-build-deploy.yaml'
push:
paths:
- 'components/**'
- 'webpack-config/**'
- 'package.json'
- '.github/workflows/components-test-build-deploy.yaml'
branches:
- '*'
tags:
- 'components*'

defaults:
run:
shell: bash

env:
CI: true

jobs:
js-unit-test:
name: 'components unit tests'
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v2'
- uses: 'actions/setup-node@v1'
with:
node-version: '12'
- 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: 'run components unit tests'
run: |
yarn jest --coverage=true --ci=true components/
build-components:
name: 'build components artifact'
runs-on: 'ubuntu-latest'
if: github.event_name != 'pull_request'
steps:
- uses: 'actions/checkout@v2'
- uses: 'actions/setup-node@v1'
with:
node-version: '12'
- 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: 'build components'
run: |
make -C components
- name: 'upload github artifact'
uses: actions/upload-artifact@v2
with:
name: 'components-artifact'
path: components/dist
deploy-components:
name: 'deploy components artifact to S3'
runs-on: 'ubuntu-latest'
needs: ["js-unit-test", "build-components"]
if: github.event_name != 'pull_request'
steps:
- uses: 'actions/checkout@v2'
- uses: 'actions/setup-node@v1'
with:
node-version: '12'
- name: 'set complex environment variables'
id: 'set-vars'
uses: actions/[email protected]
with:
script: |
const { buildComplexEnvVars } = require(`${process.env.GITHUB_WORKSPACE}/.github/workflows/utils.js`)
buildComplexEnvVars(core, context)
- name: 'download components build'
uses: 'actions/download-artifact@v2'
with:
name: components-artifact
path: ./dist
- name: 'deploy builds to s3'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_SANDBOX_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_SANDBOX_SECRET }}
run: |
aws s3 sync ./dist s3://opentrons-components/${{ env.OT_BRANCH}}
69 changes: 0 additions & 69 deletions .travis.yml

This file was deleted.