-
Notifications
You must be signed in to change notification settings - Fork 136
207 lines (205 loc) · 6.72 KB
/
Copy pathdart.yml
File metadata and controls
207 lines (205 loc) · 6.72 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
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: Dart
on: pull_request
jobs:
packages:
strategy:
matrix:
package:
- gql
- gql_build
- gql_code_builder
- gql_exec
- gql_link
- gql_dedupe_link
- gql_dio_link
- gql_error_link
- gql_http_link
- gql_websocket_link
- gql_link
- gql_transform_link
- cats
- gql_example_http_auth_link
runs-on: ubuntu-latest
container:
image: google/dart:latest
name: Check ${{ matrix.package }}
env:
PACKAGE: ${{ matrix.package }}
steps:
- name: Clone repository
uses: actions/checkout@v2
- name: Activate tools
run: |
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
pub global activate melos
pub global activate uni
- name: Check pubspec
run: |
melos clean
melos --scope $PACKAGE exec -- git diff --exit-code pubspec.yaml
- name: Bootstrap
run: |
melos --scope $PACKAGE bootstrap
- name: Get dependencies
run: |
melos --scope $PACKAGE exec -- uni pub get
- name: Check formatting
run: |
echo ""
echo "A list of incorrectly formatted files may follow:"
echo ""
melos --scope $PACKAGE exec -- uni --tooling legacy format -n . --set-exit-if-changed
echo ""
- name: Analyze package
run: |
melos --scope $PACKAGE exec -- uni analyze --version
melos --scope $PACKAGE exec -- uni analyze --fatal-warnings .
- name: Run tests
run: |
melos --scope $PACKAGE exec -- [ -d ./test ] || exit 0
melos --scope $PACKAGE exec -- uni test
examples:
strategy:
matrix:
package:
- gql_example_cli
- gql_example_cli_github
- gql_example_build
runs-on: ubuntu-latest
container:
image: google/dart:latest
name: Check ${{ matrix.package }}
env:
PACKAGE: ${{ matrix.package }}
steps:
- name: Clone repository
uses: actions/checkout@v2
- name: Activate tools
run: |
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
pub global activate melos
pub global activate uni
- name: Check pubspec
run: |
melos clean
melos --scope $PACKAGE exec -- git diff --exit-code pubspec.yaml
- name: Bootstrap
run: |
melos --scope $PACKAGE bootstrap
- name: Get dependencies
run: |
melos --scope $PACKAGE exec -- uni pub get
- name: Run builders
run: |
melos --scope $PACKAGE exec -- uni pub run build_runner build --delete-conflicting-outputs
- name: Check build diff
run: |
melos --scope $PACKAGE exec -- git diff --exit-code **/*.gql.dart
- name: Check formatting
run: |
echo ""
echo "A list of incorrectly formatted files may follow:"
echo ""
melos --scope $PACKAGE exec -- uni --tooling legacy format -n . --set-exit-if-changed
echo ""
- name: Analyze package
run: |
melos --scope $PACKAGE exec -- uni analyze --version
melos --scope $PACKAGE exec -- uni analyze --fatal-warnings .
builder_tests:
strategy:
matrix:
package:
- end_to_end_test
runs-on: ubuntu-latest
container:
image: google/dart:latest
name: Check ${{ matrix.package }}
env:
PACKAGE: ${{ matrix.package }}
steps:
- name: Clone repository
uses: actions/checkout@v2
- name: Activate tools
run: |
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
pub global activate melos
pub global activate uni
- name: Check pubspec
run: |
melos clean
melos --scope $PACKAGE exec -- git diff --exit-code pubspec.yaml
- name: Bootstrap
run: |
melos --scope $PACKAGE bootstrap
- name: Get dependencies
run: |
melos --scope $PACKAGE exec -- uni pub get
- name: Run builders
run: |
melos --scope $PACKAGE exec -- uni pub run build_runner build --delete-conflicting-outputs
- name: Check build diff
run: |
melos --scope $PACKAGE exec -- git diff --exit-code **/*.gql.dart
- name: Check formatting
run: |
echo ""
echo "A list of incorrectly formatted files may follow:"
echo ""
melos --scope $PACKAGE exec -- uni --tooling legacy format -n . --set-exit-if-changed
echo ""
- name: Analyze package
run: |
melos --scope $PACKAGE exec -- uni analyze --version
melos --scope $PACKAGE exec -- uni analyze --fatal-warnings .
- name: Run tests
run: |
melos --scope $PACKAGE exec -- [ -d ./test ] || exit 0
melos --scope $PACKAGE exec -- uni test
publish_dry_run:
runs-on: ubuntu-latest
container:
image: google/dart:latest
env:
PACKAGES: 'gql,gql_build,gql_code_builder,gql_dedupe_link,gql_dio_link,gql_exec,gql_http_link,gql_link,gql_pedantic,gql_transform_link,gql_error_link,gql_websocket_link'
PUB_ACCESS_TOKEN: ${{ secrets.PUB_ACCESS_TOKEN }}
PUB_REFRESH_TOKEN: ${{ secrets.PUB_REFRESH_TOKEN }}
steps:
- name: Clone repository
uses: actions/checkout@v2
- name: Activate tools
run: |
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
pub global activate multipack
- name: Bump to alpha version
run: |
multipack --only $PACKAGES pubspec bump-alpha
- name: Sync package versions
run: |
multipack --only $PACKAGES pubspec sync-versions
- name: Publish packages
run: |
echo "{\"accessToken\":\"$PUB_ACCESS_TOKEN\",\"refreshToken\":\"$PUB_REFRESH_TOKEN\",\"idToken\":null,\"tokenEndpoint\":\"https://accounts.google.com/o/oauth2/token\",\"scopes\":[\"openid\",\"https://www.googleapis.com/auth/userinfo.email\"],\"expiration\":1588334512218}" > $HOME/.pub-cache/credentials.json
multipack --only $PACKAGES pub publish --dry-run
check_svg:
runs-on: ubuntu-latest
container:
image: google/dart:latest
steps:
- name: Clone repository
uses: actions/checkout@v2
- name: Install GraphViz
run: |
apt update
apt install -y graphviz
- name: Activate tools
run: |
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
pub global activate melos
- name: Generate SVG
run: |
melos list --gviz | dot -Tsvg -o docs/gql.svg
cat docs/gql.svg
- name: Check changes
run: |
git diff --exit-code docs/gql.svg