Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,39 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Java
uses: actions/setup-java@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Download the CFF dump utility
run: wget https://github.com/janpe2/CFFDump/releases/download/v1.3.0/CFFDump_bin_cli_1.3.0.jar -O CFFDump_bin_cli_1.3.0.jar
- name: Set CFF_DUMP_BIN environment variable
run: echo "CFF_DUMP_BIN=$PWD/CFFDump_bin_cli_1.3.0.jar" >> $GITHUB_ENV
- name: Set up Python
uses: actions/setup-python@v5
- run: wget https://github.com/janpe2/CFFDump/releases/download/v1.3.0/CFFDump_bin_cli_1.3.0.jar -O CFFDump_bin_cli_1.3.0.jar
- run: echo "CFF_DUMP_BIN=$PWD/CFFDump_bin_cli_1.3.0.jar" >> $GITHUB_ENV
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install fonttools
run: pip install fonttools==4.50
- uses: dtolnay/rust-toolchain@stable
- run: pip install fonttools==4.50
- uses: dtolnay/rust-toolchain@1.89.0
- run: cargo build
name: Build
- run: cargo build --no-default-features
name: Build without default features
- run: cargo test
name: Run tests

checks:
name: Check clippy, formatting, and documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.83.0
- uses: dtolnay/rust-toolchain@1.89.0
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@cargo-hack
- run: cargo clippy
- run: cargo clippy --workspace --all-targets --all-features
- run: cargo fmt --check --all
- run: cargo doc --workspace --no-deps

min-version:
name: Check minimum Rust version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.82.0
- uses: Swatinem/rust-cache@v2
- run: cargo check --workspace
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ resolver = "2"

[workspace.package]
version = "0.2.2"
rust-version = "1.82" # also change in ci.yml
authors = ["Laurenz Mädje <laurmaedje@gmail.com>", "Laurenz Stampfl <laurenz.stampfl@gmail.com>"]
edition = "2021"
repository = "https://github.com/typst/subsetter"
Expand All @@ -17,6 +18,7 @@ categories = ["compression", "encoding"]
keywords = ["subsetting", "OpenType", "PDF"]
exclude = ["fonts/*", "tests/*"]
version = { workspace = true }
rust-version = { workspace = true }
authors = { workspace = true }
edition = { workspace = true }
repository = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions tests/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ fn test_cff_dump(font_file: &str, gids: &str, num: u16) {

std::fs::write(otf_path.clone(), subset).unwrap();

let cff_dump_util = env!("CFF_DUMP_BIN");
let cff_dump_util = std::env::var("CFF_DUMP_BIN").unwrap();

let output = Command::new("java")
.args([
"-jar",
cff_dump_util,
&cff_dump_util,
"-otf",
"-c",
"-long",
Expand Down