Skip to content

Commit 3b05749

Browse files
authored
Migrate to a shared pub workspace (#252)
1 parent f91ed8e commit 3b05749

File tree

14 files changed

+48
-412
lines changed

14 files changed

+48
-412
lines changed

.github/workflows/dart.yml

Lines changed: 22 additions & 242 deletions
Original file line numberDiff line numberDiff line change
@@ -1,254 +1,34 @@
1-
# Created with package:mono_repo v6.6.3
2-
name: Dart CI
1+
name: Dart
2+
33
on:
44
push:
5-
branches:
6-
- main
5+
branches: [ main ]
76
pull_request:
7+
branches: [ main ]
88
schedule:
99
- cron: "0 0 * * 0"
10-
defaults:
11-
run:
12-
shell: bash
10+
1311
env:
1412
PUB_ENVIRONMENT: bot.github
1513
permissions: read-all
1614

1715
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:
11617
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
sdk: [ stable, beta ]
11722
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"

cloud_build/firebase-ghcli/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM dart:3.10.0-290.2.beta
1+
FROM dart:3.10.0-290.4.beta
22

33
# Install prerequisite dependencies.
44
RUN apt-get update && apt-get install -y curl gpg

mono_repo.yaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

pkgs/analysis_defaults/mono_pkg.yaml

Lines changed: 0 additions & 10 deletions
This file was deleted.

pkgs/analysis_defaults/pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: analysis_defaults
22
description: Analysis defaults for Dart/Flutter site tools.
33
publish_to: none
44

5+
resolution: workspace
56
environment:
67
sdk: ^3.9.0
78

pkgs/dash_design/mono_pkg.yaml

Lines changed: 0 additions & 9 deletions
This file was deleted.

pkgs/dash_design/pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version: 0.0.1-wip
44
publish_to: none
55
repository: https://github.com/dart-lang/site-shared/tree/main/pkgs/dash_design
66

7+
resolution: workspace
78
environment:
89
sdk: ^3.9.0
910

pkgs/dash_design/test/style_test.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ void main() {
1212
test('Can build styles.scss file', () {
1313
final compileResult = sass.compileToResult(
1414
_stylesPath!,
15-
fatalDeprecations: sass.Deprecation.values.where((d) => !d.isFuture),
15+
fatalDeprecations: sass.Deprecation.values.where(
16+
(d) => !d.isFuture && d.obsoleteIn == null,
17+
),
1618
);
17-
expect(compileResult.css, contains('--dash-default-font-family'));
19+
expect(compileResult.css, contains('--dash-default-fontFamily'));
1820
});
1921
}
2022

pkgs/excerpter/mono_pkg.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

pkgs/excerpter/pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version: 0.1.0
44
publish_to: none
55
repository: https://github.com/dart-lang/site-shared/tree/main/pkgs/excerpter
66

7+
resolution: workspace
78
environment:
89
sdk: ^3.9.0
910

0 commit comments

Comments
 (0)