Skip to content

Commit

Permalink
ci: add build check
Browse files Browse the repository at this point in the history
  • Loading branch information
MuZhou233 committed Feb 2, 2024
1 parent 0f14946 commit 06172f1
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 30 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: build

on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main

jobs:
format-check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: 'stable'

- name: Check
run: |
flutter pub get
dart fix
dart format .
git diff --exit-code
if [ $? -eq 0 ]; then
echo "No formatting changes detected"
else
echo "Formatting changes detected. Run `make format` to fix it."
exit 1
fi
build-windows:
runs-on: windows-latest
needs: format-check
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: 'stable'

- name: Build
run: |
flutter config --enable-windows-desktop
flutter build windows
build-web:
runs-on: ubuntu-latest
needs: format-check
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: 'stable'

- name: Build
run: |
flutter pub get
flutter build web
build-android:
runs-on: ubuntu-latest
needs: format-check
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
- uses: subosito/flutter-action@v2
with:
channel: 'stable'

- name: Build
run: |
flutter pub get
flutter build apk
30 changes: 0 additions & 30 deletions .github/workflows/pr-check.yaml

This file was deleted.

0 comments on commit 06172f1

Please sign in to comment.