|
1 | | -# Created with package:mono_repo v6.6.3 |
2 | | -name: Dart CI |
| 1 | +name: Dart |
| 2 | + |
3 | 3 | on: |
4 | 4 | push: |
5 | | - branches: |
6 | | - - main |
| 5 | + branches: [ main ] |
7 | 6 | pull_request: |
| 7 | + branches: [ main ] |
8 | 8 | schedule: |
9 | 9 | - cron: "0 0 * * 0" |
10 | | -defaults: |
11 | | - run: |
12 | | - shell: bash |
| 10 | + |
13 | 11 | env: |
14 | 12 | PUB_ENVIRONMENT: bot.github |
15 | 13 | permissions: read-all |
16 | 14 |
|
17 | 15 | jobs: |
18 | | - job_001: |
19 | | - name: mono_repo self validate |
20 | | - runs-on: ubuntu-latest |
21 | | - steps: |
22 | | - - name: Cache Pub hosted dependencies |
23 | | - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 |
24 | | - with: |
25 | | - path: "~/.pub-cache/hosted" |
26 | | - key: "os:ubuntu-latest;pub-cache-hosted;sdk:stable" |
27 | | - restore-keys: | |
28 | | - os:ubuntu-latest;pub-cache-hosted |
29 | | - os:ubuntu-latest |
30 | | - - name: Setup Dart SDK |
31 | | - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c |
32 | | - with: |
33 | | - sdk: stable |
34 | | - - id: checkout |
35 | | - name: Checkout repository |
36 | | - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 |
37 | | - - name: mono_repo self validate |
38 | | - run: dart pub global activate mono_repo 6.6.3 |
39 | | - - name: mono_repo self validate |
40 | | - run: dart pub global run mono_repo generate --validate |
41 | | - job_002: |
42 | | - name: "analyzer_and_format; Dart 3.9.0; PKGS: pkgs/analysis_defaults, pkgs/dash_design, pkgs/excerpter, pkgs/inject_dartpad; `dart format --output=none --set-exit-if-changed .`, `dart analyze --fatal-infos .`" |
43 | | - runs-on: ubuntu-latest |
44 | | - steps: |
45 | | - - name: Cache Pub hosted dependencies |
46 | | - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 |
47 | | - with: |
48 | | - path: "~/.pub-cache/hosted" |
49 | | - key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.9.0;packages:pkgs/analysis_defaults-pkgs/dash_design-pkgs/excerpter-pkgs/inject_dartpad;commands:format-analyze" |
50 | | - restore-keys: | |
51 | | - os:ubuntu-latest;pub-cache-hosted;sdk:3.9.0;packages:pkgs/analysis_defaults-pkgs/dash_design-pkgs/excerpter-pkgs/inject_dartpad |
52 | | - os:ubuntu-latest;pub-cache-hosted;sdk:3.9.0 |
53 | | - os:ubuntu-latest;pub-cache-hosted |
54 | | - os:ubuntu-latest |
55 | | - - name: Setup Dart SDK |
56 | | - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c |
57 | | - with: |
58 | | - sdk: "3.9.0" |
59 | | - - id: checkout |
60 | | - name: Checkout repository |
61 | | - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 |
62 | | - - id: pkgs_analysis_defaults_pub_upgrade |
63 | | - name: pkgs/analysis_defaults; dart pub upgrade |
64 | | - run: dart pub upgrade |
65 | | - if: "always() && steps.checkout.conclusion == 'success'" |
66 | | - working-directory: pkgs/analysis_defaults |
67 | | - - name: "pkgs/analysis_defaults; dart format --output=none --set-exit-if-changed ." |
68 | | - run: "dart format --output=none --set-exit-if-changed ." |
69 | | - if: "always() && steps.pkgs_analysis_defaults_pub_upgrade.conclusion == 'success'" |
70 | | - working-directory: pkgs/analysis_defaults |
71 | | - - name: "pkgs/analysis_defaults; dart analyze --fatal-infos ." |
72 | | - run: dart analyze --fatal-infos . |
73 | | - if: "always() && steps.pkgs_analysis_defaults_pub_upgrade.conclusion == 'success'" |
74 | | - working-directory: pkgs/analysis_defaults |
75 | | - - id: pkgs_dash_design_pub_upgrade |
76 | | - name: pkgs/dash_design; dart pub upgrade |
77 | | - run: dart pub upgrade |
78 | | - if: "always() && steps.checkout.conclusion == 'success'" |
79 | | - working-directory: pkgs/dash_design |
80 | | - - name: "pkgs/dash_design; dart format --output=none --set-exit-if-changed ." |
81 | | - run: "dart format --output=none --set-exit-if-changed ." |
82 | | - if: "always() && steps.pkgs_dash_design_pub_upgrade.conclusion == 'success'" |
83 | | - working-directory: pkgs/dash_design |
84 | | - - name: "pkgs/dash_design; dart analyze --fatal-infos ." |
85 | | - run: dart analyze --fatal-infos . |
86 | | - if: "always() && steps.pkgs_dash_design_pub_upgrade.conclusion == 'success'" |
87 | | - working-directory: pkgs/dash_design |
88 | | - - id: pkgs_excerpter_pub_upgrade |
89 | | - name: pkgs/excerpter; dart pub upgrade |
90 | | - run: dart pub upgrade |
91 | | - if: "always() && steps.checkout.conclusion == 'success'" |
92 | | - working-directory: pkgs/excerpter |
93 | | - - name: "pkgs/excerpter; dart format --output=none --set-exit-if-changed ." |
94 | | - run: "dart format --output=none --set-exit-if-changed ." |
95 | | - if: "always() && steps.pkgs_excerpter_pub_upgrade.conclusion == 'success'" |
96 | | - working-directory: pkgs/excerpter |
97 | | - - name: "pkgs/excerpter; dart analyze --fatal-infos ." |
98 | | - run: dart analyze --fatal-infos . |
99 | | - if: "always() && steps.pkgs_excerpter_pub_upgrade.conclusion == 'success'" |
100 | | - working-directory: pkgs/excerpter |
101 | | - - id: pkgs_inject_dartpad_pub_upgrade |
102 | | - name: pkgs/inject_dartpad; dart pub upgrade |
103 | | - run: dart pub upgrade |
104 | | - if: "always() && steps.checkout.conclusion == 'success'" |
105 | | - working-directory: pkgs/inject_dartpad |
106 | | - - name: "pkgs/inject_dartpad; dart format --output=none --set-exit-if-changed ." |
107 | | - run: "dart format --output=none --set-exit-if-changed ." |
108 | | - if: "always() && steps.pkgs_inject_dartpad_pub_upgrade.conclusion == 'success'" |
109 | | - working-directory: pkgs/inject_dartpad |
110 | | - - name: "pkgs/inject_dartpad; dart analyze --fatal-infos ." |
111 | | - run: dart analyze --fatal-infos . |
112 | | - if: "always() && steps.pkgs_inject_dartpad_pub_upgrade.conclusion == 'success'" |
113 | | - working-directory: pkgs/inject_dartpad |
114 | | - job_003: |
115 | | - name: "analyzer_and_format; Dart dev; PKGS: pkgs/analysis_defaults, pkgs/dash_design, pkgs/excerpter, pkgs/inject_dartpad; `dart format --output=none --set-exit-if-changed .`, `dart analyze --fatal-infos .`" |
| 16 | + verify: |
116 | 17 | runs-on: ubuntu-latest |
| 18 | + strategy: |
| 19 | + fail-fast: false |
| 20 | + matrix: |
| 21 | + sdk: [ stable, beta ] |
117 | 22 | steps: |
118 | | - - name: Cache Pub hosted dependencies |
119 | | - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 |
120 | | - with: |
121 | | - path: "~/.pub-cache/hosted" |
122 | | - key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:pkgs/analysis_defaults-pkgs/dash_design-pkgs/excerpter-pkgs/inject_dartpad;commands:format-analyze" |
123 | | - restore-keys: | |
124 | | - os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:pkgs/analysis_defaults-pkgs/dash_design-pkgs/excerpter-pkgs/inject_dartpad |
125 | | - os:ubuntu-latest;pub-cache-hosted;sdk:dev |
126 | | - os:ubuntu-latest;pub-cache-hosted |
127 | | - os:ubuntu-latest |
128 | | - - name: Setup Dart SDK |
129 | | - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c |
130 | | - with: |
131 | | - sdk: dev |
132 | | - - id: checkout |
133 | | - name: Checkout repository |
134 | | - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 |
135 | | - - id: pkgs_analysis_defaults_pub_upgrade |
136 | | - name: pkgs/analysis_defaults; dart pub upgrade |
137 | | - run: dart pub upgrade |
138 | | - if: "always() && steps.checkout.conclusion == 'success'" |
139 | | - working-directory: pkgs/analysis_defaults |
140 | | - - name: "pkgs/analysis_defaults; dart format --output=none --set-exit-if-changed ." |
141 | | - run: "dart format --output=none --set-exit-if-changed ." |
142 | | - if: "always() && steps.pkgs_analysis_defaults_pub_upgrade.conclusion == 'success'" |
143 | | - working-directory: pkgs/analysis_defaults |
144 | | - - name: "pkgs/analysis_defaults; dart analyze --fatal-infos ." |
145 | | - run: dart analyze --fatal-infos . |
146 | | - if: "always() && steps.pkgs_analysis_defaults_pub_upgrade.conclusion == 'success'" |
147 | | - working-directory: pkgs/analysis_defaults |
148 | | - - id: pkgs_dash_design_pub_upgrade |
149 | | - name: pkgs/dash_design; dart pub upgrade |
150 | | - run: dart pub upgrade |
151 | | - if: "always() && steps.checkout.conclusion == 'success'" |
152 | | - working-directory: pkgs/dash_design |
153 | | - - name: "pkgs/dash_design; dart format --output=none --set-exit-if-changed ." |
154 | | - run: "dart format --output=none --set-exit-if-changed ." |
155 | | - if: "always() && steps.pkgs_dash_design_pub_upgrade.conclusion == 'success'" |
156 | | - working-directory: pkgs/dash_design |
157 | | - - name: "pkgs/dash_design; dart analyze --fatal-infos ." |
158 | | - run: dart analyze --fatal-infos . |
159 | | - if: "always() && steps.pkgs_dash_design_pub_upgrade.conclusion == 'success'" |
160 | | - working-directory: pkgs/dash_design |
161 | | - - id: pkgs_excerpter_pub_upgrade |
162 | | - name: pkgs/excerpter; dart pub upgrade |
163 | | - run: dart pub upgrade |
164 | | - if: "always() && steps.checkout.conclusion == 'success'" |
165 | | - working-directory: pkgs/excerpter |
166 | | - - name: "pkgs/excerpter; dart format --output=none --set-exit-if-changed ." |
167 | | - run: "dart format --output=none --set-exit-if-changed ." |
168 | | - if: "always() && steps.pkgs_excerpter_pub_upgrade.conclusion == 'success'" |
169 | | - working-directory: pkgs/excerpter |
170 | | - - name: "pkgs/excerpter; dart analyze --fatal-infos ." |
171 | | - run: dart analyze --fatal-infos . |
172 | | - if: "always() && steps.pkgs_excerpter_pub_upgrade.conclusion == 'success'" |
173 | | - working-directory: pkgs/excerpter |
174 | | - - id: pkgs_inject_dartpad_pub_upgrade |
175 | | - name: pkgs/inject_dartpad; dart pub upgrade |
176 | | - run: dart pub upgrade |
177 | | - if: "always() && steps.checkout.conclusion == 'success'" |
178 | | - working-directory: pkgs/inject_dartpad |
179 | | - - name: "pkgs/inject_dartpad; dart format --output=none --set-exit-if-changed ." |
180 | | - run: "dart format --output=none --set-exit-if-changed ." |
181 | | - if: "always() && steps.pkgs_inject_dartpad_pub_upgrade.conclusion == 'success'" |
182 | | - working-directory: pkgs/inject_dartpad |
183 | | - - name: "pkgs/inject_dartpad; dart analyze --fatal-infos ." |
184 | | - run: dart analyze --fatal-infos . |
185 | | - if: "always() && steps.pkgs_inject_dartpad_pub_upgrade.conclusion == 'success'" |
186 | | - working-directory: pkgs/inject_dartpad |
187 | | - job_004: |
188 | | - name: "unit_test; Dart 3.9.0; PKG: pkgs/excerpter; `dart test`" |
189 | | - runs-on: ubuntu-latest |
190 | | - steps: |
191 | | - - name: Cache Pub hosted dependencies |
192 | | - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 |
193 | | - with: |
194 | | - path: "~/.pub-cache/hosted" |
195 | | - key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.9.0;packages:pkgs/excerpter;commands:test" |
196 | | - restore-keys: | |
197 | | - os:ubuntu-latest;pub-cache-hosted;sdk:3.9.0;packages:pkgs/excerpter |
198 | | - os:ubuntu-latest;pub-cache-hosted;sdk:3.9.0 |
199 | | - os:ubuntu-latest;pub-cache-hosted |
200 | | - os:ubuntu-latest |
201 | | - - name: Setup Dart SDK |
202 | | - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c |
203 | | - with: |
204 | | - sdk: "3.9.0" |
205 | | - - id: checkout |
206 | | - name: Checkout repository |
207 | | - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 |
208 | | - - id: pkgs_excerpter_pub_upgrade |
209 | | - name: pkgs/excerpter; dart pub upgrade |
210 | | - run: dart pub upgrade |
211 | | - if: "always() && steps.checkout.conclusion == 'success'" |
212 | | - working-directory: pkgs/excerpter |
213 | | - - name: pkgs/excerpter; dart test |
214 | | - run: dart test |
215 | | - if: "always() && steps.pkgs_excerpter_pub_upgrade.conclusion == 'success'" |
216 | | - working-directory: pkgs/excerpter |
217 | | - needs: |
218 | | - - job_001 |
219 | | - - job_002 |
220 | | - - job_003 |
221 | | - job_005: |
222 | | - name: "unit_test; Dart dev; PKG: pkgs/excerpter; `dart test`" |
223 | | - runs-on: ubuntu-latest |
224 | | - steps: |
225 | | - - name: Cache Pub hosted dependencies |
226 | | - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 |
227 | | - with: |
228 | | - path: "~/.pub-cache/hosted" |
229 | | - key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:pkgs/excerpter;commands:test" |
230 | | - restore-keys: | |
231 | | - os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:pkgs/excerpter |
232 | | - os:ubuntu-latest;pub-cache-hosted;sdk:dev |
233 | | - os:ubuntu-latest;pub-cache-hosted |
234 | | - os:ubuntu-latest |
235 | | - - name: Setup Dart SDK |
236 | | - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c |
237 | | - with: |
238 | | - sdk: dev |
239 | | - - id: checkout |
240 | | - name: Checkout repository |
241 | | - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 |
242 | | - - id: pkgs_excerpter_pub_upgrade |
243 | | - name: pkgs/excerpter; dart pub upgrade |
244 | | - run: dart pub upgrade |
245 | | - if: "always() && steps.checkout.conclusion == 'success'" |
246 | | - working-directory: pkgs/excerpter |
247 | | - - name: pkgs/excerpter; dart test |
248 | | - run: dart test |
249 | | - if: "always() && steps.pkgs_excerpter_pub_upgrade.conclusion == 'success'" |
250 | | - working-directory: pkgs/excerpter |
251 | | - needs: |
252 | | - - job_001 |
253 | | - - job_002 |
254 | | - - job_003 |
| 23 | + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 |
| 24 | + - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c |
| 25 | + with: |
| 26 | + sdk: ${{ matrix.sdk }} |
| 27 | + - name: Install dependencies |
| 28 | + run: dart pub get |
| 29 | + - name: Check formatting |
| 30 | + run: dart run melos exec "dart format --output=none --set-exit-if-changed ." |
| 31 | + - name: Analyze Dart code |
| 32 | + run: dart run melos exec "dart analyze --fatal-infos ." |
| 33 | + - name: Run tests on VM |
| 34 | + run: dart run melos exec --dir-exists=test "dart test --reporter=github --test-randomize-ordering-seed=random" |
0 commit comments