File tree Expand file tree Collapse file tree 2 files changed +37
-2
lines changed
Expand file tree Collapse file tree 2 files changed +37
-2
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ github:
4545 - Unit Test
4646 - E2E
4747 - Docs
48+ - Frontend Build
4849 - " Mergeable: milestone-label-check"
4950 required_pull_request_reviews :
5051 dismiss_stale_reviews : true
Original file line number Diff line number Diff line change @@ -38,10 +38,25 @@ concurrency:
3838 cancel-in-progress : true
3939
4040jobs :
41+ paths-filter :
42+ name : Frontend-Path-Filter
43+ runs-on : ubuntu-latest
44+ outputs :
45+ not-ignore : ${{ steps.filter.outputs.not-ignore }}
46+ steps :
47+ - uses : actions/checkout@v2
48+ - uses : dorny/paths-filter@b2feaf19c27470162a626bd6fa8438ae5b263721
49+ id : filter
50+ with :
51+ filters : |
52+ not-ignore:
53+ - '!(docs/**)'
4154 build :
4255 name : Build
56+ needs : paths-filter
57+ if : ${{ (needs.paths-filter.outputs.not-ignore == 'true') || (github.event_name == 'push') }}
4358 runs-on : ${{ matrix.os }}
44- timeout-minutes : 20
59+ timeout-minutes : 30
4560 strategy :
4661 matrix :
4762 os : [ ubuntu-latest, macos-latest ]
5671 uses : actions/setup-node@v2
5772 with :
5873 node-version : 16
59- - name : Compile and Build
74+ - name : Compile and Build on ${{ matrix.os }}
6075 run : |
76+ set -x
6177 npm install pnpm@7 -g
6278 pnpm install
6379 pnpm run lint
6480 pnpm run build:prod
81+ result :
82+ name : Frontend Build
83+ runs-on : ubuntu-latest
84+ timeout-minutes : 30
85+ needs : [ build, paths-filter ]
86+ if : always()
87+ steps :
88+ - uses : actions/checkout@v2
89+ - name : Status
90+ run : |
91+ if [[ ${{ needs.paths-filter.outputs.not-ignore }} == 'false' && ${{ github.event_name }} == 'pull_request' ]]; then
92+ echo "Skip Frontend Build!"
93+ exit 0
94+ fi
95+ if [[ ${{ needs.build.result }} != 'success' ]]; then
96+ echo "Frontend Build Failed!"
97+ exit -1
98+ fi
You can’t perform that action at this time.
0 commit comments