Skip to content

Not validating tinystr keys #10685

Not validating tinystr keys

Not validating tinystr keys #10685

Workflow file for this run

# This file is part of ICU4X. For terms of use, please see the file
# called LICENSE at the top level of the ICU4X source tree
# (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
name: Build and Test
# Each of these jobs job maps to a `ci-job-foo` entry in Makefile.toml.
# If adding further CI jobs, please add them as makefile targets as well,
# and list them under `ci-all`.
on:
push:
branches: [ main ]
pull_request:
branches: '*'
workflow_dispatch:
inputs:
nightly:
description: "Test on latest nightly"
required: true
default: false
type: boolean
schedule:
# Run nightly cronjob CI every day at 14 UTC / 6AM PST / 3PM CET
- cron: '0 14 * * *'
concurrency:
# Allow one run at a time for PRs, but multiple for other invocations
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
RUST_CACHED_PATH_ROOT: /tmp/icu4x
jobs:
# ci-job-check & ci-job-features
# Running at MSRV (1.61)
msrv:
runs-on: ubuntu-latest
# Defined as a matrix so that features can start immediately, but
# be killed if check fails.
strategy:
matrix:
behavior: [check, features]
fail-fast: true
steps:
- uses: actions/checkout@v3
# Cargo-make boilerplate
- name: Get cargo-make version
id: cargo-make-version
run: |
echo "hash=$(cargo search cargo-make | grep '^cargo-make =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-make
uses: actions/cache@v3
id: cargo-make-cache
with:
path: |
~/.cargo/bin/cargo-make
~/.cargo/bin/cargo-make.exe
key: ${{ runner.os }}-make-${{ steps.cargo-make-version.outputs.hash }}
- name: Install cargo-make
if: steps.cargo-make-cache.outputs.cache-hit != 'true'
run: cargo +stable install cargo-make
# No toolchain boilerplate as this runs on MSRV
# Actual job
- name: Check
run: cargo make ci-job-msrv-${{ matrix.behavior }}
# ci-job-test
test:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
# Cargo-make boilerplate
- name: Get cargo-make version
id: cargo-make-version
run: |
echo "hash=$(cargo search cargo-make | grep '^cargo-make =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-make
uses: actions/cache@v3
id: cargo-make-cache
with:
path: |
~/.cargo/bin/cargo-make
~/.cargo/bin/cargo-make.exe
key: ${{ runner.os }}-make-${{ steps.cargo-make-version.outputs.hash }}
- name: Install cargo-make
if: steps.cargo-make-cache.outputs.cache-hit != 'true'
run: cargo +stable install cargo-make
# Toolchain boilerplate
- name: Potentially override rust version with nightly
run: cargo make set-nightly-version-for-ci
- name: Show the selected Rust toolchain
run: rustup show
# Actual job
- name: Run `cargo make ci-job-test`
run: cargo make ci-job-test
# ci-job-test-cargo-tutorial
test-cargo-tutorial:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Cargo-make boilerplate
- name: Get cargo-make version
id: cargo-make-version
run: |
echo "hash=$(cargo search cargo-make | grep '^cargo-make =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-make
uses: actions/cache@v3
id: cargo-make-cache
with:
path: |
~/.cargo/bin/cargo-make
~/.cargo/bin/cargo-make.exe
key: ${{ runner.os }}-make-${{ steps.cargo-make-version.outputs.hash }}
- name: Install cargo-make
if: steps.cargo-make-cache.outputs.cache-hit != 'true'
run: cargo +stable install cargo-make
# Toolchain boilerplate
- name: Potentially override rust version with nightly
run: cargo make set-nightly-version-for-ci
- name: Show the selected Rust toolchain
run: rustup show
# Job-specific dependencies
- name: Attempt to load download cache
uses: actions/cache@v3
with:
key: download-cache
path: /tmp/icu4x
# Actual job
- name: Run `cargo make ci-job-test-cargo-tutorial`
run: cargo make ci-job-test-cargo-tutorial
# ci-job-testdata
testdata:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
# Cargo-make boilerplate
- name: Get cargo-make version
id: cargo-make-version
run: |
echo "hash=$(cargo search cargo-make | grep '^cargo-make =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-make
uses: actions/cache@v3
id: cargo-make-cache
with:
path: |
~/.cargo/bin/cargo-make
~/.cargo/bin/cargo-make.exe
key: ${{ runner.os }}-make-${{ steps.cargo-make-version.outputs.hash }}
- name: Install cargo-make
if: steps.cargo-make-cache.outputs.cache-hit != 'true'
run: cargo +stable install cargo-make
# Toolchain boilerplate
- name: Potentially override rust version with nightly
run: cargo make set-nightly-version-for-ci
- name: Show the selected Rust toolchain
run: rustup show
# Job-specific dependencies
- name: Attempt to load download cache
uses: actions/cache@v3
with:
key: download-cache
path: /tmp/icu4x
- name: Install rustfmt
run: rustup component add rustfmt
# Actual job
- name: Run `cargo make ci-job-testdata`
run: cargo make ci-job-testdata
# ci-job-test-docs
test-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Cargo-make boilerplate
- name: Get cargo-make version
id: cargo-make-version
run: |
echo "hash=$(cargo search cargo-make | grep '^cargo-make =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-make
uses: actions/cache@v3
id: cargo-make-cache
with:
path: |
~/.cargo/bin/cargo-make
~/.cargo/bin/cargo-make.exe
key: ${{ runner.os }}-make-${{ steps.cargo-make-version.outputs.hash }}
- name: Install cargo-make
if: steps.cargo-make-cache.outputs.cache-hit != 'true'
run: cargo +stable install cargo-make
# Toolchain boilerplate
- name: Potentially override rust version with nightly
run: cargo make set-nightly-version-for-ci
- name: Show the selected Rust toolchain
run: rustup show
# Actual job
- name: Run `cargo make ci-job-test-docs`
run: cargo make ci-job-test-docs
# ci-job-full-datagen
full-datagen:
needs: [testdata]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Cargo-make boilerplate
- name: Get cargo-make version
id: cargo-make-version
run: |
echo "hash=$(cargo search cargo-make | grep '^cargo-make =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-make
uses: actions/cache@v3
id: cargo-make-cache
with:
path: |
~/.cargo/bin/cargo-make
~/.cargo/bin/cargo-make.exe
key: ${{ runner.os }}-make-${{ steps.cargo-make-version.outputs.hash }}
- name: Install cargo-make
if: steps.cargo-make-cache.outputs.cache-hit != 'true'
run: cargo +stable install cargo-make
# Toolchain boilerplate
- name: Potentially override rust version with nightly
run: cargo make set-nightly-version-for-ci
- name: Show the selected Rust toolchain
run: rustup show
# Job-specific dependencies
- name: Attempt to load download cache
uses: actions/cache@v3
with:
key: download-cache
path: /tmp/icu4x
# Actual job
- name: Run `cargo make ci-job-full-datagen`
run: cargo make ci-job-full-datagen
# ci-job-ffi
ffi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Cargo-make boilerplate
- name: Get cargo-make version
id: cargo-make-version
run: |
echo "hash=$(cargo search cargo-make | grep '^cargo-make =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-make
uses: actions/cache@v3
id: cargo-make-cache
with:
path: |
~/.cargo/bin/cargo-make
~/.cargo/bin/cargo-make.exe
key: ${{ runner.os }}-make-${{ steps.cargo-make-version.outputs.hash }}
- name: Install cargo-make
if: steps.cargo-make-cache.outputs.cache-hit != 'true'
run: cargo +stable install cargo-make
# Toolchain boilerplate
- name: Potentially override rust version with nightly
run: cargo make set-nightly-version-for-ci
- name: Show the selected Rust toolchain
run: rustup show
# Job-specific dependencies
- name: Set up Clang-14
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 14
- name: Install Node.js v16.18.0
uses: actions/setup-node@v3
with:
node-version: 16.18.0
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: Attempt to load download cache
uses: actions/cache@v3
with:
key: download-cache
path: /tmp/icu4x
- name: Warm up datagen
# We do this so its compilation doesn't go on the time bugdet of the
# first test that uses it.
run: cargo build -p icu_datagen
# Actual job
- name: Run `cargo make ci-job-ffi`
run: cargo make ci-job-ffi
env:
CXX: "g++-10"
# ci-job-verify-ffi
verify-ffi:
runs-on: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v3
# Cargo-make boilerplate
- name: Get cargo-make version
id: cargo-make-version
run: |
echo "hash=$(cargo search cargo-make | grep '^cargo-make =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-make
uses: actions/cache@v3
id: cargo-make-cache
with:
path: |
~/.cargo/bin/cargo-make
~/.cargo/bin/cargo-make.exe
key: ${{ runner.os }}-make-${{ steps.cargo-make-version.outputs.hash }}
- name: Install cargo-make
if: steps.cargo-make-cache.outputs.cache-hit != 'true'
run: cargo +stable install cargo-make
# Toolchain boilerplate
- name: Potentially override rust version with nightly
run: cargo make set-nightly-version-for-ci
- name: Show the selected Rust toolchain
run: rustup show
# Job-specific dependencies
- name: Run diplomat-get-rev to ensure it works
id: diplomat-getrev-check
run: cargo make --loglevel error diplomat-get-rev
- name: Get Diplomat version
id: diplomat-version
run: |
echo "::set-output name=rev::$(cargo make --loglevel error diplomat-get-rev | tr -d '[:space:]')"
shell: bash
- name: Attempt to load cached Diplomat
uses: actions/cache@v3
id: diplomat-cache
with:
path: |
~/.cargo/bin/diplomat-tool
~/.cargo/bin/diplomat-tool.exe
key: ${{ runner.os }}-diplomat-${{ steps.diplomat-version.outputs.rev }}
- name: Install Diplomat (git hash)
if: steps.diplomat-cache.outputs.cache-hit != 'true' && !contains(steps.diplomat-version.outputs.rev, '.')
run: cargo +stable install --git https://github.com/rust-diplomat/diplomat.git --rev ${{ steps.diplomat-version.outputs.rev }} diplomat-tool
- name: Install Diplomat (versioned)
if: steps.diplomat-cache.outputs.cache-hit != 'true' && contains(steps.diplomat-version.outputs.rev, '.')
run: cargo +stable install --git https://github.com/rust-diplomat/diplomat.git --version ${{ steps.diplomat-version.outputs.rev }} diplomat-tool
# Actual job
- name: Run `cargo make ci-job-verify-ffi`
run: cargo make ci-job-verify-ffi
# ci-job-verify-gn, ci-job-gn
gn:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Cargo-make boilerplate
- name: Get cargo-make version
id: cargo-make-version
run: |
echo "hash=$(cargo search cargo-make | grep '^cargo-make =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-make
uses: actions/cache@v3
id: cargo-make-cache
with:
path: |
~/.cargo/bin/cargo-make
~/.cargo/bin/cargo-make.exe
key: ${{ runner.os }}-make-${{ steps.cargo-make-version.outputs.hash }}
- name: Install cargo-make
if: steps.cargo-make-cache.outputs.cache-hit != 'true'
run: cargo +stable install cargo-make
# Toolchain boilerplate
- name: Potentially override rust version with nightly
run: cargo make set-nightly-version-for-ci
- name: Show the selected Rust toolchain
run: rustup show
# Job-specific dependencies
- name: Attempt to load cached GN Third-Party Tools
uses: actions/cache@v3
id: gn-third-party-tools-cache
with:
path: |
ffi/gn/third_party_tools
key: ${{ runner.os }}-${{ hashFiles('tools/make/gn.toml', 'ffi/gn/Cargo.lock') }}
- name: Install GN Third-Party Tools
if: steps.gn-third-party-tools-cache.outputs.cache-hit != 'true'
run: cargo make gn-install
# Actual job
- name: Run `cargo make ci-job-verify-gn`
run: cargo make ci-job-verify-gn
- name: Run `cargo make ci-job-gn`
run: cargo make ci-job-gn
# ci-job-wasm
wasm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Cargo-make boilerplate
- name: Get cargo-make version
id: cargo-make-version
run: |
echo "hash=$(cargo search cargo-make | grep '^cargo-make =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-make
uses: actions/cache@v3
id: cargo-make-cache
with:
path: |
~/.cargo/bin/cargo-make
~/.cargo/bin/cargo-make.exe
key: ${{ runner.os }}-make-${{ steps.cargo-make-version.outputs.hash }}
- name: Install cargo-make
if: steps.cargo-make-cache.outputs.cache-hit != 'true'
run: cargo +stable install cargo-make
# Toolchain boilerplate
- name: Potentially override rust version with nightly
run: cargo make set-nightly-version-for-ci
- name: Show the selected Rust toolchain
run: rustup show
# Job-specific dependencies
- name: Install emsdk
run: |
cd ~
git clone https://github.com/emscripten-core/emsdk.git --branch 2.0.27
cd emsdk
./emsdk install latest
./emsdk activate latest
- name: Install Node.js v16.18.0
uses: actions/setup-node@v3
with:
node-version: 16.18.0
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
# Actual job
- name: Run emscripten/wasm test
run: |
. ~/emsdk/emsdk_env.sh
cargo make ci-job-wasm
# ci-job-fmt
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Cargo-make boilerplate
- name: Get cargo-make version
id: cargo-make-version
run: |
echo "hash=$(cargo search cargo-make | grep '^cargo-make =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-make
uses: actions/cache@v3
id: cargo-make-cache
with:
path: |
~/.cargo/bin/cargo-make
~/.cargo/bin/cargo-make.exe
key: ${{ runner.os }}-make-${{ steps.cargo-make-version.outputs.hash }}
- name: Install cargo-make
if: steps.cargo-make-cache.outputs.cache-hit != 'true'
run: cargo +stable install cargo-make
# Toolchain boilerplate
- name: Potentially override rust version with nightly
run: cargo make set-nightly-version-for-ci
- name: Show the selected Rust toolchain
run: rustup show
# Job-specific dependencies
- name: Install rustfmt
run: rustup component add rustfmt
# Actual job
- name: Check Format
run: cargo make ci-job-fmt
# ci-job-tidy
tidy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Cargo-make boilerplate
- name: Get cargo-make version
id: cargo-make-version
run: |
echo "hash=$(cargo search cargo-make | grep '^cargo-make =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-make
uses: actions/cache@v3
id: cargo-make-cache
with:
path: |
~/.cargo/bin/cargo-make
~/.cargo/bin/cargo-make.exe
key: ${{ runner.os }}-make-${{ steps.cargo-make-version.outputs.hash }}
- name: Install cargo-make
if: steps.cargo-make-cache.outputs.cache-hit != 'true'
run: cargo +stable install cargo-make
# Toolchain boilerplate
- name: Potentially override rust version with nightly
run: cargo make set-nightly-version-for-ci
- name: Show the selected Rust toolchain
run: rustup show
# Job-specific dependencies
- name: Get cargo-readme version
id: cargo-readme-version
run: |
echo "::set-output name=hash::$(cargo search cargo-readme | grep '^cargo-readme =' | md5sum)"
shell: bash
- name: Attempt to load cached cargo-readme
uses: actions/cache@v3
id: cargo-readme-cache
with:
path: |
~/.cargo/bin/cargo-readme
~/.cargo/bin/cargo-readme.exe
key: ${{ runner.os }}-readme-${{ steps.cargo-readme-version.outputs.hash }}
- name: Install cargo-readme
if: steps.cargo-readme-cache.outputs.cache-hit != 'true'
uses: actions-rs/[email protected]
with:
crate: cargo-readme
version: latest
# Actual job
- name: Tidy
run: cargo make ci-job-tidy
# ci-job-clippy
clippy:
# We don't expect to be clippy-clean on nightly cronjob.
if: ${{ github.event_name != 'schedule' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Cargo-make boilerplate
- name: Get cargo-make version
id: cargo-make-version
run: |
echo "hash=$(cargo search cargo-make | grep '^cargo-make =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-make
uses: actions/cache@v3
id: cargo-make-cache
with:
path: |
~/.cargo/bin/cargo-make
~/.cargo/bin/cargo-make.exe
key: ${{ runner.os }}-make-${{ steps.cargo-make-version.outputs.hash }}
- name: Install cargo-make
if: steps.cargo-make-cache.outputs.cache-hit != 'true'
run: cargo +stable install cargo-make
# Toolchain boilerplate
- name: Potentially override rust version with nightly
run: cargo make set-nightly-version-for-ci
- name: Show the selected Rust toolchain
run: rustup show
# Job-specific dependencies
- name: Install clippy
run: rustup component add clippy
# Actual job
# Note: this does not use ci-job-clippy, as the GH Action can create code
# annotations (although not in PRs: https://github.com/actions-rs/clippy-check/issues/2)
- uses: actions-rs/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
# keep args in sync with `clippy-all` in .cargo/config.toml
args: --all-targets --all-features -- -D warnings
# ci-job-doc
doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Cargo-make boilerplate
- name: Get cargo-make version
id: cargo-make-version
run: |
echo "hash=$(cargo search cargo-make | grep '^cargo-make =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-make
uses: actions/cache@v3
id: cargo-make-cache
with:
path: |
~/.cargo/bin/cargo-make
~/.cargo/bin/cargo-make.exe
key: ${{ runner.os }}-make-${{ steps.cargo-make-version.outputs.hash }}
- name: Install cargo-make
if: steps.cargo-make-cache.outputs.cache-hit != 'true'
run: cargo +stable install cargo-make
# Toolchain boilerplate
- name: Potentially override rust version with nightly
run: cargo make set-nightly-version-for-ci
- name: Show the selected Rust toolchain
run: rustup show
# Actual job
- name: Cargo doc
run: cargo make ci-job-doc
# Notify on slack
notify-slack:
# Skipped tasks: bench-perf, bench-memory, bench-binsize, bench-datasize
needs: [msrv, test, testdata, test-docs, full-datagen, ffi, verify-ffi, gn, wasm, fmt, tidy, clippy, doc]
if: ${{ always() && contains(needs.*.result, 'failure') && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref_name == 'main')) }}
runs-on: ubuntu-latest
steps:
- name: Notify slack of failure
uses: ravsamhq/notify-slack-action@v1
with:
notify_when: failure
status: failure # We do the filtering earlier
notification_title: ''
message_format: ${{ format('{{emoji}} {0} CI failed!' , ((github.event_name == 'schedule') && 'Nightly' || (github.event_name == 'push') && 'Main' || 'Manually dispatched')) }}
footer: '<{run_url}|View failure> | <https://github.com/unicode-org/icu4x/actions?query=event%3A${{ github.event_name }}|CI history for `${{ github.event_name }}`>'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}