-
Notifications
You must be signed in to change notification settings - Fork 2
81 lines (66 loc) · 2.28 KB
/
flutter_checks.yml
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
name: Flutter checks
on:
pull_request:
branches:
- main
jobs:
build-and-test-packages:
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: true # Ensures that all matrix jobs are canceled if one fails
matrix:
package-path:
- packages/rum_sdk
- packages/offline_transport
include:
- name: rum_sdk
package-path: packages/rum_sdk
- name: offline_transport
package-path: packages/offline_transport
name: build & test ${{ matrix.name }} # Custom name for each matrix run
steps:
- uses: actions/checkout@v3
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Flutter version check
run: flutter --version
- name: Install dependencies
working-directory: ${{ matrix.package-path }}
run: flutter pub get
- name: Create api-config file (only for rum_sdk)
if: ${{ matrix.package-path == 'packages/rum_sdk' }}
working-directory: ${{ matrix.package-path }}
run: scripts/create-api-config-file.sh
- name: Check format
run: dart format --set-exit-if-changed .
- name: Analyze code
working-directory: ${{ matrix.package-path }}
run: flutter analyze
- name: Run tests
working-directory: ${{ matrix.package-path }}
run: flutter test --reporter failures-only
build-example-app:
runs-on: ubuntu-latest
needs: build-and-test-packages # Ensures packages are built before the example app
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Install dependencies
working-directory: packages/rum_sdk/example
run: flutter pub get
- name: Create api-config file (only for rum_sdk)
working-directory: packages/rum_sdk
run: scripts/create-api-config-file.sh
- name: Analyze code
working-directory: packages/rum_sdk/example
run: flutter analyze
- name: Build example app
working-directory: packages/rum_sdk/example
run: flutter build apk # Replace 'apk' with 'ios', 'web', etc., as needed