Skip to content

Commit

Permalink
Merge branch 'main' into chinese-fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
atcupps committed Aug 7, 2023
2 parents fb2d2e0 + 2c1a71a commit e29f54c
Show file tree
Hide file tree
Showing 300 changed files with 3,664 additions and 19,216 deletions.
92 changes: 44 additions & 48 deletions .github/workflows/artifacts-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ permissions:

env:
GCP_PROJECT_ID: "dev-infra-273822"
GCP_BUCKET_ID: "icu4x-pr-artifacts"
GCP_PR_BUCKET_ID: "icu4x-pr-artifacts"
GCP_MAIN_BUCKET_ID: "icu4x-main"

jobs:
credentials:
Expand Down Expand Up @@ -86,11 +87,11 @@ jobs:
- name: Upload docs to Google Cloud Storage
run: |
gsutil -m cp -r target/doc gs://${{ env.GCP_BUCKET_ID }}/gha/${{ github.sha }}/docs
gsutil -m cp -r target/doc gs://${{ env.GCP_PR_BUCKET_ID }}/gha/${{ github.sha }}/docs
- name: "⭐⭐⭐ Links to Uploaded Artifacts ⭐⭐⭐"
run: |
echo "::group::📖 Docs Preview"
echo "http://${{ env.GCP_BUCKET_ID }}.storage.googleapis.com/gha/${{ github.sha }}/docs/icu/index.html"
echo "http://${{ env.GCP_PR_BUCKET_ID }}.storage.googleapis.com/gha/${{ github.sha }}/docs/icu/index.html"
echo "::endgroup::"
ffi-docs:
Expand Down Expand Up @@ -133,16 +134,16 @@ jobs:
- name: Upload docs to Google Cloud Storage
run: |
gsutil -m cp -r ffi/diplomat/cpp/docs/build/html gs://${{ env.GCP_BUCKET_ID }}/gha/${{ github.sha }}/ffi/cpp
gsutil -m cp -r ffi/diplomat/js/docs/build/html gs://${{ env.GCP_BUCKET_ID }}/gha/${{ github.sha }}/ffi/js
gsutil -m cp -r ffi/diplomat/cpp/docs/build/html gs://${{ env.GCP_PR_BUCKET_ID }}/gha/${{ github.sha }}/ffi/cpp
gsutil -m cp -r ffi/diplomat/js/docs/build/html gs://${{ env.GCP_PR_BUCKET_ID }}/gha/${{ github.sha }}/ffi/js
- name: "⭐⭐⭐ Links to Uploaded Artifacts ⭐⭐⭐"
run: |
echo "::group::📖 CPP Docs Preview"
echo "http://${{ env.GCP_BUCKET_ID }}.storage.googleapis.com/gha/${{ github.sha }}/ffi/cpp/index.html"
echo "http://${{ env.GCP_PR_BUCKET_ID }}.storage.googleapis.com/gha/${{ github.sha }}/ffi/cpp/index.html"
echo "::endgroup::"
echo "::group::📖 JS Docs Preview"
echo "http://${{ env.GCP_BUCKET_ID }}.storage.googleapis.com/gha/${{ github.sha }}/ffi/js/index.html"
echo "http://${{ env.GCP_PR_BUCKET_ID }}.storage.googleapis.com/gha/${{ github.sha }}/ffi/js/index.html"
echo "::endgroup::"
wasm-demo:
Expand Down Expand Up @@ -189,8 +190,8 @@ jobs:
- name: Upload wasm-demo bundle to Google Cloud Storage
run: |
# gsutil cors set ffi/diplomat/js/examples/wasm-demo/cors-config-file.json gs://${{ env.GCP_BUCKET_ID }}
gsutil -m cp -r ffi/diplomat/js/examples/wasm-demo/dist/ gs://${{ env.GCP_BUCKET_ID }}/gha/${{ github.sha }}/wasm-demo
# gsutil cors set ffi/diplomat/js/examples/wasm-demo/cors-config-file.json gs://${{ env.GCP_PR_BUCKET_ID }}
gsutil -m cp -r ffi/diplomat/js/examples/wasm-demo/dist/ gs://${{ env.GCP_PR_BUCKET_ID }}/gha/${{ github.sha }}/wasm-demo
- name: "⭐⭐⭐ Links to Uploaded Artifacts ⭐⭐⭐"
run: |
Expand Down Expand Up @@ -222,8 +223,6 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2

