Update GitHub action workflows (#728)

* Deploy on published release

* Run build and test on merge to master

* Update release drafter template

* Update title of releases

* Testing cypress fix

* Pass group to --group flag
This commit is contained in:
Josh Johnson 2019-10-31 17:28:12 +00:00 committed by GitHub
parent 5051bf1b10
commit 00e53f76ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 64 additions and 17 deletions

View file

@ -1,5 +1,6 @@
name-template: 'v$NEXT_PATCH_VERSION 🌈'
name-template: 'Draft (next release)'
tag-template: 'v$NEXT_PATCH_VERSION'
sort-direction: descending
categories:
- title: '🚨 Breaking changes'
labels:
@ -19,3 +20,4 @@ categories:
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
template: |
$CHANGES
$CONTRIBUTORS

46
.github/workflows/build-and-test.yml vendored Normal file
View file

@ -0,0 +1,46 @@
name: Build and test
on:
push:
branches:
- master
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- uses: actions/setup-node@v1
with:
node-version: 10
# run all tests
- run: |
npm ci
npm run build
npx bundlesize
npm run test:unit:coverage
npm run test:e2e
env:
CI: true
CI_REPO_NAME: ${{ github.event.repository.name }}
CI_REPO_OWNER: ${{ github.event.organization.login }}
CI_COMMIT_SHA: ${{ github.sha }}
GIT_COMMIT: ${{ github.sha }}
CI_BRANCH: ${{ github.head_ref }}
BUNDLESIZE_GITHUB_TOKEN: ${{secrets.BUNDLESIZE_GITHUB_TOKEN}}
FORCE_COLOR: 2
HUSKY_SKIP_INSTALL: true
- name: Upload coverage to Codecov
run: bash <(curl -s https://codecov.io/bash)
-f ./coverage/lcov.info
-B ${{ github.head_ref }}
-C ${{ github.sha }}
-Z || echo 'Codecov upload failed'
env:
CI: true
GITLAB_CI: true # pretend we are GitLab CI, while Codecov adding support for Github Actions
CODECOV_ENV: github-action
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}

View file

@ -1,4 +1,4 @@
name: BundleSize
name: Bundle size checks
on:
pull_request:
@ -22,8 +22,8 @@ jobs:
- name: Install dependencies and build
run: |
npm ci
npm run build
npm ci
npm run build
env:
CYPRESS_INSTALL_BINARY: 0
HUSKY_SKIP_INSTALL: true

View file

@ -1,12 +1,11 @@
name: Publish Package
name: Publish and deploy
on:
push:
branches:
- master
release:
types: [published]
jobs:
build:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

View file

@ -1,4 +1,4 @@
name: Cypress
name: End-to-end tests
on:
pull_request:
@ -14,7 +14,6 @@ on:
jobs:
test-e2e:
name: integration tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
@ -35,8 +34,10 @@ jobs:
env:
CI: true
TERM: xterm-256color
NODE_ENV: production # prevent watching
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
DEBUG: commit-info,cypress:server:record
# https://docs.cypress.io/guides/guides/continuous-integration.html#Environment-variables
COMMIT_INFO_BRANCH: ${{ github.head_ref }}
NODE_ENV: production # prevent watching
COMMIT_INFO_AUTHOR: ${{ github.event.sender.login }}
COMMIT_INFO_SHA: ${{ github.event.after }}

View file

@ -1,4 +1,4 @@
name: Lint
name: Code linting
on:
pull_request:

View file

@ -1,8 +1,7 @@
name: Release Management
name: Release management
on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- master

View file

@ -1,4 +1,4 @@
name: Unit Tests
name: Unit tests
on:
pull_request:

View file

@ -11,7 +11,7 @@
"bundlesize": "bundlesize",
"cypress:run": "$(npm bin)/cypress run",
"cypress:open": "$(npm bin)/cypress open",
"cypress:ci": "cypress run --record --group --ci-build-id $GITHUB_SHA",
"cypress:ci": "cypress run --record --group $GITHUB_REF --ci-build-id $GITHUB_SHA",
"test": "run-s test:unit test:e2e",
"test:unit": "NODE_ENV=test mocha",
"test:unit:watch": "NODE_ENV=test mocha --watch --inspect=5556",