Add link hook to package:intl4x
#462
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
- name: Compile and run example | |
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 | |
- name: Compile and run example | |
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` | |
run: | | |
cd pkgs/intl4x | |
dart --enable-experiment=native-assets test | |
- name: Compile and run example | |
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 |