# GCP Boilerplate for jobs in main repository
- id: gcp-auth
Expand Down Expand Up @@ -265,9 +264,7 @@ jobs:
- name: Download previous benchmark data
run: |
# We're on main, so the previous run is the parent.
export BASELINE=$(git log --pretty=format:'%H' -1 -r HEAD^)
gsutil -m cp -rn gs://${{ env.GCP_BUCKET_ID }}/gha/$BASELINE/benchmarks/perf/${{ matrix.component }}/* benchmarks/perf/${{ matrix.component }}
gsutil -m cp -rn gs://${{ env.GCP_MAIN_BUCKET_ID }}/gha/benchmarks/perf/${{ matrix.component }}/* benchmarks/perf/${{ matrix.component }}
- name: Store benchmark result & create dashboard
uses: rhysd/[email protected]
Expand All @@ -288,7 +285,7 @@ jobs:
if: success() || failure()
run: |
git checkout empty
gsutil -m cp -r benchmarks/perf/${{ matrix.component }} gs://${{ env.GCP_BUCKET_ID }}/gha/${{ github.sha }}/benchmarks/perf/${{ matrix.component }}
gsutil -m cp -r benchmarks/perf/${{ matrix.component }} gs://${{ env.GCP_PR_BUCKET_ID }}/gha/${{ github.sha }}/benchmarks/perf/${{ matrix.component }}
# Run examples with dhat-rs in order to collect memory heap size metrics. These
# metrics will then be charted over time. See tools/benchmark/memory/README.md for
Expand Down Expand Up @@ -343,8 +340,6 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2

# GCP Boilerplate for jobs in main repository
- id: gcp-auth
Expand Down Expand Up @@ -381,18 +376,8 @@ jobs:
cargo run --package icu_benchmark_memory -- --os ${{ matrix.os }} ${{ matrix.examples }}
- name: Download previous benchmark data
if: matrix.os != 'windows-latest'
run: |
# We're on main, so the previous run is the parent.
export BASELINE=$(git log --pretty=format:'%H' -1 -r HEAD^)
gsutil -m cp -rn gs://${{ env.GCP_BUCKET_ID }}/gha/$BASELINE/benchmarks/memory/${{ matrix.os }} benchmarks/memory
- name: Download previous benchmark data
if: matrix.os == 'windows-latest'
run: |
# We're on main, so the previous run is the parent.
$BASELINE = git log --pretty=format:'%H' -1 -r HEAD^
gsutil -m cp -rn gs://${{ env.GCP_BUCKET_ID }}/gha/$BASELINE/benchmarks/memory/${{ matrix.os }} benchmarks/memory
gsutil -m cp -rn gs://${{ env.GCP_MAIN_BUCKET_ID }}/gha/benchmarks/memory/${{ matrix.os }} benchmarks/memory
- name: Store benchmark result & create dashboard
# The gregtatum fork of rhysd/github-action-benchmark contains support for ndjson.
Expand All @@ -416,7 +401,7 @@ jobs:
if: success() || failure()
run: |
git checkout empty
gsutil -m cp -r benchmarks/memory/${{ matrix.os }} gs://${{ env.GCP_BUCKET_ID }}/gha/${{ github.sha }}/benchmarks/memory/${{ matrix.os }}
gsutil -m cp -r benchmarks/memory/${{ matrix.os }} gs://${{ env.GCP_PR_BUCKET_ID }}/gha/${{ github.sha }}/benchmarks/memory/${{ matrix.os }}
# Binary size benchmark: build and size wasm binaries; creates ndjson output data format
bench-binsize:
Expand All @@ -430,8 +415,6 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2

# GCP Boilerplate for jobs in main repository
- id: gcp-auth
Expand Down Expand Up @@ -478,7 +461,10 @@ jobs:
run: cargo make wasm-opt

- name: gzip wasm executables
run: (cd wasmpkg/wasm-opt && gzip -k *+opt.wasm)
run: |
cd wasmpkg/wasm-opt
gzip -k *+opt.wasm
cd ../..
- name: Setup output data directory
run: |
Expand All @@ -496,9 +482,7 @@ jobs:
- name: Download previous benchmark data
run: |
mkdir -p benchmarks/binsize
# We're on main, so the previous run is the parent.
export BASELINE=$(git log --pretty=format:'%H' -1 -r HEAD^)
gsutil -m cp -rn gs://${{ env.GCP_BUCKET_ID }}/gha/$BASELINE/benchmarks/binsize benchmarks/binsize
gsutil -m cp -rn gs://${{ env.GCP_MAIN_BUCKET_ID }}/gha/benchmarks/binsize benchmarks/binsize
- name: Store benchmark result & create dashboard (wasm)
# Use gregtatum special feature to process ndjson-formatted benchmark data
Expand Down Expand Up @@ -536,7 +520,7 @@ jobs:
if: success() || failure()
run: |
git checkout empty
gsutil -m cp -r benchmarks/binsize/ gs://${{ env.GCP_BUCKET_ID }}/gha/${{ github.sha }}/benchmarks/binsize
gsutil -m cp -r benchmarks/binsize/ gs://${{ env.GCP_PR_BUCKET_ID }}/gha/${{ github.sha }}/benchmarks/binsize
# Data size benchmark: track size of provider/datagen/tests/data/testdata.postcard (total data size).
bench-datasize:
Expand All @@ -549,8 +533,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2

