forked from RedHatInsights/curiosity-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (69 loc) · 2.28 KB
/
pull_request.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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: [14.x, 16.x]
steps:
- uses: actions/checkout@v2
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 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@v6
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@v2.1.0
- name: Confirm beta integration
if: ${{ success() }}
uses: actions/github-script@v6
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@v6
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