This repository has been archived by the owner on Jul 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
185 lines (177 loc) · 5.5 KB
/
test-package.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
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
178
179
180
181
182
183
184
185
name: CI
on:
# Run on PRs and pushes to the default branch.
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: "0 0 * * 0"
env:
PUB_ENVIRONMENT: bot.github
RUST_BACKTRACE: 1 # Run all tests with full Rust stack tracing.
jobs:
analyze:
runs-on: ubuntu-latest
strategy:
matrix:
sdk: [ dev ]
defaults:
run:
working-directory: wasm
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f
with:
sdk: ${{ matrix.sdk }}
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
with:
path: |
~/.pub-cache/hosted/
.dart_tool/
key: ${{ runner.os }}-${{ matrix.sdk }}
- id: install
run: dart pub upgrade
- run: dart format --output=none --set-exit-if-changed .
if: always() && steps.install.outcome == 'success'
- run: dart analyze --fatal-infos
if: always() && steps.install.outcome == 'success'
- name: validate boilerplate generation
if: always() && steps.install.outcome == 'success'
run: |
./tool/generate_ffi_boilerplate.py
dart format -owrite .
export DIFF_OUTPUT="$(git diff)"
if [[ $DIFF_OUTPUT ]]; then
echo "::error::Build needs to be re-run!"
echo "::group::git diff"
echo "$DIFF_OUTPUT"
echo "::endgroup::"
exit 1
else
echo "Build output is all good!"
fi
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]
sdk: [ 2.18.5, dev ]
defaults:
run:
working-directory: wasm
steps:
- uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f
with:
sdk: ${{ matrix.sdk }}
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.pub-cache/hosted/
.dart_tool/
key: ${{ runner.os }}-${{ matrix.sdk }}
- run: dart pub upgrade
- run: dart run wasm:setup
- run: dart test -j 1
coverage:
runs-on: ubuntu-latest
defaults:
run:
working-directory: wasm
steps:
- uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f
with:
sdk: dev
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.pub-cache/hosted/
.dart_tool/
key: ubuntu-latest-dev
- name: Install dependencies
run: dart pub get
- name: Setup wasm
run: dart run wasm:setup
- name: Install coverage
run: dart pub global activate coverage
- name: Collect and report coverage
run: dart pub global run coverage:test_with_coverage
- name: Upload coverage
uses: coverallsapp/github-action@c7885c00cb7ec0b8f9f5ff3f53cddb980f7a4412
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: wasm/coverage/lcov.info
flutter_analyze:
runs-on: ubuntu-latest
defaults:
run:
working-directory: flutter_wasm
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- uses: actions/setup-java@v1
with:
java-version: '12.x'
- uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa
with:
flutter-version: '3.3.9'
- id: install
run: |
flutter pub upgrade
flutter pub upgrade --directory example
- run: flutter format --output=none --set-exit-if-changed .
if: always() && steps.install.outcome == 'success'
- run: flutter analyze --fatal-infos
if: always() && steps.install.outcome == 'success'
flutter_test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: flutter_wasm
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- uses: actions/setup-java@v1
with:
java-version: '12.x'
- uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa
with:
flutter-version: '3.3.9'
- run: flutter pub upgrade
- run: flutter pub run flutter_wasm:setup
- run: flutter test
flutter_example_test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: flutter_wasm/example
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- uses: actions/setup-java@de1bb2b0c5634f0fc4438d7aa9944e68f9bf86cc
with:
java-version: 11
distribution: temurin
- uses: android-actions/setup-android@7c5672355aaa8fde5f97a91aa9a99616d1ace6bc
- uses: nttld/setup-ndk@8c3b609ff4d54576ea420551943fd34b4d03b0dc
with:
ndk-version: r25b
local-cache: true
add-to-path: true
- run: echo "ndk.dir=$(dirname $(which ndk-build))" >> android/local.properties
- uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa
with:
flutter-version: '3.3.9'
- run: flutter pub upgrade
- run: flutter pub run flutter_wasm:setup
- run: flutter test
- run: flutter build apk
- run: flutter build appbundle