|
|
|
@ -6,6 +6,11 @@ on:
|
|
|
|
|
schedule:
|
|
|
|
|
- cron: '*/30 * * * *'
|
|
|
|
|
|
|
|
|
|
# Cancel prev CI if new commit come
|
|
|
|
|
concurrency:
|
|
|
|
|
group: unique
|
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
pr-check-ci:
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
@ -18,9 +23,38 @@ jobs:
|
|
|
|
|
with:
|
|
|
|
|
node-version: 16
|
|
|
|
|
|
|
|
|
|
- uses: actions/cache@v3
|
|
|
|
|
with:
|
|
|
|
|
path: ~tmpProj/yarn.lock
|
|
|
|
|
key: primes-${{ runner.os }}-${{ github.run_id }}
|
|
|
|
|
restore-keys: mock-proj-lock-file
|
|
|
|
|
|
|
|
|
|
- name: Run Script
|
|
|
|
|
run: bash ./scripts/ci-mock-project-build.sh
|
|
|
|
|
|
|
|
|
|
##################################################################
|
|
|
|
|
## Diff Lock File ##
|
|
|
|
|
##################################################################
|
|
|
|
|
- name: Rename failed lock file
|
|
|
|
|
if: ${{ failure() }}
|
|
|
|
|
run: mv ~tmpProj/yarn.lock ~tmpProj/yarn.lock.failed
|
|
|
|
|
|
|
|
|
|
- name: Download success lock file as `success.lock`
|
|
|
|
|
if: ${{ failure() }}
|
|
|
|
|
uses: actions/cache/restore@v3
|
|
|
|
|
with:
|
|
|
|
|
path: ~tmpProj/yarn.lock
|
|
|
|
|
key: primes-${{ runner.os }}-${{ github.run_id }}
|
|
|
|
|
restore-keys: mock-proj-lock-file
|
|
|
|
|
|
|
|
|
|
- name: ls tmpProj
|
|
|
|
|
if: ${{ failure() }}
|
|
|
|
|
run: ls ~tmpProj
|
|
|
|
|
|
|
|
|
|
- name: 🎨 Diff Report
|
|
|
|
|
if: ${{ failure() }}
|
|
|
|
|
run: npx diff-yarn-lock --source=~tmpProj/yarn.lock --target=~tmpProj/yarn.lock.failed
|
|
|
|
|
|
|
|
|
|
- uses: actions-cool/ci-notice@v1
|
|
|
|
|
if: ${{ failure() }}
|
|
|
|
|
with:
|
|
|
|
|