-
Notifications
You must be signed in to change notification settings - Fork 239
61 lines (55 loc) · 1.89 KB
/
pr_push_checks_node.yaml
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
name: Node PR Checks
on:
- pull_request
concurrency:
group: pr-node-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-npm:
name: Running smoke test npm build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get changed dashboard files
id: changed-files
uses: tj-actions/changed-files@v35
with:
files: |
dashboard/**
- name: List all changed files
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "$file was changed"
done
- name: Setup Node
uses: actions/setup-node@v3
if: steps.changed-files.outputs.any_changed == 'true'
with:
node-version: 16
- name: Setup NPM
if: steps.changed-files.outputs.any_changed == 'true'
working-directory: dashboard
run: |
# installing updated npm
# Verify npm works before capturing and ensure its stderr is inspectable later
version="$(jq -r '.engines.npm' package.json)"
npm --version 2>&1 1>/dev/null
npm_version="$(npm --version)"
echo "Bootstrapping npm $version (replacing $npm_version)..."
npm install --unsafe-perm -g --quiet "npm@$version"
# Verify npm works before capturing and ensure its stderr is inspectable later
npm --version 2>&1 1>/dev/null
echo "npm $(npm --version) installed"
- name: Install NPM Dependencies
if: steps.changed-files.outputs.any_changed == 'true'
working-directory: dashboard
run: |
npm i --legacy-peer-deps
- name: Run NPM Build
if: steps.changed-files.outputs.any_changed == 'true'
working-directory: dashboard
run: |
npm run build