-
Notifications
You must be signed in to change notification settings - Fork 3
58 lines (51 loc) · 1.4 KB
/
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
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
runs-on: '${{ matrix.os }}'
strategy:
matrix:
os:
- ubuntu-latest
node-version:
- 18.x
steps:
- name: 'Set up Node.js ${{ matrix.node-version }}'
uses: actions/setup-node@v3
with:
node-version: '${{ matrix.node-version }}'
- name: Cache node modules
uses: actions/cache@v3
with:
path: ~/.npm
key: v1-npm-deps-${{ hashFiles('**/package-lock.json') }}
restore-keys: v1-npm-deps-
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get changed files list
id: changed_files
uses: tj-actions/changed-files@v39
with:
since_last_remote_commit: true
- name: Save changed files to env
run: |
csv=""
for result in ${{ steps.changed_files.outputs.all_changed_files }}; do
file="$result"
csv="${csv}${csv:+,}$file"
done
echo "CHANGED_FILES=$csv" >> $GITHUB_ENV
- name: Install dependencies
run: 'npm ci'
- name: Run build (lint, test, validate)
run: 'npm run bootstrap && npm run build:ci'
- name: Publish Package(s)
if: github.ref == 'refs/heads/main'
run: 'npm run publish'