From eaa08a39fc402e95ade47982b760ed66f1b3f343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E7=88=B1=E5=90=83=E7=99=BD=E8=90=9D?= =?UTF-8?q?=E5=8D=9C?= Date: Tue, 21 Mar 2023 14:18:43 +0800 Subject: [PATCH] chore: add diff report (#41354) * chore: add diff report * chore: more --- .github/workflows/mock-project-build.yml | 34 ++++++++++++++++++++++++ scripts/ci-mock-project-build.sh | 6 +++-- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/.github/workflows/mock-project-build.yml b/.github/workflows/mock-project-build.yml index 9719f183f7..527f5362ba 100644 --- a/.github/workflows/mock-project-build.yml +++ b/.github/workflows/mock-project-build.yml @@ -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: diff --git a/scripts/ci-mock-project-build.sh b/scripts/ci-mock-project-build.sh index 0e5ff0cdce..6302a77c8f 100644 --- a/scripts/ci-mock-project-build.sh +++ b/scripts/ci-mock-project-build.sh @@ -6,9 +6,11 @@ rm -rf ~tmpProj/ # clone project git clone https://github.com/ant-design/create-next-app-antd.git ~tmpProj --depth=1 -# install +# change directory cd ~tmpProj + +# install dependencies yarn # build -yarn run build \ No newline at end of file +yarn run build