# GCP Boilerplate for jobs in main repository
- id: gcp-auth
Expand All @@ -562,6 +544,10 @@ jobs:
- name: "Set up Google Cloud SDK"
uses: google-github-actions/setup-gcloud@v1

- name: Install rustfmt
run: |
rustup component add rustfmt
- name: Setup output data directory
run: |
mkdir -p benchmarks/datasize
Expand All @@ -577,9 +563,7 @@ jobs:
- name: Download previous benchmark data
run: |
mkdir -p benchmarks
# We're on main, so the previous run is the parent.
export BASELINE=$(git log --pretty=format:'%H' -1 -r HEAD^)
gsutil -m cp -rn gs://${{ env.GCP_BUCKET_ID }}/gha/$BASELINE/benchmarks/datasize benchmarks
gsutil -m cp -rn gs://${{ env.GCP_MAIN_BUCKET_ID }}/gha/benchmarks/datasize benchmarks
- name: Store benchmark result & create dashboard
# Use gregtatum special feature to process ndjson-formatted benchmark data
Expand All @@ -600,10 +584,10 @@ jobs:
if: success() || failure()
run: |
git checkout empty
gsutil -m cp -r benchmarks/datasize/ gs://${{ env.GCP_BUCKET_ID }}/gha/${{ github.sha }}/benchmarks/datasize
gsutil -m cp -r benchmarks/datasize/ gs://${{ env.GCP_PR_BUCKET_ID }}/gha/${{ github.sha }}/benchmarks/datasize
gh-pages:
name: "Copy artifacts to gh-pages branch"
name: "Deploy to GitHub Pages"
needs: [docs, ffi-docs, wasm-demo, bench-perf, bench-memory, bench-datasize] # bench-binsize
# Run this even when one of the above jobs failed. This is so we can at least push the other artifacts.
if: (success() || failure()) && (github.ref == 'refs/heads/main' && github.repository == 'unicode-org/icu4x')
Expand All @@ -613,14 +597,26 @@ jobs:
cancel-in-progress: true
steps:
- uses: actions/checkout@v3
# GCP Boilerplate for jobs in main repository
- id: gcp-auth
name: "Authenticate to Google Cloud with Workload Identity Provider"
uses: google-github-actions/auth@v1
with:
workload_identity_provider: "projects/66042061814/locations/global/workloadIdentityPools/icu4x-gha-pool1/providers/icu4x-gha-provider1"
service_account: "[email protected]"
- name: "Set up Google Cloud SDK"
uses: google-github-actions/setup-gcloud@v1
- name: Download artifacts
run: |
gsutil -m cp -rn gs://${{ env.GCP_BUCKET_ID }}/gha/${{ github.sha }}/benchmarks tools/website-skeleton/ || true
gsutil -m cp -rn gs://${{ env.GCP_BUCKET_ID }}/gha/${{ github.sha }}/docs tools/website-skeleton || true
gsutil -m cp -rn gs://${{ env.GCP_PR_BUCKET_ID }}/gha/${{ github.sha }}/benchmarks tools/website-skeleton/ || true
gsutil -m cp -rn gs://${{ env.GCP_PR_BUCKET_ID }}/gha/${{ github.sha }}/docs tools/website-skeleton || true
mkdir -p tools/website-skeleton/docs/ffi
gsutil -m cp -r gs://${{ env.GCP_BUCKET_ID }}/gha/${{ github.sha }}/ffi/cpp tools/website-skeleton/docs/ffi || true
gsutil -m cp -r gs://${{ env.GCP_BUCKET_ID }}/gha/${{ github.sha }}/ffi/js tools/website-skeleton/docs/ffi || true
gsutil -m cp -r gs://${{ env.GCP_BUCKET_ID }}/gha/${{ github.sha }}/wasm-demo tools/website-skeleton/ || true
gsutil -m cp -r gs://${{ env.GCP_PR_BUCKET_ID }}/gha/${{ github.sha }}/ffi/cpp tools/website-skeleton/docs/ffi || true
gsutil -m cp -r gs://${{ env.GCP_PR_BUCKET_ID }}/gha/${{ github.sha }}/ffi/js tools/website-skeleton/docs/ffi || true
gsutil -m cp -r gs://${{ env.GCP_PR_BUCKET_ID }}/gha/${{ github.sha }}/wasm-demo tools/website-skeleton/ || true
- name: Upload to main bucket
run: |
gsutil -m cp -r gs://${{ env.GCP_PR_BUCKET_ID}}/gha/${{ github.sha }} gs://${{ env.GCP_MAIN_BUCKET_ID }}/gha/
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
Expand Down
36 changes: 15 additions & 21 deletions .github/workflows/artifacts-info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,24 @@ jobs:
runs-on: "ubuntu-latest"
env:
GCP_PROJECT_ID: "dev-infra-273822"
GCP_BUCKET_ID: "icu4x-pr-artifacts"
GCP_PR_BUCKET_ID: "icu4x-pr-artifacts"
steps:
- name: "⭐⭐⭐ Links to Uploaded Artifacts ⭐⭐⭐"
run: |
echo "::group::🔒 Credentials Info"
echo "🔒 Credentials Info"
echo "The following artifacts are built and uploaded in forks containing the ICU4X service account key. If you are a frequent contributor, see 'artifacts-build.yml' for instructions on setting up the key."
echo "::endgroup::"
echo "::group::📖 Docs Preview"
echo "View the docs preview at:"
echo "http://${{ env.GCP_BUCKET_ID }}.storage.googleapis.com/gha/${{ github.event.pull_request.head.sha }}/docs/icu/index.html"
echo "::group::📖 CPP Docs Preview"
echo "http://${{ env.GCP_BUCKET_ID }}.storage.googleapis.com/gha/${{ github.event.pull_request.head.sha }}/ffi/cpp/index.html"
echo "::endgroup::"
echo "::group::📖 JS Docs Preview"
echo "http://${{ env.GCP_BUCKET_ID }}.storage.googleapis.com/gha/${{ github.event.pull_request.head.sha }}/ffi/js/index.html"
echo "::endgroup::"
echo "::endgroup::"
echo "::group::Wasm Demo Preview"
echo "http://${{ env.GCP_BUCKET_ID }}.storage.googleapis.com/gha/${{ github.event.pull_request.head.sha }}/wasm-demo/index.html"
echo "::endgroup::"
echo
echo "📖 Docs Preview"
echo "http://${{ env.GCP_PR_BUCKET_ID }}.storage.googleapis.com/gha/${{ github.event.pull_request.head.sha }}/docs/icu/index.html"
echo
echo "📖 CPP Docs Preview"
echo "http://${{ env.GCP_PR_BUCKET_ID }}.storage.googleapis.com/gha/${{ github.event.pull_request.head.sha }}/ffi/cpp/index.html"
echo
echo "📖 JS Docs Preview"
echo "http://${{ env.GCP_PR_BUCKET_ID }}.storage.googleapis.com/gha/${{ github.event.pull_request.head.sha }}/ffi/js/index.html"
echo
echo "🌐 Wasm Demo Preview (main only)"
echo "http://${{ env.GCP_PR_BUCKET_ID }}.storage.googleapis.com/gha/${{ github.event.pull_request.head.sha }}/wasm-demo/index.html"
echo
echo "The links will be available after the following job completes:"
echo "${{ github.event.pull_request.head.repo.html_url }}/actions/workflows/artifacts-build.yml"
6 changes: 0 additions & 6 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@ jobs:
- name: Show the selected Rust toolchain
run: rustup show

