diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c5414c22..49b4213f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/Cargo.toml b/Cargo.toml index 15f5a735..497fed24 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 ", "Laurenz Stampfl "] edition = "2021" repository = "https://github.com/typst/subsetter" @@ -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 } diff --git a/tests/src/main.rs b/tests/src/main.rs index 16b602a7..a4149aaf 100644 --- a/tests/src/main.rs +++ b/tests/src/main.rs @@ -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",