| on: |
| pull_request: |
| push: |
| branches: |
| - main |
| tags: |
| - "*" |
| schedule: |
| - cron: '22 2 * * *' # run at 2:22 every day |
| |
| name: Continuous integration |
| permissions: |
| contents: read |
| |
| jobs: |
| check: |
| name: Rustfmt |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@v4 |
| - uses: dtolnay/rust-toolchain@stable |
| - run: rustup component add rustfmt |
| |
| - 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@v4 |
| - name: install stable toolchain |
| uses: dtolnay/rust-toolchain@stable |
| with: |
| toolchain: 1.75 |
| - run: rustup component add clippy |
| |
| - name: cargo clippy font-types (1.75) |
| run: cargo clippy -p font-types --all-features --all-targets -- -D warnings |
| |
| - name: cargo clippy read-fonts (1.75) |
| run: cargo clippy -p read-fonts --all-features --all-targets -- -D warnings |
| |
| - name: cargo clippy write-fonts (1.75) |
| run: cargo clippy -p write-fonts --all-features --all-targets -- -D warnings |
| |
| - name: cargo clippy skrifa (1.75) |
| run: cargo clippy -p font-types --all-features --all-targets -- -D warnings |
| |
| test-stable: |
| name: cargo test stable |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@v4 |
| |
| - name: install stable toolchain |
| uses: dtolnay/rust-toolchain@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 (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 klippa |
| run: | |
| pip install -r resources/scripts/klippa_ci_requirements.txt |
| cargo test -p klippa --all-targets --all-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 |
| |
| ensure-clean-codegen: |
| name: check codegen is up-to-date |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@v4 |
| |
| - name: install stable toolchain |
| uses: dtolnay/rust-toolchain@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@v4 |
| |
| - name: install stable toolchain |
| uses: dtolnay/rust-toolchain@stable |
| with: |
| toolchain: 1.75 |
| # Use a target without `std` to make sure we don't link to `std` |
| target: thumbv7em-none-eabihf |
| |
| - 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@v4 |
| |
| - name: install stable toolchain |
| uses: dtolnay/rust-toolchain@stable |
| with: |
| target: wasm32-unknown-unknown |
| toolchain: 1.75 |
| |
| - 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 |
| |
| # If this fails, consider changing your text or adding something to .typos.toml |
| typos: |
| name: Check for typos |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@v4 |
| - name: check typos |
| uses: crate-ci/typos@v1.30.2 |
| |
| fauntlet: |
| name: fauntlet |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@v4 |
| - uses: dtolnay/rust-toolchain@stable |
| |
| - name: fauntlet compare |
| run: cargo run --release -p fauntlet -- compare-glyphs --hinting-engine all --hinting-target all --exit-on-fail fauntlet/test_fonts/*.*tf |