-
Notifications
You must be signed in to change notification settings - Fork 118
84 lines (72 loc) · 2.29 KB
/
analyze-test.yaml
File metadata and controls
84 lines (72 loc) · 2.29 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
on:
pull_request:
paths-ignore:
- ".github/**"
- "docs"
- "Jenkinsfile"
- "**/*.md"
name: Analyze and test
env:
FLUTTER_VERSION: 3.32.8
jobs:
analyze-test:
runs-on: ubuntu-latest
strategy:
matrix:
modules:
- default
- core
- model
- contact
- forward
- rule_filter
- fcm
- email_recovery
- server_settings
fail-fast: false
steps:
# 🔄 Checkout repository
- name: Checkout repository
uses: actions/checkout@v4
# 🧰 Setup SSH (required for private git@ dependencies)
- name: Set up SSH for private Git dependencies
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.SSH_KEY }}
# ⚙️ Add GitHub to known hosts (avoid "Host key verification failed")
- name: Add GitHub to known hosts
run: |
mkdir -p ~/.ssh
ssh-keyscan github.com >> ~/.ssh/known_hosts
# 🚀 Setup Flutter SDK
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: "stable"
cache: true
cache-key: "deps-${{ hashFiles('**/pubspec.lock') }}"
cache-path: ${{ runner.tool_cache }}/flutter # optional, change this to specify the cache path
# 🔥 Setup Firebase environment (if required by tests)
- name: Setup Firebase env
env:
FIREBASE_ENV: ${{ secrets.FIREBASE_ENV }}
run: ./scripts/setup-firebase.sh
# 🧱 Prebuild step (runs flutter pub get + build_runner + intl generation)
- name: Run prebuild
run: ./scripts/prebuild.sh
# 🧩 Run Flutter static analysis
- name: Analyze Dart code
uses: zgosalvez/github-actions-analyze-dart@v1
# 🧪 Run tests for each module in matrix
- name: Run tests
env:
MODULES: ${{ matrix.modules }}
run: ./scripts/test.sh
# 📤 Upload test reports (always, even on failure)
- name: Upload test reports
if: success() || failure() # Always upload report
uses: actions/upload-artifact@v4
with:
name: test-reports-${{ matrix.modules }}
path: test-report*.json