mirror of
https://github.com/Choices-js/Choices.git
synced 2024-06-27 01:40:26 +02:00
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:
parent
5051bf1b10
commit
00e53f76ee
4
.github/release-drafter.yml
vendored
4
.github/release-drafter.yml
vendored
|
@ -1,5 +1,6 @@
|
||||||
name-template: 'v$NEXT_PATCH_VERSION 🌈'
|
name-template: 'Draft (next release)'
|
||||||
tag-template: 'v$NEXT_PATCH_VERSION'
|
tag-template: 'v$NEXT_PATCH_VERSION'
|
||||||
|
sort-direction: descending
|
||||||
categories:
|
categories:
|
||||||
- title: '🚨 Breaking changes'
|
- title: '🚨 Breaking changes'
|
||||||
labels:
|
labels:
|
||||||
|
@ -19,3 +20,4 @@ categories:
|
||||||
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
|
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
|
||||||
template: |
|
template: |
|
||||||
$CHANGES
|
$CHANGES
|
||||||
|
$CONTRIBUTORS
|
||||||
|
|
46
.github/workflows/build-and-test.yml
vendored
Normal file
46
.github/workflows/build-and-test.yml
vendored
Normal 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}}
|
6
.github/workflows/bundlesize.yml
vendored
6
.github/workflows/bundlesize.yml
vendored
|
@ -1,4 +1,4 @@
|
||||||
name: BundleSize
|
name: Bundle size checks
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
@ -22,8 +22,8 @@ jobs:
|
||||||
|
|
||||||
- name: Install dependencies and build
|
- name: Install dependencies and build
|
||||||
run: |
|
run: |
|
||||||
npm ci
|
npm ci
|
||||||
npm run build
|
npm run build
|
||||||
env:
|
env:
|
||||||
CYPRESS_INSTALL_BINARY: 0
|
CYPRESS_INSTALL_BINARY: 0
|
||||||
HUSKY_SKIP_INSTALL: true
|
HUSKY_SKIP_INSTALL: true
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
name: Publish Package
|
name: Publish and deploy
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
release:
|
||||||
branches:
|
types: [published]
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build-and-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
|
@ -1,4 +1,4 @@
|
||||||
name: Cypress
|
name: End-to-end tests
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
@ -14,7 +14,6 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test-e2e:
|
test-e2e:
|
||||||
name: integration tests
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
|
@ -35,8 +34,10 @@ jobs:
|
||||||
env:
|
env:
|
||||||
CI: true
|
CI: true
|
||||||
TERM: xterm-256color
|
TERM: xterm-256color
|
||||||
|
NODE_ENV: production # prevent watching
|
||||||
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
|
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
|
||||||
DEBUG: commit-info,cypress:server:record
|
DEBUG: commit-info,cypress:server:record
|
||||||
# https://docs.cypress.io/guides/guides/continuous-integration.html#Environment-variables
|
# https://docs.cypress.io/guides/guides/continuous-integration.html#Environment-variables
|
||||||
COMMIT_INFO_BRANCH: ${{ github.head_ref }}
|
COMMIT_INFO_BRANCH: ${{ github.head_ref }}
|
||||||
NODE_ENV: production # prevent watching
|
COMMIT_INFO_AUTHOR: ${{ github.event.sender.login }}
|
||||||
|
COMMIT_INFO_SHA: ${{ github.event.after }}
|
2
.github/workflows/lint.yml
vendored
2
.github/workflows/lint.yml
vendored
|
@ -1,4 +1,4 @@
|
||||||
name: Lint
|
name: Code linting
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
3
.github/workflows/release-management.yml
vendored
3
.github/workflows/release-management.yml
vendored
|
@ -1,8 +1,7 @@
|
||||||
name: Release Management
|
name: Release management
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
# branches to consider in the event; optional, defaults to all
|
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
|
|
2
.github/workflows/unit-tests.yml
vendored
2
.github/workflows/unit-tests.yml
vendored
|
@ -1,4 +1,4 @@
|
||||||
name: Unit Tests
|
name: Unit tests
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
"bundlesize": "bundlesize",
|
"bundlesize": "bundlesize",
|
||||||
"cypress:run": "$(npm bin)/cypress run",
|
"cypress:run": "$(npm bin)/cypress run",
|
||||||
"cypress:open": "$(npm bin)/cypress open",
|
"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": "run-s test:unit test:e2e",
|
||||||
"test:unit": "NODE_ENV=test mocha",
|
"test:unit": "NODE_ENV=test mocha",
|
||||||
"test:unit:watch": "NODE_ENV=test mocha --watch --inspect=5556",
|
"test:unit:watch": "NODE_ENV=test mocha --watch --inspect=5556",
|
||||||
|
|
Loading…
Reference in a new issue