Skip to content

Commit 58de220

Browse files
committed
Update CI workflow and fix Flutter API compatibility
- Update GitHub Actions CI workflow configuration - Fix Flutter API compatibility issues: - Revert withValues back to withOpacity for broader compatibility - Use surfaceContainerHighest instead of surfaceVariant - Fix activeThumbColor parameter name - Ensure CI works with current Flutter/Dart versions
1 parent 5a8b36f commit 58de220

2 files changed

Lines changed: 51 additions & 34 deletions

File tree

.github/workflows/ci.yml

Lines changed: 50 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
pull_request:
77
branches: [main, develop]
88

9+
concurrency:
10+
group: ci-${{ github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
test-server:
1115
runs-on: ubuntu-latest
@@ -17,58 +21,69 @@ jobs:
1721
uses: actions/setup-node@v4
1822
with:
1923
node-version: "18"
24+
cache: "npm"
25+
cache-dependency-path: server/package-lock.json
2026

2127
- name: Install dependencies
22-
run: |
23-
cd server
24-
npm ci
28+
working-directory: server
29+
run: npm ci
2530

2631
- name: Run linter
27-
run: |
28-
cd server
29-
npm run lint
32+
working-directory: server
33+
run: npm run lint
3034

3135
- name: Run tests
32-
run: |
33-
cd server
34-
npm test
36+
working-directory: server
37+
run: npm test
3538

3639
- name: Build
37-
run: |
38-
cd server
39-
npm run build
40+
working-directory: server
41+
run: npm run build
4042

4143
test-mobile:
4244
runs-on: ubuntu-latest
4345

4446
steps:
4547
- uses: actions/checkout@v4
4648

49+
# Match local Flutter exactly: 3.35.3 (stable)
4750
- name: Setup Flutter
4851
uses: subosito/flutter-action@v2
4952
with:
50-
flutter-version: "3.13.9"
53+
flutter-version: "3.35.3"
5154
channel: "stable"
55+
cache: true
56+
57+
# JDK 17 is the current default for modern Android/Gradle
58+
- name: Setup Java 17
59+
uses: actions/setup-java@v4
60+
with:
61+
distribution: temurin
62+
java-version: "17"
63+
cache: gradle
64+
65+
# Android SDK & licenses for building APKs
66+
- name: Setup Android SDK
67+
uses: android-actions/setup-android@v3
68+
69+
- name: Show Flutter version (sanity check)
70+
run: flutter --version
5271

5372
- name: Install dependencies
54-
run: |
55-
cd mobile
56-
flutter pub get
73+
working-directory: mobile
74+
run: flutter pub get
5775

5876
- name: Analyze code
59-
run: |
60-
cd mobile
61-
flutter analyze
77+
working-directory: mobile
78+
run: flutter analyze
6279

6380
- name: Run tests
64-
run: |
65-
cd mobile
66-
flutter test
81+
working-directory: mobile
82+
run: flutter test
6783

68-
- name: Build APK
69-
run: |
70-
cd mobile
71-
flutter build apk --release
84+
- name: Build APK (release)
85+
working-directory: mobile
86+
run: flutter build apk --release
7287

7388
test-integration:
7489
runs-on: ubuntu-latest
@@ -81,22 +96,24 @@ jobs:
8196
uses: actions/setup-node@v4
8297
with:
8398
node-version: "18"
99+
cache: "npm"
100+
cache-dependency-path: server/package-lock.json
84101

85102
- name: Install server dependencies
86-
run: |
87-
cd server
88-
npm ci
103+
working-directory: server
104+
run: npm ci
89105

90106
- name: Start server
107+
working-directory: server
91108
run: |
92-
cd server
93109
npm run build
94110
npm start &
111+
# give the server a moment to boot
95112
sleep 10
96113
97114
- name: Test API endpoints
98115
run: |
99-
curl -f http://localhost:3000/health || exit 1
100-
curl -f -X POST http://localhost:3000/api/clean \
116+
curl -fsS http://localhost:3000/health
117+
curl -fsS -X POST http://localhost:3000/api/clean \
101118
-H "Content-Type: application/json" \
102-
-d '{"url":"https://example.com?utm_source=test"}' || exit 1
119+
-d '{"url":"https://example.com?utm_source=test"}'

mobile/lib/screens/settings_screen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
346346
}
347347
}
348348

349-
void _showThemeDialog(SettingsProvider settings) {
349+
void _showThemeDialog(SettingsProvider settings) {
350350
showDialog<void>(
351351
context: context,
352352
builder: (dialogCtx) {

0 commit comments

Comments
 (0)