-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(build): activate GitHub workflow for PRs (#427)
* pull_request, GitHub workflow, error annotations, cache * custom_release, Travis expand branches allowed for prod-stable
- Loading branch information
Showing
2 changed files
with
80 additions
and
1 deletion.
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,79 @@ | ||
name: Pull request | ||
on: | ||
pull_request: | ||
branches: [ master, main, prod, stage, test**, qa**, dev**, ci** ] | ||
env: | ||
BRANCH: ${{ github.base_ref }} | ||
|
||
jobs: | ||
Integration-checks: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [12.x] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Set Node.js packages yarn cache directory | ||
id: yarn-cache-dir | ||
run: echo ::set-output name=CACHE_DIR::$(yarn cache dir) | ||
- name: Node.js yarn cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.yarn-cache-dir.outputs.CACHE_DIR }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn | ||
- name: Node.js modules cache | ||
uses: actions/cache@v2 | ||
id: modules-cache | ||
with: | ||
path: ${{ github.workspace }}/node_modules | ||
key: ${{ runner.os }}-${{ matrix.node-version }}-modules-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ matrix.node-version }}-modules | ||
- name: Install Node.js packages | ||
if: ${{ steps.modules-cache.outputs.cache-hit != 'true' }} | ||
run: yarn install | ||
- name: Lint and test | ||
uses: actions/github-script@v2 | ||
with: | ||
script: | | ||
const { execSync } = require('child_process'); | ||
try { | ||
console.log(`${execSync('yarn test', { stdio: 'pipe' })}`); | ||
} catch ({ stdout, stderr }) { | ||
core.setFailed(`${stdout}\n${stderr}`); | ||
} | ||
- name: Code coverage | ||
if: ${{ success() }} | ||
uses: codecov/codecov-action@v1 | ||
- name: Confirm beta integration | ||
if: ${{ success() }} | ||
uses: actions/github-script@v2 | ||
with: | ||
script: | | ||
const { execSync } = require('child_process'); | ||
try { | ||
console.log(`${execSync('yarn build', { stdio: 'pipe' })}`); | ||
} catch ({ stdout, stderr }) { | ||
core.setFailed(`${stdout}\n${stderr}`); | ||
} | ||
env: | ||
BUILD_STAGE: Beta | ||
- name: Confirm stable integration | ||
if: ${{ success() }} | ||
uses: actions/github-script@v2 | ||
with: | ||
script: | | ||
const { execSync } = require('child_process'); | ||
try { | ||
console.log(`${execSync('yarn build', { stdio: 'pipe' })}`); | ||
} catch ({ stdout, stderr }) { | ||
core.setFailed(`${stdout}\n${stderr}`); | ||
} | ||
env: | ||
BUILD_STAGE: Stable |
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