Merge pull request #860 from googlefonts/ttx-diff-refactor-1 #2342
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
on: | |
pull_request: | |
merge_group: | |
push: | |
branches: | |
- main | |
tags: | |
- "*" | |
name: Continuous integration | |
# The check, clippy-lint, and test-stable-* jobs should typically be direct copies from | |
# https://github.com/googlefonts/fontations/blob/main/.github/workflows/rust.yml. | |
# other than the list of crates for cargo check no std | |
jobs: | |
check: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: install stable toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: rustup component add rustfmt | |
run: rustup component add rustfmt | |
- name: rustfmt check | |
run: cargo fmt --all -- --check | |
# ensure that docs are sane (links are reachable etc) | |
- name: cargo doc | |
run: cargo doc --all-features --document-private-items --no-deps | |
env: | |
RUSTDOCFLAGS: -D warnings | |
- name: check no println! or eprintln! statements | |
run: resources/scripts/check_no_println.sh | |
clippy-lint: | |
name: Clippy lints | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: install stable toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: cargo clippy --all-features | |
run: cargo clippy --all-features --all-targets -- -D warnings | |
- name: cargo clippy --no-default-features | |
run: cargo clippy --all-targets --no-default-features -- -D warnings | |
# test all packages individually to ensure deterministic resolution | |
# of dependencies for each package | |
# Try to group our tests into sets of crates that take roughly equal time to run | |
# so we get concurrent execution on multiple runners | |
test-stable-fontbe: | |
name: fontbe tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: install stable toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: cargo test fontbe | |
run: cargo test -p fontbe --all-targets --all-features | |
test-stable-fontc: | |
name: fontc tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: install stable toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: cargo test fontc | |
run: cargo test -p fontc --all-targets --all-features | |
test-stable-misc-quick: | |
name: tests other than fontbe,fontc | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: install stable toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: cargo test fontdrasil | |
run: cargo test -p fontdrasil --all-targets --all-features | |
- name: cargo test fontir | |
run: cargo test -p fontir --all-targets --all-features | |
- name: cargo test glyphs-reader | |
run: cargo test -p glyphs-reader --all-targets --all-features | |
- name: cargo test glyphs2fontir | |
run: cargo test -p glyphs2fontir --all-targets --all-features | |
- name: cargo test ufo2fontir | |
run: cargo test -p ufo2fontir --all-targets --all-features | |
check-no-std: | |
name: cargo check no std | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: install stable toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: cargo check fontdrasil | |
run: cargo check --manifest-path=fontdrasil/Cargo.toml --no-default-features | |
- name: cargo check fontir | |
run: cargo check --manifest-path=fontir/Cargo.toml --no-default-features | |
- name: cargo check ufo2fontir | |
run: cargo check --manifest-path=ufo2fontir/Cargo.toml --no-default-features | |
- name: cargo check glyphs2fontir | |
run: cargo check --manifest-path=glyphs2fontir/Cargo.toml --no-default-features | |
- name: cargo check fontbe | |
run: cargo check --manifest-path=fontbe/Cargo.toml --no-default-features | |
- name: cargo check fontc | |
run: cargo check --manifest-path=fontc/Cargo.toml --no-default-features | |
check-ots: | |
name: resources/scripts/ots_test.sh | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: install stable toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Run resources/scripts/ots_test.sh | |
run: resources/scripts/ots_test.sh | |
test-fea-rs: | |
name: cargo test fea-rs | |
runs-on: ubuntu-latest | |
steps: | |
- name: install stable toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- uses: actions/checkout@v3 | |
- uses: getsentry/[email protected] | |
id: venv | |
with: | |
python-version: 3.10.7 | |
requirement-files: resources/scripts/fea_ci_requirements.txt | |
- run: pip install -r resources/scripts/fea_ci_requirements.txt | |
if: steps.venv.outputs.cache-hit != 'true' | |
- name: cargo test fea-rs | |
run: cargo test -p fea-rs | |
# Check if GS builds, builds repeatably, and passes OTS | |
# https://github.com/googlefonts/fontc/issues/647 | |
build-gs-repeatably: | |
runs-on: ubuntu-latest | |
name: Build GS and check the result | |
steps: | |
- name: Check out fontc source repository | |
uses: actions/checkout@v4 | |
- name: Install the latest stable Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Build and install fontc (release mode) | |
run: cd fontc && pwd && cargo install --path . | |
- name: Fetch OTS | |
run: | | |
curl -OL "https://github.com/khaledhosny/ots/releases/download/v9.1.0/ots-9.1.0-Linux.zip" | |
unzip "ots-9.1.0-Linux.zip" "ots-9.1.0-Linux/ots-sanitize" | |
- name: Install ttx | |
run: | | |
pipx install fonttools | |
which ttx | |
ttx --version | |
- name: Check out GS source repository | |
uses: actions/checkout@v4 | |
with: | |
repository: googlefonts/googlesans | |
path: googlesans | |
token: ${{ secrets.GS_READ_FONTC }} | |
- name: Check out Oswald source repository | |
uses: actions/checkout@v4 | |
with: | |
repository: googlefonts/OswaldFont | |
path: oswald | |
- name: Compile GS Roman twice | |
run: ./resources/scripts/repeatable-builds.sh googlesans/source/GoogleSans/GoogleSans.designspace | |
- name: Compile GS Italic twice | |
run: ./resources/scripts/repeatable-builds.sh googlesans/source/GoogleSans/GoogleSans-Italic.designspace | |
- name: Compile Oswald twice | |
run: ./resources/scripts/repeatable-builds.sh oswald/sources/Oswald.glyphs | |
- name: OTS tests, GS Roman | |
run: ots-9.1.0-Linux/ots-sanitize build/GoogleSans.ttf | |
- name: OTS tests, GS Italic | |
run: ots-9.1.0-Linux/ots-sanitize build/GoogleSans-Italic.ttf | |
- name: OTS tests, Oswald | |
run: ots-9.1.0-Linux/ots-sanitize build/Oswald.ttf | |
- uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
path: build/*.ttf |