-
Notifications
You must be signed in to change notification settings - Fork 39
49 lines (47 loc) · 1.45 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
# Run this workflow for PRs only. Travis is required to push via insights-frontend-builder-common scripts
name: Pull request
on:
pull_request:
branches: [ main, master, prod-beta, prod-stable, stage-beta, stage-stable ]
env:
BRANCH: ${{ github.base_ref }}
jobs:
build:
name: koku-ui build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Lint
if: ${{ success() }}
run: npm run lint
- name: Test
if: ${{ success() }}
run: npm test --coverage --maxWorkers=4
- name: Code coverage
if: ${{ success() }}
uses: codecov/codecov-action@v1