forked from submersion-app/submersion
-
Notifications
You must be signed in to change notification settings - Fork 0
177 lines (147 loc) · 5.27 KB
/
Copy pathnative-plugin-tests.yml
File metadata and controls
177 lines (147 loc) · 5.27 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# Native Plugin Build Verification
#
# Validates that the libdivecomputer_plugin builds on all platforms
# and that C wrapper unit tests pass.
name: Native Plugin Tests
on:
push:
paths:
- 'packages/libdivecomputer_plugin/**'
- '.github/workflows/native-plugin-tests.yml'
pull_request:
paths:
- 'packages/libdivecomputer_plugin/**'
- '.github/workflows/native-plugin-tests.yml'
permissions:
contents: read
concurrency:
group: native-plugin-${{ github.ref }}
cancel-in-progress: true
env:
FLUTTER_VERSION_FILE: '.github/flutter-version.txt'
jobs:
# ==========================================================================
# C Wrapper Unit Tests (platform-independent)
# ==========================================================================
c-wrapper-tests:
name: C Wrapper Tests
runs-on: macos-latest
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
- name: Build and run C wrapper tests
run: |
cd packages/libdivecomputer_plugin
cmake -B build/test test/native
cmake --build build/test
ctest --test-dir build/test --output-on-failure
# ==========================================================================
# Darwin Swift Unit Tests (PacketReadBuffer, BleCharacteristicSelector)
# ==========================================================================
darwin-swift-tests:
name: Darwin Swift Tests
runs-on: macos-latest
steps:
- uses: actions/checkout@v7
- name: Run Darwin native Swift tests
run: bash packages/libdivecomputer_plugin/darwin/run_native_tests.sh
# ==========================================================================
# macOS Build
# ==========================================================================
build-macos:
name: Build macOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
- name: Read Flutter version
id: flutter-version
run: echo "version=$(cat $FLUTTER_VERSION_FILE)" >> "$GITHUB_OUTPUT"
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ steps.flutter-version.outputs.version }}
- name: Run code generation
run: dart run build_runner build --delete-conflicting-outputs
- name: Build macOS debug (no codesign)
run: |
flutter build macos --config-only --debug
xcodebuild build \
-workspace macos/Runner.xcworkspace \
-scheme Runner \
-configuration Debug \
CODE_SIGNING_ALLOWED=NO
# ==========================================================================
# iOS Build
# ==========================================================================
build-ios:
name: Build iOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
- name: Read Flutter version
id: flutter-version
run: echo "version=$(cat $FLUTTER_VERSION_FILE)" >> "$GITHUB_OUTPUT"
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ steps.flutter-version.outputs.version }}
- name: Run code generation
run: dart run build_runner build --delete-conflicting-outputs
- name: Build iOS simulator debug
run: flutter build ios --simulator --debug --no-codesign
# ==========================================================================
# Windows Build
# ==========================================================================
build-windows:
name: Build Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
- name: Read Flutter version
id: flutter-version
shell: bash
run: echo "version=$(cat $FLUTTER_VERSION_FILE)" >> "$GITHUB_OUTPUT"
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ steps.flutter-version.outputs.version }}
- name: Run code generation
run: dart run build_runner build --delete-conflicting-outputs
- name: Build Windows debug
run: flutter build windows --debug
# ==========================================================================
# Linux Build
# ==========================================================================
build-linux:
name: Build Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
- name: Read Flutter version
id: flutter-version
run: echo "version=$(cat $FLUTTER_VERSION_FILE)" >> "$GITHUB_OUTPUT"
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ steps.flutter-version.outputs.version }}
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
clang \
cmake \
ninja-build \
pkg-config \
libgtk-3-dev \
libglib2.0-dev \
libdbus-1-dev \
libsecret-1-dev
- name: Run code generation
run: dart run build_runner build --delete-conflicting-outputs
- name: Build Linux debug
run: flutter build linux --debug