2022-02-02 14:56:16 +00:00
|
|
|
name: Check Modified Assets
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-trunk:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-03-23 07:41:43 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-02-02 14:56:16 +00:00
|
|
|
with:
|
|
|
|
ref: trunk
|
2022-05-24 11:42:54 +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-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
|
2022-03-23 07:41:43 +00:00
|
|
|
- name: Setup node version and npm cache
|
|
|
|
uses: actions/setup-node@v3
|
2022-02-02 14:56:16 +00:00
|
|
|
with:
|
2022-03-23 07:41:43 +00:00
|
|
|
node-version-file: '.nvmrc'
|
|
|
|
cache: 'npm'
|
2022-05-24 11:42:54 +00:00
|
|
|
|
|
|
|
- name: Install Node dependencies
|
|
|
|
if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
|
|
|
run: npm ci --no-optional
|
|
|
|
|
|
|
|
- name: Build Assets
|
|
|
|
run: npm run build:check-assets
|
|
|
|
|
2022-02-02 14:56:16 +00:00
|
|
|
- name: Upload Artifact
|
2022-03-23 07:41:43 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-02-02 14:56:16 +00:00
|
|
|
with:
|
|
|
|
name: assets-list
|
|
|
|
path: ./build/assets.json
|
|
|
|
|
|
|
|
compare-assets-with-trunk:
|
|
|
|
needs: [build-trunk]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-03-23 07:41:43 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-05-24 11:42:54 +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-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
|
2022-03-23 07:41:43 +00:00
|
|
|
- name: Setup node version and npm cache
|
|
|
|
uses: actions/setup-node@v3
|
2022-02-02 14:56:16 +00:00
|
|
|
with:
|
2022-03-23 07:41:43 +00:00
|
|
|
node-version-file: '.nvmrc'
|
|
|
|
cache: 'npm'
|
2022-05-24 11:42:54 +00:00
|
|
|
|
|
|
|
- name: Build Assets
|
|
|
|
run: npm run build:check-assets
|
|
|
|
|
2022-02-02 14:56:16 +00:00
|
|
|
- name: Download assets (trunk)
|
2022-03-23 07:41:43 +00:00
|
|
|
uses: actions/download-artifact@v3
|
2022-02-02 14:56:16 +00:00
|
|
|
with:
|
|
|
|
name: assets-list
|
|
|
|
path: assets-list
|
|
|
|
- name: Compare Assets
|
|
|
|
uses: ./.github/compare-assets
|
2022-12-21 15:24:01 +00:00
|
|
|
id: compare-assets
|
2022-02-02 14:56:16 +00:00
|
|
|
with:
|
|
|
|
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
|
|
|
compare: assets-list/assets.json
|
2022-12-21 15:24:01 +00:00
|
|
|
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}}
|