-
Notifications
You must be signed in to change notification settings - Fork 43
206 lines (158 loc) · 6.28 KB
/
intl4x.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
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
name: package:intl4x
permissions: read-all
on:
pull_request:
branches: [ main ]
paths:
- '.github/workflows/intl4x.yml'
- 'pkgs/intl4x/**'
- 'submodules/**'
push:
branches: [ main ]
paths:
- '.github/workflows/intl4x.yml'
- 'pkgs/intl4x/**'
- 'submodules/**'
schedule:
- cron: '0 0 * * 0' # weekly
jobs:
build_checkout:
runs-on: ${{ matrix.os }}
env:
ICU4X_BUILD_MODE: checkout
LOCAL_ICU4X_CHECKOUT: ${{ github.workspace }}/submodules/icu4x
defaults:
run:
working-directory: pkgs/intl4x
strategy:
matrix:
sdk: [dev]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
with:
submodules: true
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
with:
sdk: ${{ matrix.sdk }}
- run: dart --enable-experiment=native-assets pub get
- run: dart --enable-experiment=native-assets analyze --fatal-infos
- run: dart --enable-experiment=native-assets format --output=none --set-exit-if-changed .
- run: dart --enable-experiment=native-assets test
- run: dart --enable-experiment=native-assets test -p chrome
#TODO: Enable for windows and mac https://github.com/dart-lang/native/issues/1376
- name: Compile and run example
if: matrix.os == 'ubuntu-latest'
run: |
cd example_native
dart --enable-experiment=native-assets pub get
dart --enable-experiment=native-assets build bin/example_native.dart
./bin/example_native.exe
build_fetch:
runs-on: ${{ matrix.os }}
env:
ICU4X_BUILD_MODE: fetch
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
defaults:
run:
working-directory: pkgs/intl4x
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
with:
submodules: true
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
with:
sdk: dev
- run: dart --enable-experiment=native-assets pub get
- run: dart --enable-experiment=native-assets test
#TODO: Enable for windows and mac https://github.com/dart-lang/native/issues/1376
- name: Compile and run example
if: matrix.os == 'ubuntu-latest'
run: |
cd example_native
dart --enable-experiment=native-assets pub get
dart --enable-experiment=native-assets build bin/example_native.dart
./bin/example_native.exe
build_local:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
compiletype: [ dynamic, static ]
runs-on: ${{ matrix.os }}
env:
ICU4X_BUILD_MODE: local
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
with:
submodules: true
- name: Install Rust toolchains
run: |
rustup toolchain install stable
- name: Show the selected Rust toolchain
run: rustup show
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
with:
sdk: dev
- name: Build Linux
if: matrix.os == 'ubuntu-latest'
run: |
cd submodules/icu4x
mkdir bin
cd ffi/dart
dart pub get
cd ../..
dart run ffi/dart/tool/build_libs.dart bin/linux_x64 linux_x64 ${{ matrix.compiletype }} icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components,compiled_data
- name: Build Mac
if: matrix.os == 'macos-latest'
run: |
cd submodules/icu4x
mkdir bin
cd ffi/dart
dart pub get
cd ../..
dart run ffi/dart/tool/build_libs.dart bin/macos_arm64 macos_arm64 ${{ matrix.compiletype }} icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components,compiled_data
- name: Build Windows
if: matrix.os == 'windows-latest'
run: |
cd submodules/icu4x
mkdir bin
cd ffi/dart
dart pub get
cd ../..
dart run ffi/dart/tool/build_libs.dart bin/windows_x64 windows_x64 ${{ matrix.compiletype }} icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components,compiled_data
- run: echo "LOCAL_ICU4X_BINARY_DYNAMIC=$(realpath submodules/icu4x/bin/linux_x64)" >> $GITHUB_ENV
if: matrix.os == 'ubuntu-latest' && matrix.compiletype == 'dynamic'
- run: echo "LOCAL_ICU4X_BINARY_STATIC=$(realpath submodules/icu4x/bin/linux_x64)" >> $GITHUB_ENV
if: matrix.os == 'ubuntu-latest' && matrix.compiletype == 'static'
- run: echo "LOCAL_ICU4X_BINARY_DYNAMIC=$(realpath submodules/icu4x/bin/macos_arm64)" >> $GITHUB_ENV
if: matrix.os == 'macos-latest' && matrix.compiletype == 'dynamic'
- run: echo "LOCAL_ICU4X_BINARY_STATIC=$(realpath submodules/icu4x/bin/macos_arm64)" >> $GITHUB_ENV
if: matrix.os == 'macos-latest' && matrix.compiletype == 'static'
- run: echo ("LOCAL_ICU4X_BINARY_DYNAMIC=" + (Get-Item submodules\icu4x\bin\windows_x64).FullName -replace '/', '\') >> $env:GITHUB_ENV
if: matrix.os == 'windows-latest' && matrix.compiletype == 'dynamic'
- run: echo ("LOCAL_ICU4X_BINARY_STATIC=" + (Get-Item submodules\icu4x\bin\windows_x64).FullName -replace '/', '\') >> $env:GITHUB_ENV
if: matrix.os == 'windows-latest' && matrix.compiletype == 'static'
- run: echo $LOCAL_ICU4X_BINARY_DYNAMIC
- run: echo $LOCAL_ICU4X_BINARY_STATIC
- name: Display structure of downloaded files
run: ls -R
- name: Run `dart pub get`
run: |
cd pkgs/intl4x
dart pub get
- name: Run `dart test`
if: matrix.compiletype == 'dynamic'
run: |
cd pkgs/intl4x
dart --enable-experiment=native-assets test
#TODO: Enable for windows and mac https://github.com/dart-lang/native/issues/1376
- name: Compile and run example
if: matrix.os == 'ubuntu-latest' && matrix.compiletype == 'static'
run: |
cd pkgs/intl4x/example_native
dart --enable-experiment=native-assets pub get
dart --enable-experiment=native-assets build bin/example_native.dart
./bin/example_native.exe