-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (105 loc) · 2.74 KB
/
Copy pathci.yml
File metadata and controls
111 lines (105 loc) · 2.74 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
test-server:
runs-on: ubuntu-latest
timeout-minutes: 20
env:
CI: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24.3.0
cache: npm
cache-dependency-path: server/package-lock.json
- name: Match npm version (11.4.2) & verify
run: |
npm install -g npm@11.4.2
node -v
npm -v
- name: Install, lint, test, build
working-directory: server
run: |
npm ci
npm run lint
npm test
npm run build
- name: Upload server build
uses: actions/upload-artifact@v4
with:
name: server-build
path: server/dist
test-mobile:
runs-on: ubuntu-latest
timeout-minutes: 40
env:
CI: true
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: 3.35.3
channel: stable
cache: true
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
cache: gradle
- uses: android-actions/setup-android@v3
- run: flutter --version
- working-directory: mobile
run: |
flutter pub get
flutter analyze
flutter test
flutter build apk --release
- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: app-release-apk
path: mobile/build/app/outputs/flutter-apk/app-release.apk
test-integration:
runs-on: ubuntu-latest
needs: [test-server, test-mobile]
timeout-minutes: 20
env:
CI: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24.3.0
cache: npm
cache-dependency-path: server/package-lock.json
- name: Match npm version (11.4.2) & verify
run: |
npm install -g npm@11.4.2
node -v
npm -v
- name: Install & start server
working-directory: server
run: |
npm ci
npm run build
nohup npm start &
sleep 5
- name: Run integration tests (API endpoints) with retry
run: |
for i in {1..10}; do
if curl -fsS http://localhost:3000/health; then break; fi
sleep 2
done
curl -fsS -X POST http://localhost:3000/api/clean \
-H "Content-Type: application/json" \
-d '{"url":"https://example.co