-
Notifications
You must be signed in to change notification settings - Fork 14
59 lines (53 loc) · 1.66 KB
/
pr-build.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
name: Pull requests
on: pull_request
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
package: [oidc, proxy, logger, ffdc-apis/corporate-accounts]
steps:
# Setup
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache Node.js modules
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- name: Install Dependencies
run: npm ci --loglevel=error
# Tests
- name: Unit tests
run: npm run test:cov
- name: Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage/lcov.info
fail_ci_if_error: true
# Build
- name: Artifact name formatting
run: |
artifactName="${packagePath////-}"
libName="${packagePath##*/}"
echo "Artifact name : ${artifactName}"
echo "Library name : ${libName}"
echo "artifactName=$artifactName" >> $GITHUB_ENV
echo "libName=$libName" >> $GITHUB_ENV
env:
packagePath: ${{ matrix.package }}
- name: Build Package
run: npm run build -- ${{ env.libName }}
- name: Upload Artifact
uses: actions/[email protected]
with:
name: '${{ env.artifactName }}'
path: './dist/libs/${{ matrix.package }}'