This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 218
91 lines (79 loc) · 2.5 KB
/
check-modified-assets.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Check Modified Assets
on:
pull_request:
jobs:
build-trunk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: trunk
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-build-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Setup node version and npm cache
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install Node dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm install --no-optional --no-audit
- name: Build Assets
run: npm run build:check-assets
- name: Upload Artifact
uses: actions/upload-artifact@v3.1.2
with:
name: assets-list
path: ./build/assets.json
compare-assets-with-trunk:
needs: [ build-trunk ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-build-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Setup node version and npm cache
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Build Assets
run: npm run build:check-assets
- name: Download assets (trunk)
uses: actions/download-artifact@v3
with:
name: assets-list
path: assets-list
- name: Compare Assets
uses: ./.github/compare-assets
id: compare-assets
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
compare: assets-list/assets.json
create-comment: false
- name: Append report
uses: ./.github/comments-aggregator
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
section-id: compare-assets-with-trunk
content: ${{steps.compare-assets.outputs.comment}}