# Job-specific dependencies
- name: Install rustfmt
run: rustup component add rustfmt

# Actual job
- name: Run `cargo make ci-job-test`
run: cargo make ci-job-test
Expand Down Expand Up @@ -215,8 +211,6 @@ jobs:
with:
key: download-cache
path: /tmp/icu4x-source-cache
- name: Install rustfmt
run: rustup component add rustfmt

# Actual job
- name: Run `cargo make ci-job-testdata`
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions components/calendar/src/any_calendar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ impl Calendar for AnyCalendar {
}

impl AnyCalendar {
/// Constructs an AnyCalendar for a given calendar kind.
/// Constructs an AnyCalendar for a given calendar kind from compiled data.
///
/// As this requires a valid [`AnyCalendarKind`] to work, it does not do any kind of locale-based
/// fallbacking. If this is desired, use [`Self::new_for_locale()`].
Expand Down Expand Up @@ -557,7 +557,7 @@ impl AnyCalendar {
})
}

/// Constructs an AnyCalendar for a given calendar kind.
/// Constructs an AnyCalendar for a given calendar kind from compiled data.
///
/// In case the locale's calendar is unknown or unspecified, it will attempt to load the default
/// calendar for the locale, falling back to gregorian.
Expand Down
Loading

0 comments on commit e29f54c

Please sign in to comment.