Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Frontend ci require passed before merge #15735

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .asf.yaml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading