2023-01-26 14:40:19 +00:00
|
|
|
name: Static Code Analysis
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches: [main]
|
|
|
|
|
2023-02-19 16:44:53 +00:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2023-01-26 14:40:19 +00:00
|
|
|
jobs:
|
2024-09-03 12:23:39 +00:00
|
|
|
pre-job:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
should_run: ${{ steps.found_paths.outputs.mobile == 'true' || steps.should_force.outputs.should_force == 'true' }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
- id: found_paths
|
|
|
|
uses: dorny/paths-filter@v3
|
|
|
|
with:
|
|
|
|
filters: |
|
|
|
|
mobile:
|
|
|
|
- 'mobile/**'
|
|
|
|
- name: Check if we should force jobs to run
|
|
|
|
id: should_force
|
|
|
|
run: echo "should_force=${{ github.event_name == 'release' }}" >> "$GITHUB_OUTPUT"
|
|
|
|
|
2023-01-26 14:40:19 +00:00
|
|
|
mobile-dart-analyze:
|
|
|
|
name: Run Dart Code Analysis
|
2024-09-03 12:23:39 +00:00
|
|
|
needs: pre-job
|
|
|
|
if: ${{ needs.pre-job.outputs.should_run == 'true' }}
|
2023-01-26 14:40:19 +00:00
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
2023-09-06 01:50:22 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-01-26 14:40:19 +00:00
|
|
|
|
|
|
|
- name: Setup Flutter SDK
|
|
|
|
uses: subosito/flutter-action@v2
|
|
|
|
with:
|
2024-05-16 15:58:02 +00:00
|
|
|
channel: 'stable'
|
2024-05-28 11:15:28 +00:00
|
|
|
flutter-version-file: ./mobile/pubspec.yaml
|
2023-01-26 14:40:19 +00:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: dart pub get
|
|
|
|
working-directory: ./mobile
|
|
|
|
|
|
|
|
- name: Run dart analyze
|
|
|
|
run: dart analyze --fatal-infos
|
|
|
|
working-directory: ./mobile
|
2024-02-19 04:30:24 +00:00
|
|
|
|
|
|
|
- name: Run dart format
|
|
|
|
run: dart format lib/ --set-exit-if-changed
|
|
|
|
working-directory: ./mobile
|
|
|
|
|
2023-11-19 16:04:44 +00:00
|
|
|
# Enable after riverpod generator migration is completed
|
|
|
|
# - name: Run dart custom lint
|
|
|
|
# run: dart run custom_lint
|
|
|
|
# working-directory: ./mobile
|