2023-03-15 10:51:14 +08:00
|
|
|
# Build a cron job to create a umi project which use antd and dumi, and then build it.
|
|
|
|
name: Mock Project Build
|
|
|
|
|
|
|
|
on:
|
2023-03-15 23:04:47 +08:00
|
|
|
workflow_dispatch:
|
2023-03-15 10:51:14 +08:00
|
|
|
schedule:
|
2023-03-15 23:04:47 +08:00
|
|
|
- cron: '*/30 * * * *'
|
2023-03-15 10:51:14 +08:00
|
|
|
|
2023-03-21 14:18:43 +08:00
|
|
|
# Cancel prev CI if new commit come
|
|
|
|
concurrency:
|
|
|
|
group: unique
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2023-03-15 10:51:14 +08:00
|
|
|
jobs:
|
|
|
|
pr-check-ci:
|
2023-04-25 11:17:51 +08:00
|
|
|
if: github.repository == 'ant-design/ant-design'
|
2023-03-15 10:51:14 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: Build Project
|
|
|
|
steps:
|
2023-03-15 23:04:47 +08:00
|
|
|
- name: checkout
|
2023-09-05 11:55:52 +08:00
|
|
|
uses: actions/checkout@v4
|
2023-03-15 23:04:47 +08:00
|
|
|
|
2024-02-01 19:06:10 +08:00
|
|
|
- uses: actions/setup-node@v4
|
2023-03-15 10:51:14 +08:00
|
|
|
with:
|
2023-09-13 22:46:23 +08:00
|
|
|
node-version: 18
|
2023-03-15 23:04:47 +08:00
|
|
|
|
2024-02-01 18:20:41 +08:00
|
|
|
- uses: actions/cache@v4
|
2023-03-21 14:18:43 +08:00
|
|
|
with:
|
|
|
|
path: ~tmpProj/yarn.lock
|
|
|
|
key: primes-${{ runner.os }}-${{ github.run_id }}
|
|
|
|
restore-keys: mock-proj-lock-file
|
|
|
|
|
2023-03-15 10:51:14 +08:00
|
|
|
- name: Run Script
|
|
|
|
run: bash ./scripts/ci-mock-project-build.sh
|
2023-03-15 23:04:47 +08:00
|
|
|
|
2023-03-21 14:18:43 +08:00
|
|
|
##################################################################
|
|
|
|
## 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() }}
|
2024-02-01 19:05:33 +08:00
|
|
|
uses: actions/cache/restore@v4
|
2023-03-21 14:18:43 +08:00
|
|
|
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
|
|
|
|
|
2023-03-15 23:04:47 +08:00
|
|
|
- uses: actions-cool/ci-notice@v1
|
|
|
|
if: ${{ failure() }}
|
|
|
|
with:
|
|
|
|
notice-types: 'dingding'
|
2024-05-14 14:48:08 +08:00
|
|
|
# Exit directly with non-zero to trigger the failure logic of ci-notice.
|
|
|
|
ci: |
|
|
|
|
echo "❌ CI Mock Project Build Failed"
|
|
|
|
exit 1
|
2023-03-15 23:04:47 +08:00
|
|
|
dingding-token: ${{ secrets.DINGDING_BOT_COLLABORATOR_TOKEN }}
|
|
|
|
notice-title: 'CI Mock Project Build Failed'
|