-
-
Notifications
You must be signed in to change notification settings - Fork 256
134 lines (114 loc) · 3.54 KB
/
backward_compatibility.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
name: Backward compatibility
on:
push:
branches:
- master
pull_request:
branches-ignore:
- release/beta
- release/master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
test:
strategy:
matrix:
package:
- core
- enhanced
- fwfh_cached_network_image
- fwfh_chewie
- fwfh_just_audio
- fwfh_svg
- fwfh_url_launcher
- fwfh_webview
name: ${{ matrix.package }}
runs-on: ubuntu-latest
continue-on-error: true
defaults:
run:
working-directory: packages/${{ matrix.package }}
env:
GOLDEN_SKIP: "yes"
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Update pubspec.yaml
run: |
set -e
sudo snap install yq
# delete all overrides and use pub.dev versions
yq e 'del(.dependency_overrides)' -i pubspec.yaml
# back up SDK constraint
_sdkVersion=$( yq e .environment.sdk pubspec.yaml )
# replace:
# foo: ^1.0.0
# bar: ^2.0.0-0
# into:
# foo: 1.0.0
# bar: ^2.0.0-0 (unchanged)
sed -i'' -e 's#^\( [^:]*\): ^\([0-9.]*\)$#\1: \2#' pubspec.yaml
# replace:
# foo: ">=1.0.0"
# bar: ">=2.0.0 <4.0.0"
# yolo: ">=3.0.0-0"
# into:
# foo: 1.0.0
# bar: 2.0.0
# yolo: ">=3.0.0-0" (unchanged)
sed -i'' -e 's#^\( [^:]*\): ">=\([0-9.]*\)\( <.*\)\{0,1\}"$#\1: \2#' pubspec.yaml
# restore SDK constraint
yq e ".environment.sdk = \"${_sdkVersion}\"" -i pubspec.yaml
# extract Flutter version to install later
_flutterVersion=$( yq e '.environment.flutter' pubspec.yaml | sed -e 's/^>=//' | sed -e 's/-0$//' )
echo "FLUTTER_VERSION=${_flutterVersion}" >> $GITHUB_ENV
# output for debugging
cat pubspec.yaml
- name: Setup Flutter
uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 # v2.16.0
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- run: flutter test
core:
strategy:
matrix:
channel:
- beta
- master
- stable
# In case one of these fails, create a new PR against the `release/*` branch
name: core@${{ matrix.channel }}
runs-on: ubuntu-latest
continue-on-error: true
defaults:
run:
working-directory: packages/core
env:
GOLDEN_SKIP: "yes"
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Update pubspec.yaml
run: |
set -e
sudo snap install yq
# delete all overrides and use pub.dev versions
yq e 'del(.dependency_overrides)' -i pubspec.yaml
# output for debugging
cat pubspec.yaml
- name: Setup Flutter
uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 # v2.16.0
with:
channel: ${{ matrix.channel }}
- run: flutter test
html_flex:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Verify hashes
run: |
set -e
_scripts=$( cat packages/core/lib/src/widgets/html_flex.dart | head -n 22 | tail -n 21 )
bash -c "$_scripts"