2022-02-02 14:56:16 +00:00
|
|
|
name: Check Modified Assets
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-trunk:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
ref: trunk
|
|
|
|
- name: Cache node modules
|
|
|
|
uses: actions/cache@v2
|
|
|
|
env:
|
|
|
|
cache-name: cache-node-modules
|
|
|
|
with:
|
|
|
|
# npm cache files are stored in `~/.npm` on Linux/macOS
|
|
|
|
path: ~/.npm
|
|
|
|
key: ${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-
|
|
|
|
${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-
|
2022-03-10 10:00:23 +00:00
|
|
|
- name: Use Node.js 16.13.2
|
2022-02-02 14:56:16 +00:00
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
2022-03-10 10:00:23 +00:00
|
|
|
node-version: 16.13.2
|
2022-02-02 14:56:16 +00:00
|
|
|
- name: npm install and build
|
|
|
|
run: |
|
|
|
|
npm ci
|
|
|
|
npm run build:check-assets
|
|
|
|
- name: Upload Artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: assets-list
|
|
|
|
path: ./build/assets.json
|
|
|
|
|
|
|
|
compare-assets-with-trunk:
|
|
|
|
needs: [build-trunk]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Cache node modules
|
|
|
|
uses: actions/cache@v2
|
|
|
|
env:
|
|
|
|
cache-name: cache-node-modules
|
|
|
|
with:
|
|
|
|
# npm cache files are stored in `~/.npm` on Linux/macOS
|
|
|
|
path: ~/.npm
|
|
|
|
key: ${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-
|
|
|
|
${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-
|
2022-03-10 10:00:23 +00:00
|
|
|
- name: Use Node.js 16.13.2
|
2022-02-02 14:56:16 +00:00
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
2022-03-10 10:00:23 +00:00
|
|
|
node-version: 16.13.2
|
2022-02-02 14:56:16 +00:00
|
|
|
- name: npm install
|
|
|
|
run: |
|
|
|
|
npm ci
|
|
|
|
npm run build:check-assets
|
|
|
|
- name: Download assets (trunk)
|
|
|
|
uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: assets-list
|
|
|
|
path: assets-list
|
|
|
|
- name: Compare Assets
|
|
|
|
uses: ./.github/compare-assets
|
|
|
|
with:
|
|
|
|
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
|
|
|
compare: assets-list/assets.json
|