Skip to content

Build and Test

Build and Test #124

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
jobs:
# ci-job-check & ci-job-features
# Running at MSRV
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-1, features-2, features-3]
fail-fast: true
# Set CARGO_HTTP_MULTIPLEXING=false to work around crates.io curl bug:
# <https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/timeout.20investigation>
env:
CARGO_HTTP_MULTIPLEXING: false
steps:
- uses: actions/checkout@v4
# 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
# Cargo-all-features boilerplate
- name: Get cargo-all-features version
if: matrix.behavior != 'check'
id: cargo-all-features-version
run: |
echo "hash=$(cargo search cargo-all-features | grep '^cargo-all-features =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-all-features
if: matrix.behavior != 'check'
uses: actions/cache@v3
id: cargo-all-features-cache
with:
path: |
~/.cargo/bin/cargo-all-features
~/.cargo/bin/cargo-all-features.exe
key: ${{ runner.os }}-all-features-${{ steps.cargo-all-features-version.outputs.hash }}
- name: Install cargo-all-features
if: matrix.behavior != 'check' && steps.cargo-all-features-cache.outputs.cache-hit != 'true'
run: cargo +stable install cargo-all-features
# 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@v4
# 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-docs
test-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# 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-test-gigo
test-gigo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# 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-gigo`
run: cargo make ci-job-test-gigo
# ci-job-test-tutorials
test-tutorials:
runs-on: ubuntu-latest
strategy:
matrix:
behavior: [local, cratesio]
fail-fast: false
steps:
- uses: actions/checkout@v4
# 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-source-cache
# Actual job
- name: Run `cargo make ci-job-test-tutorials-${{ matrix.behavior }}`
run: cargo make ci-job-test-tutorials-${{ matrix.behavior }}
# ci-job-testdata
testdata:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
# 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-source-cache
- 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-testdata-legacy
testdata-legacy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# 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
# Cargo-all-features boilerplate
- name: Get cargo-all-features version
id: cargo-all-features-version
run: |
echo "hash=$(cargo search cargo-all-features | grep '^cargo-all-features =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-all-features
uses: actions/cache@v3
id: cargo-all-features-cache
with:
path: |
~/.cargo/bin/cargo-all-features
~/.cargo/bin/cargo-all-features.exe
key: ${{ runner.os }}-all-features-${{ steps.cargo-all-features-version.outputs.hash }}
- name: Install cargo-all-features
if: steps.cargo-all-features-cache.outputs.cache-hit != 'true'
run: cargo +stable install cargo-all-features
# 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-source-cache
# Actual job
- name: Run `cargo make ci-job-testdata-legacy`
run: cargo make ci-job-testdata-legacy
# ci-job-full-datagen
full-datagen:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# 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-source-cache
- name: Install rustfmt
run: rustup component add rustfmt
# Actual job
- name: Run `cargo make ci-job-full-datagen`
run: cargo make ci-job-full-datagen
# ci-job-test-c
test-c:
runs-on: ubuntu-latest
container:
image: rust:bookworm
steps:
- uses: actions/checkout@v4
# Software setup/installation for the container
- name: Install Rust toolchains
run: |
rustup toolchain install stable
# 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
# Since this is inside a container, use a different key than the other jobs
key: ${{ runner.os }}-make-ffi-${{ 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 apt-get update
run: |
apt-get update
- name: Install Clang-15
run: |
apt-get install -y clang-15 lld-15 llvm-15-dev libc++-15-dev
- name: Install GCC 11
run: |
apt-get install -y gcc-11 g++-11
- name: Install jq
run: |
apt-get install -y jq
- name: Attempt to load download cache
uses: actions/cache@v3
with:
key: download-cache
path: /tmp/icu4x-source-cache
# Actual job
- name: Run `cargo make ci-job-test-c`
run: cargo make ci-job-test-c
env:
CXX: "g++-11"
# ci-job-test-js
test-js:
runs-on: ubuntu-latest
container:
image: rust:bookworm
steps:
- uses: actions/checkout@v4
# Software setup/installation for the container
- name: Install Rust toolchains
run: |
rustup toolchain install stable
# 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
# Since this is inside a container, use a different key than the other jobs
key: ${{ runner.os }}-make-ffi-${{ 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 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: Run apt-get update
run: |
apt-get update
- name: Install lld-15
run: |
apt-get install -y lld-15
- name: Install jq
run: |
apt-get install -y jq
# Actual job
- name: Run `cargo make ci-job-test-js`
run: cargo make ci-job-test-js
# ci-job-test-dart
test-dart:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Software setup/installation for the container
- name: Install Rust toolchains
run: |
rustup toolchain install stable
# 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
# Since this is inside a container, use a different key than the other jobs
key: ${{ runner.os }}-make-ffi-${{ 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
- uses: dart-lang/setup-dart@v1
with:
sdk: 3.3.0-279.1.beta
# Actual job
- name: Run `cargo make ci-job-test-dart`
run: cargo make ci-job-test-dart
# ci-job-nostd
nostd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# 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-nostd`
run: cargo make ci-job-nostd
# ci-job-diplomat
diplomat:
runs-on: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v4
# 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-diplomat`
run: cargo make ci-job-diplomat
# ci-job-gn
gn:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# 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: |
docs/tutorials/gn/third_party_tools
key: ${{ runner.os }}-${{ hashFiles('tools/make/gn.toml', 'docs/tutorials/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
- name: Get cargo-rdme version
id: cargo-rdme-version
run: |
echo "hash=$(cargo search cargo-rdme | grep '^cargo-rdme =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-rdme
uses: actions/cache@v3
id: cargo-rdme-cache
with:
path: |
~/.cargo/bin/cargo-rdme
~/.cargo/bin/cargo-rdme.exe
key: ${{ runner.os }}-readme-${{ steps.cargo-rdme-version.outputs.hash }}
- name: Install cargo-rdme
if: steps.cargo-rdme-cache.outputs.cache-hit != 'true'
uses: actions-rs/install@v0.1.2
with:
crate: cargo-rdme
version: latest
# Actual job
- name: Run `cargo make ci-job-gn`
run: cargo make ci-job-gn
# ci-job-fmt
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# 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@v4
# 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-rdme version
id: cargo-rdme-version
run: |
echo "hash=$(cargo search cargo-rdme | grep '^cargo-rdme =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-rdme
uses: actions/cache@v3
id: cargo-rdme-cache
with:
path: |
~/.cargo/bin/cargo-rdme
~/.cargo/bin/cargo-rdme.exe
key: ${{ runner.os }}-readme-${{ steps.cargo-rdme-version.outputs.hash }}
- name: Install cargo-rdme
if: steps.cargo-rdme-cache.outputs.cache-hit != 'true'
uses: actions-rs/install@v0.1.2
with:
crate: cargo-rdme
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@v4
# 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
- name: Run `ci-job-clippy`
run: cargo make ci-job-clippy
# ci-job-doc
doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# 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:
needs: [msrv, test, testdata, testdata-legacy, test-docs, full-datagen, test-c, test-js, test-dart, nostd, diplomat, gn, 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 }}