Skip to content

Commit

Permalink
[CI] Frontend ci require passed before merge (#15735)
Browse files Browse the repository at this point in the history
* frontend ci require passed before merge
  • Loading branch information
SbloodyS committed Mar 19, 2024
1 parent 4a255fd commit 1440045
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
1 change: 1 addition & 0 deletions .asf.yaml
Expand Up @@ -45,6 +45,7 @@ github:
- Unit Test
- E2E
- Docs
- Frontend Build
- "Mergeable: milestone-label-check"
required_pull_request_reviews:
dismiss_stale_reviews: true
Expand Down
38 changes: 36 additions & 2 deletions .github/workflows/frontend.yml
Expand Up @@ -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 ]
Expand All @@ -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

0 comments on commit 1440045

Please sign in to comment.