-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (51 loc) 路 1.55 KB
/
Copy pathdevelop-analysis.yml
File metadata and controls
64 lines (51 loc) 路 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Develop PR Analysis Workflow
on:
pull_request:
branches: [develop]
paths-ignore:
- '**/*.md'
- 'docs/**'
workflow_dispatch:
env:
FLUTTER_VERSION: '3.41.0'
jobs:
analyze:
name: Code Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: 'stable'
cache: true
- name: Get dependencies
run: flutter pub get
- name: Create .env file
run: |
if [ -z "${{ secrets.API_URL }}" ]; then
echo "WARNING: GitHub secret API_URL is not set. Using fallback value."
echo "API_URL=http://127.0.0.1:8000/" > .env
else
echo "API_URL=${{ secrets.API_URL }}" > .env
fi
- name: Verify formatting
run: git ls-files '*.dart' | xargs dart format --output=none --set-exit-if-changed
- name: Run build_runner
run: dart run build_runner build --delete-conflicting-outputs
- name: Format generated code
run: dart format lib/ test/
- name: Analyze code
run: flutter analyze --fatal-infos
- name: Run tests
run: flutter test --coverage
- name: Upload coverage to artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: code-coverage
path: coverage/lcov.info
if-no-files-found: ignore
retention-days: 7