2022-02-02 14:56:16 +00:00
|
|
|
name: Check Modified Assets
|
|
|
|
|
|
|
|
on:
|
2023-04-21 11:07:37 +00:00
|
|
|
pull_request:
|
2022-02-02 14:56:16 +00:00
|
|
|
|
|
|
|
jobs:
|
2023-04-21 11:07:37 +00:00
|
|
|
build-trunk:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
ref: trunk
|
2022-05-24 11:42:54 +00:00
|
|
|
|
2023-04-21 11:07:37 +00:00
|
|
|
- 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 }}-
|
2022-05-24 11:42:54 +00:00
|
|
|
|
2023-04-21 11:07:37 +00:00
|
|
|
- name: Setup node version and npm cache
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version-file: '.nvmrc'
|
|
|
|
cache: 'npm'
|
2022-05-24 11:42:54 +00:00
|
|
|
|
2023-04-21 11:07:37 +00:00
|
|
|
- name: Install Node dependencies
|
|
|
|
if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
|
|
|
run: npm install --no-optional --no-audit
|
2022-05-24 11:42:54 +00:00
|
|
|
|
2023-04-21 11:07:37 +00:00
|
|
|
- name: Build Assets
|
|
|
|
run: npm run build:check-assets
|
2022-02-02 14:56:16 +00:00
|
|
|
|
2023-04-21 11:07:37 +00:00
|
|
|
- name: Upload Artifact
|
2023-07-28 14:04:19 +00:00
|
|
|
uses: actions/upload-artifact@v3.1.2
|
2023-04-21 11:07:37 +00:00
|
|
|
with:
|
|
|
|
name: assets-list
|
|
|
|
path: ./build/assets.json
|
|
|
|
|
|
|
|
compare-assets-with-trunk:
|
|
|
|
needs: [ build-trunk ]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2022-05-24 11:42:54 +00:00
|
|
|
|
2023-04-21 11:07:37 +00:00
|
|
|
- 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@v3
|
|
|
|
with:
|
|
|
|
node-version-file: '.nvmrc'
|
|
|
|
cache: 'npm'
|
2022-05-24 11:42:54 +00:00
|
|
|
|
2023-04-21 11:07:37 +00:00
|
|
|
- name: Build Assets
|
|
|
|
run: npm run build:check-assets
|
2022-05-24 11:42:54 +00:00
|
|
|
|
2023-04-21 11:07:37 +00:00
|
|
|
- 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}}
|