Skip to content

Commit dd4065c

Browse files
authored
Add MSRV and streamline CI (#17)
1 parent 40a888b commit dd4065c

3 files changed

Lines changed: 21 additions & 19 deletions

File tree

.github/workflows/ci.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,39 +7,39 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@v4
10-
- name: Install Java
11-
uses: actions/setup-java@v3
10+
- uses: actions/setup-java@v3
1211
with:
1312
distribution: 'temurin'
1413
java-version: '17'
15-
- name: Download the CFF dump utility
16-
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
17-
- name: Set CFF_DUMP_BIN environment variable
18-
run: echo "CFF_DUMP_BIN=$PWD/CFFDump_bin_cli_1.3.0.jar" >> $GITHUB_ENV
19-
- name: Set up Python
20-
uses: actions/setup-python@v5
14+
- 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
15+
- run: echo "CFF_DUMP_BIN=$PWD/CFFDump_bin_cli_1.3.0.jar" >> $GITHUB_ENV
16+
- uses: actions/setup-python@v5
2117
with:
2218
python-version: "3.11"
23-
- name: Install fonttools
24-
run: pip install fonttools==4.50
25-
- uses: dtolnay/rust-toolchain@stable
19+
- run: pip install fonttools==4.50
20+
- uses: dtolnay/[email protected]
2621
- run: cargo build
27-
name: Build
2822
- run: cargo build --no-default-features
29-
name: Build without default features
3023
- run: cargo test
31-
name: Run tests
3224

3325
checks:
3426
name: Check clippy, formatting, and documentation
3527
runs-on: ubuntu-latest
3628
steps:
3729
- uses: actions/checkout@v4
38-
- uses: dtolnay/rust-toolchain@1.83.0
30+
- uses: dtolnay/rust-toolchain@1.89.0
3931
with:
4032
components: clippy, rustfmt
4133
- uses: Swatinem/rust-cache@v2
42-
- uses: taiki-e/install-action@cargo-hack
43-
- run: cargo clippy
34+
- run: cargo clippy --workspace --all-targets --all-features
4435
- run: cargo fmt --check --all
4536
- run: cargo doc --workspace --no-deps
37+
38+
min-version:
39+
name: Check minimum Rust version
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v4
43+
- uses: dtolnay/[email protected]
44+
- uses: Swatinem/rust-cache@v2
45+
- run: cargo check --workspace

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ resolver = "2"
44

55
[workspace.package]
66
version = "0.2.2"
7+
rust-version = "1.82" # also change in ci.yml
78
authors = ["Laurenz Mädje <[email protected]>", "Laurenz Stampfl <[email protected]>"]
89
edition = "2021"
910
repository = "https://github.com/typst/subsetter"
@@ -17,6 +18,7 @@ categories = ["compression", "encoding"]
1718
keywords = ["subsetting", "OpenType", "PDF"]
1819
exclude = ["fonts/*", "tests/*"]
1920
version = { workspace = true }
21+
rust-version = { workspace = true }
2022
authors = { workspace = true }
2123
edition = { workspace = true }
2224
repository = { workspace = true }

tests/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ fn test_cff_dump(font_file: &str, gids: &str, num: u16) {
5353

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

56-
let cff_dump_util = env!("CFF_DUMP_BIN");
56+
let cff_dump_util = std::env::var("CFF_DUMP_BIN").unwrap();
5757

5858
let output = Command::new("java")
5959
.args([
6060
"-jar",
61-
cff_dump_util,
61+
&cff_dump_util,
6262
"-otf",
6363
"-c",
6464
"-long",

0 commit comments

Comments
 (0)