forked from ant-design/ant-design
-
Notifications
You must be signed in to change notification settings - Fork 2
64 lines (53 loc) · 1.87 KB
/
mock-project-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Build a cron job to create a umi project which use antd and dumi, and then build it.
name: Mock Project Build
on:
workflow_dispatch:
schedule:
- cron: '*/30 * * * *'
# Cancel prev CI if new commit come
concurrency:
group: unique
cancel-in-progress: true
jobs:
pr-check-ci:
if: github.repository == 'ant-design/ant-design'
runs-on: ubuntu-latest
name: Build Project
steps:
- name: checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
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:
notice-types: 'dingding'
dingding-token: ${{ secrets.DINGDING_BOT_COLLABORATOR_TOKEN }}
notice-title: 'CI Mock Project Build Failed'