[Improve]: add format check and code gen check #19
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: check-pr | |
on: | |
pull_request: | |
jobs: | |
pre-check: | |
runs-on: ubuntu-latest | |
outputs: | |
src: ${{ steps.filter.outputs.src }} | |
steps: | |
- uses: dorny/paths-filter@v3 | |
id: filter | |
with: | |
filters: | | |
src: | |
- "**.dart" | |
check: | |
needs: pre-check | |
if: ${{ needs.pre-check.outputs.src == 'true' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Application Runtime | |
uses: ./.github/actions/setup-application-runtime | |
# https://github.com/invertase/github-action-dart-analyzer | |
- name: Report analyze | |
uses: invertase/github-action-dart-analyzer@v3 | |
with: | |
fatal-infos: true | |
- name: Check format | |
run: dart format --set-exit-if-changed . | |
- name: re-generated code | |
run: dart pub run build_runner build -d | |
- name: check difference | |
run: | | |
git add -N . | |
git diff --name-only --exit-code |