on: pull_request: push: branches: - main tags: - "*" schedule: - cron: '22 2 * * *' # run at 2:22 every day name: Continuous integration permissions: contents: read env: # CI builds start from nothing and are thrown away, so incremental state is # only overhead. CARGO_INCREMENTAL: 0 CARGO_TERM_COLOR: always jobs: check: name: Rustfmt runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - run: | rustup toolchain install stable --profile minimal --no-self-update --component rustfmt rustup default stable - name: rustfmt check run: cargo fmt --all -- --check - 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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: install stable toolchain run: | rustup toolchain install 1.89 --profile minimal --no-self-update --component clippy rustup default 1.89 - name: cargo clippy font-types (1.89) run: cargo clippy -p font-types --all-features --all-targets -- -D warnings - name: cargo clippy read-fonts (1.89) run: cargo clippy -p read-fonts --all-features --all-targets -- -D warnings - name: cargo clippy write-fonts (1.89) run: cargo clippy -p write-fonts --all-features --all-targets -- -D warnings - name: cargo clippy skrifa (1.89) run: cargo clippy -p skrifa --all-features --all-targets -- -D warnings - name: cargo clippy skera (1.89) run: cargo clippy -p skera --all-features --all-targets -- -D warnings - name: cargo clippy fauntlet (1.89) run: cargo clippy -p fauntlet --all-features --all-targets -- -D warnings - name: cargo clippy incremental-font-transfer (1.89) run: cargo clippy -p incremental-font-transfer --all-features --all-targets -- -D warnings check-msrv: name: cargo check msrv runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: install stable toolchain run: | rustup toolchain install 1.85 --profile minimal --no-self-update rustup default 1.85 - name: cargo check run: cargo check --workspace test-stable: name: cargo test stable runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: install stable toolchain run: | rustup toolchain install stable --profile minimal --no-self-update rustup default stable # test all packages individually to ensure deterministic resolution # of dependencies for each package - name: cargo test font-types (default) run: cargo test -p font-types - name: cargo test font-types (all) run: cargo test -p font-types --all-targets --all-features - name: cargo test read-fonts (default) run: cargo test -p read-fonts - name: cargo test read-fonts (all) run: cargo test -p read-fonts --all-targets --all-features - name: cargo test write-fonts (default) run: cargo test -p write-fonts - name: cargo test write-fonts (no-features) # --tests makes it so we run only the unit tests and skip the doctests. # The doctests assume that "tables" is enabled. run: cargo test -p write-fonts --no-default-features --tests - name: cargo test write-fonts (all) run: cargo test -p write-fonts --all-targets --all-features - name: cargo test skrifa (default) run: cargo test -p skrifa - name: cargo test skrifa (all) run: cargo test -p skrifa --all-targets --all-features - name: cargo test skera run: | pip install -r resources/scripts/skera_ci_requirements.txt cargo test -p skera --all-targets --all-features # The slow tests are disabled by default. We may re-enable if the # tests become faster. # https://github.com/googlefonts/fontations/issues/1910 cargo test -p skera --all-targets --all-features -- --ignored - name: cargo test skera (no cli) run: cargo test -p skera --no-default-features - name: cargo test incremental-font-transfer run: cargo test -p incremental-font-transfer --all-targets --all-features - name: cargo test shared-brotli-patch-decoder run: cargo test -p shared-brotli-patch-decoder --all-targets --all-features # --all-features selects the c-brotli backend, so test the rust-brotli backend on its own. - name: cargo test shared-brotli-patch-decoder (rust-brotli) run: cargo test -p shared-brotli-patch-decoder --all-targets --no-default-features --features rust-brotli verify-licenses: name: Verify licenses runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Verify licenses run: resources/scripts/check_licenses.sh ensure-clean-codegen: name: check codegen is up-to-date runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: install stable toolchain run: | rustup toolchain install stable --profile minimal --no-self-update rustup default stable - name: run codegen run: cargo run --bin=codegen resources/codegen_plan.toml - name: ensure no unstaged changes run: | git add . git status -sb git diff-index --quiet HEAD -- check-no-std: name: cargo check no std runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: install stable toolchain # Use a target without `std` to make sure we don't link to `std` run: | rustup toolchain install 1.89 --profile minimal --no-self-update --target thumbv7em-none-eabihf rustup default 1.89 - name: cargo build font-types run: cargo build -p font-types --target thumbv7em-none-eabihf --no-default-features - name: cargo build read-fonts run: cargo build -p read-fonts --target thumbv7em-none-eabihf --no-default-features --features=libm - name: cargo build skrifa run: cargo build -p skrifa --target thumbv7em-none-eabihf --no-default-features --features=libm # We use `cargo build` here because `cargo check` doesn't pick up all # warnings / errors. Notably, it misses `arithmetic_overflow`. check-wasm: name: cargo check wasm runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: install stable toolchain run: | rustup toolchain install 1.89 --profile minimal --no-self-update --target wasm32-unknown-unknown rustup default 1.89 - name: cargo build font-types run: cargo build -p font-types --target wasm32-unknown-unknown - name: cargo build read-fonts run: cargo build -p read-fonts --target wasm32-unknown-unknown - name: cargo build skrifa run: cargo build -p skrifa --target wasm32-unknown-unknown - name: cargo build write-fonts run: cargo build -p write-fonts --target wasm32-unknown-unknown typos: name: Check for typos runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: check typos uses: crate-ci/typos@512fc24f32f44ab01972217aaaf3dc86ec234d53 # v1.50.2 - name: typo instructions if: failure() run: | echo "::error::Fix "check typos" or add an entry in .typos.toml" exit 1 fauntlet: name: fauntlet runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - run: | rustup toolchain install stable --profile minimal --no-self-update rustup default stable - name: fauntlet compare run: cargo run --release -p fauntlet -- compare-glyphs --print-paths --hinting-engine all --hinting-target all --exit-on-fail fauntlet/test_fonts/*.*tf - name: fauntlet compare type1 run: cargo run --release -p fauntlet -- compare-glyphs --print-paths --exit-on-fail font-test-data/test_data/type1/*.pf*