-
Notifications
You must be signed in to change notification settings - Fork 41
207 lines (169 loc) · 7.47 KB
/
main.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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
name: CI
on: push
env:
flutter: '3.x'
xcode: '14.2'
simulator: iPhone 14
jobs:
authorize:
name: Authorize
environment: ${{ github.event.pull_request.head.repo.fork && 'external' || 'internal' }}
runs-on: ubuntu-latest
steps:
- run: true
analyze-auth0_flutter:
name: Analyze auth0_flutter Flutter package
needs: authorize
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- name: Install Flutter
uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa
with:
flutter-version: ${{ env.flutter }}
channel: stable
cache: true
- name: Add example/.env
working-directory: auth0_flutter
run: cp example/.env.example example/.env
- name: Analize auth0_flutter package
working-directory: auth0_flutter
run: flutter analyze
analyze-auth0_flutter_platform_interface:
name: Analyze auth0_flutter_platform_interface Flutter package
needs: authorize
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- name: Install Flutter
uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa
with:
flutter-version: ${{ env.flutter }}
channel: stable
cache: true
- name: Analize auth0_flutter_platform_interface package
working-directory: auth0_flutter_platform_interface
run: flutter analyze
test-auth0_flutter:
name: Test auth0_flutter Flutter package
needs: authorize
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- name: Install Flutter
uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa
with:
flutter-version: ${{ env.flutter }}
channel: stable
cache: true
- name: Add example/.env
working-directory: auth0_flutter
run: cp example/.env.example example/.env
- name: Test auth0_flutter package
working-directory: auth0_flutter
run: |
flutter test --tags browser --platform chrome
flutter test --coverage --exclude-tags browser
- name: Upload coverage report for auth0_flutter
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d
with:
name: Auth0 Flutter
flags: auth0_flutter
files: ./auth0_flutter/coverage/lcov.info
test-auth0_flutter_platform_interface:
name: Test auth0_flutter Flutter package
needs: authorize
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- name: Install Flutter
uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa
with:
flutter-version: ${{ env.flutter }}
channel: stable
cache: true
- name: Test auth0_flutter_platform_interface package
working-directory: auth0_flutter_platform_interface
run: flutter test --coverage
- name: Upload coverage report for auth0_flutter_platform_interface
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d
with:
name: Auth0 Flutter
flags: auth0_flutter_platform_interface
files: ./auth0_flutter_platform_interface/coverage/lcov.info
test-ios-unit:
name: Run native iOS unit tests using Xcode ${{ matrix.xcode }}
needs: authorize
runs-on: macos-latest
environment: ${{ github.event.pull_request.head.repo.fork && 'external' || 'internal' }}
env:
USER_EMAIL: ${{ secrets.USER_EMAIL }}
USER_PASSWORD: ${{ secrets.USER_PASSWORD }}
strategy:
matrix:
xcode:
- '14.2'
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- name: Set up environment
uses: ./.github/actions/setup-ios
with:
flutter: ${{ env.flutter }}
xcode: ${{ matrix.xcode }}
auth0-domain: ${{ vars.AUTH0_DOMAIN }}
auth0-client-id: ${{ vars.AUTH0_CLIENT_ID }}
- name: Run iOS unit tests
working-directory: auth0_flutter/example/ios
run: xcodebuild test -scheme Runner -workspace Runner.xcworkspace -destination '${{ format('{0}{1}', 'platform=iOS Simulator,name=', env.simulator) }}' -resultBundlePath unit-tests.xcresult -skip-testing:RunnerUITests
- name: Convert coverage report
working-directory: auth0_flutter/example/ios
run: bundle exec slather coverage -x --scheme Runner Runner.xcodeproj
- name: Upload coverage report
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d
with:
directory: auth0_flutter/example/ios/cobertura
- name: Upload xcresult bundles
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
if: ${{ failure() }}
with:
name: xcresult bundles
path: 'auth0_flutter/example/ios/*.xcresult'
test-ios-smoke:
name: Run native iOS smoke tests using Xcode ${{ matrix.xcode }}
needs: authorize
runs-on: macos-latest
environment: ${{ github.event.pull_request.head.repo.fork && 'external' || 'internal' }}
env:
USER_EMAIL: ${{ secrets.USER_EMAIL }}
USER_PASSWORD: ${{ secrets.USER_PASSWORD }}
strategy:
matrix:
xcode:
- '14.2'
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- name: Set up environment
uses: ./.github/actions/setup-ios
with:
flutter: ${{ env.flutter }}
xcode: ${{ matrix.xcode }}
auth0-domain: ${{ vars.AUTH0_DOMAIN }}
auth0-client-id: ${{ vars.AUTH0_CLIENT_ID }}
- name: Run iOS smoke tests
if: ${{ github.event.pull_request.head.repo.fork == false }}
working-directory: auth0_flutter/example/ios
run: |
defaults write com.apple.iphonesimulator ConnectHardwareKeyboard 0
xcodebuild test -scheme Runner -workspace Runner.xcworkspace -destination '${{ format('{0}{1}', 'platform=iOS Simulator,name=', env.simulator) }}' -resultBundlePath smoke-tests.xcresult -only-testing:RunnerUITests
- name: Upload xcresult bundles
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
if: ${{ failure() }}
with:
name: xcresult bundles
path: 'auth0_flutter/example/ios/*.xcresult'