@@ -51,226 +51,6 @@ jobs:
5151 REPO_NAME : ${{ github.event.repository.name }}
5252 PULL_REQUEST_NUMBER : ${{ github.event.pull_request.number }}
5353
54- build_checkout :
55- runs-on : ${{ matrix.os }}
56-
57- defaults :
58- run :
59- working-directory : ffi/dart
60- strategy :
61- matrix :
62- os : [ubuntu-latest, macos-latest, windows-latest]
63- steps :
64- - uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
65- with :
66- submodules : true
67-
68- - uses : dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
69- with :
70- sdk : main
71-
72- - name : Install Rust toolchains
73- run : |
74- rustup toolchain install stable
75- rustup toolchain install nightly
76-
77- - name : Show the selected Rust toolchain
78- run : rustup show
79-
80- - name : Set up toolchain for Linux
81- if : matrix.os == 'ubuntu-latest'
82- run : |
83- rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
84-
85- - name : Set up toolchain for Mac
86- if : matrix.os == 'macos-latest'
87- run : |
88- rustup component add rust-src --toolchain nightly-aarch64-apple-darwin
89-
90- - name : Set up toolchain for Windows
91- if : matrix.os == 'windows-latest'
92- run : |
93- rustup component add rust-src --toolchain nightly-x86_64-pc-windows-msvc
94-
95- - run : dart pub get
96-
97- - run : |
98- yq -i ".hooks.user_defines.icu4x.buildMode = \"checkout\"" pubspec.yaml
99- yq -i ".hooks.user_defines.icu4x.checkoutPath = \"file://$(realpath ${{ github.workspace }})/\"" pubspec.yaml
100- cat pubspec.yaml
101- if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
102-
103- - run : |
104- choco install yq
105- yq -i ".hooks.user_defines.icu4x.buildMode = \"checkout\"" pubspec.yaml
106- yq -i ".hooks.user_defines.icu4x.checkoutPath = \"file://$((Get-Item ${{ github.workspace }}).FullName -replace '/', '\')\"" pubspec.yaml
107- if: matrix.os == 'windows-latest'
108-
109- - run : dart analyze --fatal-infos
110-
111- - run : dart format --output=none --set-exit-if-changed .
112-
113- - run : dart test
114-
115- - run : dart pub get
116- working-directory : examples/dart
117-
118- - run : |
119- yq -i ".hooks.user_defines.icu4x.buildMode = \"checkout\"" ../../examples/dart/pubspec.yaml
120- yq -i ".hooks.user_defines.icu4x.checkoutPath = \"$(realpath ${{ github.workspace }})/\"" ../../examples/dart/pubspec.yaml
121- if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
122-
123- - run : |
124- yq -i ".hooks.user_defines.icu4x.buildMode = \"checkout\"" pubspec.yaml
125- yq -i ".hooks.user_defines.icu4x.checkoutPath = \"$((Get-Item ${{ github.workspace }}).FullName -replace '/', '\')/\"" ../../examples/dart/pubspec.yaml
126-
127- - run : dart --enable-experiment=record-use build cli bin/example.dart
128- working-directory : examples/dart
129-
130- - run : tree . -a
131- if : matrix.os == 'ubuntu-latest'
132-
133- - name : Run example (Linux)
134- working-directory : examples/dart
135- if : matrix.os == 'ubuntu-latest'
136- run : ./build/cli/linux_x64/bundle/bin/example
137-
138- - name : Print file size and check limit for example (Linux)
139- working-directory : examples/dart
140- if : matrix.os == 'ubuntu-latest'
141- run : |
142- FILE_PATH="build/cli/linux_x64/bundle/lib/libicu4x.so"
143- FILE_SIZE=$(stat -c %s "$FILE_PATH")
144- echo "Linux executable size: $FILE_SIZE bytes"
145- if [ "$FILE_SIZE" -gt 10485760 ]; then
146- echo "Error: Linux executable size ($FILE_SIZE bytes) exceeds 10MB limit (10485760 bytes)."
147- exit 1
148- fi
149-
150- - name : Run example (Mac)
151- working-directory : examples/dart
152- if : matrix.os == 'macos-latest'
153- run : ./build/cli/macos_arm64/bundle/bin/example
154- - name : Print file size and check limit for example (Mac)
155- working-directory : examples/dart
156- # skip until https://github.com/dart-lang/i18n/issues/989 issue is resolved
157- if : matrix.os == 'macos-latest' && false
158- run : |
159- FILE_PATH="build/cli/macos_arm64/bundle/lib/libicu4x.dylib"
160- FILE_SIZE=$(stat -f %z "$FILE_PATH")
161- echo "macOS executable size: $FILE_SIZE bytes"
162- if [ "$FILE_SIZE" -gt 10485760 ]; then
163- echo "Error: macOS executable size ($FILE_SIZE bytes) exceeds 10MB limit (10485760 bytes)."
164- exit 1
165- fi
166-
167- - name : Run example (Windows)
168- working-directory : examples/dart
169- if : matrix.os == 'windows-latest'
170- run : .\build\cli\windows_x64\bundle\bin\example.exe
171- - name : Print file size and check limit for example (Windows)
172- working-directory : examples/dart
173- if : matrix.os == 'windows-latest'
174- run : |
175- $filePath = ".\build\cli\windows_x64\bundle\lib\icu4x.dll"
176- $fileSize = (Get-Item $filePath).Length
177- Write-Host "Windows executable size: $fileSize bytes"
178- if ($fileSize -gt 10485760) {
179- Write-Host "Error: Windows executable size ($fileSize bytes) exceeds 10MB limit (10485760 bytes)."
180- exit 1
181- }
182-
183- build_fetch :
184- runs-on : ${{ matrix.os }}
185- needs : [check_skip_fetch]
186- # Only run if not PR, or if PR and skip_fetch is false
187- # TODO: Uncomment this after releasing artifacts.
188- # if: github.event_name != 'pull_request' || needs.check_skip_fetch.outputs.skip_fetch == 'false'
189- if : false
190-
191- strategy :
192- matrix :
193- os : [ubuntu-latest, macos-latest, windows-latest]
194-
195- defaults :
196- run :
197- working-directory : ffi/dart
198-
199- steps :
200- - uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
201- with :
202- submodules : true
203-
204- - uses : dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
205- with :
206- sdk : main
207-
208- - run : dart pub get
209-
210- - run : |
211- yq -i ".hooks.user_defines.icu4x.buildMode = \"fetch\"" pubspec.yaml
212- yq -i ".hooks.user_defines.icu4x.buildMode = \"fetch\"" ../../examples/dart/pubspec.yaml
213-
214- - run : dart test
215-
216- - run : dart pub get
217- working-directory : examples/dart
218-
219- - run : dart --enable-experiment=record-use build cli bin/example.dart
220- working-directory : examples/dart
221-
222- - name : Run example (Linux)
223- working-directory : examples/dart
224- if : matrix.os == 'ubuntu-latest'
225- run : ./build/cli/linux_x64/bundle/bin/example
226-
227- - name : Print file size and check limit for example (Linux)
228- working-directory : examples/dart
229- if : matrix.os == 'ubuntu-latest'
230- run : |
231- FILE_PATH="build/cli/linux_x64/bundle/lib/libicu4x.so"
232- FILE_SIZE=$(stat -c %s "$FILE_PATH")
233- echo "Linux executable size: $FILE_SIZE bytes"
234- if [ "$FILE_SIZE" -gt 10485760 ]; then
235- echo "Error: Linux executable size ($FILE_SIZE bytes) exceeds 10MB limit (10485760 bytes)."
236- exit 1
237- fi
238-
239- - name : Run example (Mac)
240- working-directory : examples/dart
241- if : matrix.os == 'macos-latest'
242- run : ./build/cli/macos_arm64/bundle/bin/example
243-
244- - name : Print file size and check limit for example (Mac)
245- working-directory : examples/dart
246- # skip until https://github.com/dart-lang/i18n/issues/989 issue is resolved
247- if : matrix.os == 'macos-latest' && false
248- run : |
249- FILE_PATH="build/cli/macos_arm64/bundle/lib/example"
250- FILE_SIZE=$(stat -f %z "$FILE_PATH")
251- echo "macOS executable size: $FILE_SIZE bytes"
252- if [ "$FILE_SIZE" -gt 10485760 ]; then
253- echo "Error: macOS executable size ($FILE_SIZE bytes) exceeds 10MB limit (10485760 bytes)."
254- exit 1
255- fi
256-
257- - name : Run example (Windows)
258- working-directory : examples/dart
259- if : matrix.os == 'windows-latest'
260- run : .\build\cli\windows_x64\bundle\bin\example.exe
261-
262- - name : Print file size and check limit for example (Windows)
263- working-directory : examples/dart
264- if : matrix.os == 'windows-latest'
265- run : |
266- $filePath = ".\build\cli\windows_x64\bundle\lib\icu4x.dll"
267- $fileSize = (Get-Item $filePath).Length
268- Write-Host "Windows executable size: $fileSize bytes"
269- if ($fileSize -gt 10485760) {
270- Write-Host "Error: Windows executable size ($fileSize bytes) exceeds 10MB limit (10485760 bytes)."
271- exit 1
272- }
273-
27454 build_local :
27555 strategy :
27656 fail-fast : false
@@ -302,22 +82,16 @@ jobs:
30282 - name : Build Linux
30383 if : matrix.os == 'ubuntu-latest'
30484 run : |
305- rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
306-
30785 dart ffi/dart/lib/src/hook_helpers/build_libs.dart --working_directory . --file bin/linux_x64 --os linux --architecture x64 --compile_type dynamic --cargo_features collator,datetime,list,decimal,plurals,casemap,experimental,default,compiled_data
30886
30987 - name : Build Mac
31088 if : matrix.os == 'macos-latest'
31189 run : |
312- rustup component add rust-src --toolchain nightly-aarch64-apple-darwin
313-
31490 dart ffi/dart/lib/src/hook_helpers/build_libs.dart --working_directory . --file bin/macos_arm64 --os macos --architecture arm64 --compile_type dynamic --cargo_features collator,datetime,list,decimal,plurals,casemap,experimental,default,compiled_data
31591
31692 - name : Build Windows
31793 if : matrix.os == 'windows-latest'
31894 run : |
319- rustup component add rust-src --toolchain nightly-x86_64-pc-windows-msvc
320-
32195 dart ffi/dart/lib/src/hook_helpers/build_libs.dart --working_directory . --file bin/windows_x64 --os windows --architecture x64 --compile_type dynamic --cargo_features collator,datetime,list,decimal,plurals,casemap,experimental,default,compiled_data
32296
32397 - name : Run `dart pub get`
0 commit comments