-
Notifications
You must be signed in to change notification settings - Fork 362
87 lines (83 loc) · 2.59 KB
/
cupertino.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
name: package:cupertino_http CI
on:
push:
branches:
- main
- master
paths:
- 'pkgs/cupertino_http/**'
- 'pkgs/http_client_conformance_tests/**'
- '.github/workflows/cupertino.yml'
pull_request:
paths:
- 'pkgs/cupertino_http/**'
- 'pkgs/http_client_conformance_tests/**'
- '.github/workflows/cupertino.yml'
schedule:
- cron: "0 0 * * 0"
env:
PUB_ENVIRONMENT: bot.github
jobs:
analyze:
name: Lint and static analysis
runs-on: ubuntu-latest
defaults:
run:
working-directory: pkgs/cupertino_http
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- id: install
name: Install dependencies
run: flutter pub get
- name: Check formatting
# Don't lint the generated file native_cupertino_bindings.dart
# This approach is simpler than using `find` and excluding that file
# because `dart format` also excludes other file e.g. ones in
# directories start with '.'.
run: >
mv lib/src/native_cupertino_bindings.dart lib/src/native_cupertino_bindings.tmp &&
dart format --output=none --set-exit-if-changed . &&
mv lib/src/native_cupertino_bindings.tmp lib/src/native_cupertino_bindings.dart
if: always() && steps.install.outcome == 'success'
- name: Analyze code
run: flutter analyze --fatal-infos
if: always() && steps.install.outcome == 'success'
test:
# Test package:cupertino_http use flutter integration tests.
needs: analyze
name: "Build and test"
strategy:
matrix:
# Test on the minimum supported flutter version and the latest
# version.
flutter-version: ["3.10.0", "any"]
runs-on: macos-latest
defaults:
run:
working-directory: pkgs/cupertino_http/example
steps:
- uses: actions/checkout@v3
- uses: futureware-tech/simulator-action@v2
with:
model: 'iPhone 8'
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.flutter-version }}
channel: 'stable'
- name: Run tests
# TODO: Remove the retries when
# https://github.com/flutter/flutter/issues/121231 is fixed.
# See https://github.com/dart-lang/http/issues/938 for context.
run: |
for i in {1..6}
do
flutter test integration_test/main.dart && break
if [ $i -eq 6 ]
then
exit 1
fi
echo "Retry $i"
done