|
|
|
@ -38,10 +38,25 @@ concurrency:
|
|
|
|
|
cancel-in-progress: true |
|
|
|
|
|
|
|
|
|
jobs: |
|
|
|
|
paths-filter: |
|
|
|
|
name: Frontend-Path-Filter |
|
|
|
|
runs-on: ubuntu-latest |
|
|
|
|
outputs: |
|
|
|
|
not-ignore: ${{ steps.filter.outputs.not-ignore }} |
|
|
|
|
steps: |
|
|
|
|
- uses: actions/checkout@v2 |
|
|
|
|
- uses: dorny/paths-filter@b2feaf19c27470162a626bd6fa8438ae5b263721 |
|
|
|
|
id: filter |
|
|
|
|
with: |
|
|
|
|
filters: | |
|
|
|
|
not-ignore: |
|
|
|
|
- '!(docs/**)' |
|
|
|
|
build: |
|
|
|
|
name: Build |
|
|
|
|
needs: paths-filter |
|
|
|
|
if: ${{ (needs.paths-filter.outputs.not-ignore == 'true') || (github.event_name == 'push') }} |
|
|
|
|
runs-on: ${{ matrix.os }} |
|
|
|
|
timeout-minutes: 20 |
|
|
|
|
timeout-minutes: 30 |
|
|
|
|
strategy: |
|
|
|
|
matrix: |
|
|
|
|
os: [ ubuntu-latest, macos-latest ] |
|
|
|
@ -56,9 +71,28 @@ jobs:
|
|
|
|
|
uses: actions/setup-node@v2 |
|
|
|
|
with: |
|
|
|
|
node-version: 16 |
|
|
|
|
- name: Compile and Build |
|
|
|
|
- name: Compile and Build on ${{ matrix.os }} |
|
|
|
|
run: | |
|
|
|
|
set -x |
|
|
|
|
npm install pnpm@7 -g |
|
|
|
|
pnpm install |
|
|
|
|
pnpm run lint |
|
|
|
|
pnpm run build:prod |
|
|
|
|
result: |
|
|
|
|
name: Frontend Build |
|
|
|
|
runs-on: ubuntu-latest |
|
|
|
|
timeout-minutes: 30 |
|
|
|
|
needs: [ build, paths-filter ] |
|
|
|
|
if: always() |
|
|
|
|
steps: |
|
|
|
|
- uses: actions/checkout@v2 |
|
|
|
|
- name: Status |
|
|
|
|
run: | |
|
|
|
|
if [[ ${{ needs.paths-filter.outputs.not-ignore }} == 'false' && ${{ github.event_name }} == 'pull_request' ]]; then |
|
|
|
|
echo "Skip Frontend Build!" |
|
|
|
|
exit 0 |
|
|
|
|
fi |
|
|
|
|
if [[ ${{ needs.build.result }} != 'success' ]]; then |
|
|
|
|
echo "Frontend Build Failed!" |
|
|
|
|
exit -1 |
|
|
|
|
fi |
|
|
|
|