swift-foundation-icu-demo #20
This file contains hidden or 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: swift-foundation-icu-demo | |
| on: | |
| push: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| pull_request: | |
| branches: | |
| - '*' | |
| jobs: | |
| InternationalizationBenchmarks: | |
| #runs-on: ubuntu-24.04 | |
| runs-on: macos-15 | |
| timeout-minutes: 30 | |
| steps: | |
| - name: "Checkout swift-foundation-icu-demo" | |
| uses: actions/checkout@v4 | |
| with: | |
| path: swift-foundation-icu-demo | |
| - name: "Checkout swift-foundation" | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: swiftlang/swift-foundation | |
| path: swift-foundation | |
| - name: "Checkout swift-corelibs-foundation" | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: swiftlang/swift-corelibs-foundation | |
| path: swift-corelibs-foundation | |
| - name: "Checkout swift-collections" | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: apple/swift-collections | |
| path: swift-collections | |
| - name: "Checkout swift-syntax" | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: apple/swift-syntax | |
| path: swift-syntax | |
| - name: "Checkout swift-foundation-icu" | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: swiftlang/swift-foundation-icu | |
| path: swift-foundation-icu | |
| - name: "Test swift-foundation-icu-demo" | |
| working-directory: swift-foundation-icu-demo | |
| run: LC_ALL=en_US_POSIX swift test | |
| - name: "Apply swift-foundation-icu PR #53" | |
| working-directory: swift-foundation-icu | |
| run: gh pr checkout 53 | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| - name: "Patch swift-foundation-icu to use ICU data file" | |
| working-directory: swift-foundation-icu | |
| run: perl -pi -e 's/"USE_PACKAGE_DATA"/"DISABLED_USE_PACKAGE_DATA"/g' Package.swift && cat Package.swift | |
| - name: "Test swift-foundation-icu-demo with ICU data file" | |
| working-directory: swift-foundation-icu-demo | |
| run: ICU_DATA_DIR_PREFIX=${{ github.workspace }}/swift-foundation-icu-demo/LOCALE_DATA LC_ALL=en_US_POSIX swift test | |
| - name: "Verify that ICU data file is being used" | |
| working-directory: swift-foundation-icu-demo | |
| run: | | |
| mv LOCALE_DATA/usr/share/icu/icudt76l.dat LOCALE_DATA/usr/share/icu/icudt76l.dat.old | |
| echo '' > LOCALE_DATA/usr/share/icu/icudt76l.dat | |
| # should fail after we clobber the data file | |
| ICU_DATA_DIR_PREFIX=${{ github.workspace }}/swift-foundation-icu-demo/LOCALE_DATA LC_ALL=en_US_POSIX swift test || true | |
| # move the data file back | |
| mv LOCALE_DATA/usr/share/icu/icudt76l.dat.old LOCALE_DATA/usr/share/icu/icudt76l.dat | |
| - name: "Build Foundation" | |
| working-directory: swift-foundation | |
| run: SWIFTCI_USE_LOCAL_DEPS=.. swift build | |
| - name: "Run Foundation InternationalizationBenchmarks" | |
| working-directory: swift-foundation/Benchmarks | |
| run: SWIFTCI_USE_LOCAL_DEPS=.. LC_ALL=en_US_POSIX swift run InternationalizationBenchmarks | |