Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore this CI test, take two. #65

Closed
wants to merge 2 commits into from
Closed
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
32 changes: 20 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@ env:
# version like 1.70. Note that we only specify MAJOR.MINOR and not PATCH so that bugfixes still
# come automatically. If the version specified here is no longer the latest stable version,
# then please feel free to submit a PR that adjusts it along with the potential clippy fixes.
RUST_STABLE_VER: "1.77" # In quotes because otherwise (e.g.) 1.70 would be interpreted as 1.7
RUST_STABLE_VER: "1.78" # In quotes because otherwise (e.g.) 1.70 would be interpreted as 1.7
# The purpose of checking with the minimum supported Rust toolchain is to detect its staleness.
# If the compilation fails, then the version specified here needs to be bumped up to reality.
# Be sure to also update the rust-version property in the workspace Cargo.toml file,
# plus all the README.md files of the affected packages.
RUST_MIN_VER: "1.70"
# List of packages that will be checked with the minimum supported Rust version.
# This should be limited to packages that are intended for publishing.
RUST_MIN_VER_PKGS: "-p parley -p fontique"
PRIMARY_PKGS: "-p parley -p fontique"
# List of packages that are not published on crates.io (examples, etc)
EXAMPLE_PKGS: "-p tiny_skia_render"
# List of features that depend on the standard library and will be excluded from no_std checks.
FEATURES_DEPENDING_ON_STD: "std,default,system"

Expand Down Expand Up @@ -104,13 +106,16 @@ jobs:

# TODO: Add --target x86_64-unknown-none to the no_std check once we solve the compilation issues with it
- name: cargo clippy (no_std)
run: cargo hack clippy --workspace --locked --optional-deps --each-feature --ignore-unknown-features --features libm --exclude-features ${{ env.FEATURES_DEPENDING_ON_STD }} -- -D warnings
run: cargo hack clippy ${{ env.PRIMARY_PKGS }} --locked --optional-deps --each-feature --features libm --exclude-features ${{ env.FEATURES_DEPENDING_ON_STD }} -- -D warnings

- name: cargo clippy
run: cargo hack clippy --workspace --locked --optional-deps --each-feature --ignore-unknown-features --features std -- -D warnings
run: cargo hack clippy ${{ env.PRIMARY_PKGS }} --locked --optional-deps --each-feature --features std -- -D warnings

- name: cargo clippy (auxiliary)
run: cargo hack clippy --workspace --locked --optional-deps --each-feature --ignore-unknown-features --features std --tests --benches --examples -- -D warnings
run: cargo hack clippy ${{ env.PRIMARY_PKGS }} --locked --optional-deps --each-feature --features std --tests --benches --examples -- -D warnings

- name: cargo clippy (examples)
run: cargo hack clippy ${{ env.EXAMPLE_PKGS }} --locked --optional-deps --each-feature -- -D warnings

clippy-stable-android:
name: cargo clippy (android)
Expand All @@ -137,10 +142,13 @@ jobs:
tool: cargo-hack

- name: cargo clippy
run: cargo hack clippy --workspace --locked --target ${{ matrix.target }} --optional-deps --each-feature --ignore-unknown-features --features std -- -D warnings
run: cargo hack clippy ${{ env.PRIMARY_PKGS }} --locked --target ${{ matrix.target }} --optional-deps --each-feature --features std -- -D warnings

- name: cargo clippy (auxiliary)
run: cargo hack clippy --workspace --locked --target ${{ matrix.target }} --optional-deps --each-feature --ignore-unknown-features --features std --tests --benches --examples -- -D warnings
run: cargo hack clippy ${{ env.PRIMARY_PKGS }} --locked --target ${{ matrix.target }} --optional-deps --each-feature --features std --tests --benches --examples -- -D warnings

- name: cargo clippy (examples)
run: cargo hack clippy ${{ env.EXAMPLE_PKGS }} --locked --target ${{ matrix.target }} --optional-deps --each-feature -- -D warnings

test-stable:
name: cargo test
Expand All @@ -160,7 +168,7 @@ jobs:
toolchain: ${{ env.RUST_STABLE_VER }}

- name: cargo test
run: cargo test --workspace --locked --all-features
run: cargo test ${{ env.PRIMARY_PKGS }} --locked --all-features

check-msrv:
name: cargo check (msrv)
Expand All @@ -186,10 +194,10 @@ jobs:

# TODO: Add --target x86_64-unknown-none to the no_std check once we solve the compilation issues with it
- name: cargo check (no_std)
run: cargo hack check ${{ env.RUST_MIN_VER_PKGS }} --locked --optional-deps --each-feature --ignore-unknown-features --features libm --exclude-features ${{ env.FEATURES_DEPENDING_ON_STD }}
run: cargo hack check ${{ env.PRIMARY_PKGS }} --locked --optional-deps --each-feature --features libm --exclude-features ${{ env.FEATURES_DEPENDING_ON_STD }}

- name: cargo check
run: cargo hack check ${{ env.RUST_MIN_VER_PKGS }} --locked --optional-deps --each-feature --ignore-unknown-features --features std
run: cargo hack check ${{ env.PRIMARY_PKGS }} --locked --optional-deps --each-feature --features std

check-msrv-android:
name: cargo check (msrv) (android)
Expand All @@ -215,7 +223,7 @@ jobs:
tool: cargo-hack

- name: cargo check
run: cargo hack check ${{ env.RUST_MIN_VER_PKGS }} --locked --target ${{ matrix.target }} --optional-deps --each-feature --ignore-unknown-features --features std
run: cargo hack check ${{ env.PRIMARY_PKGS }} --locked --target ${{ matrix.target }} --optional-deps --each-feature --features std

doc:
name: cargo doc
Expand All @@ -234,4 +242,4 @@ jobs:

# We test documentation using nightly to match docs.rs. This prevents potential breakages
- name: cargo doc
run: cargo doc --workspace --locked --all-features --no-deps --document-private-items -Zunstable-options -Zrustdoc-scrape-examples
run: cargo doc ${{ env.PRIMARY_PKGS }} --locked --all-features --no-deps --document-private-items -Zunstable-options -Zrustdoc-scrape-examples
34 changes: 30 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
[workspace]
resolver = "2"
members = [
"fontique",
"parley",
"examples/tiny_skia_render"
"fontique",
"examples/tiny_skia_render",
]

[workspace.package]
Expand All @@ -13,14 +12,41 @@ rust-version = "1.70"
license = "Apache-2.0 OR MIT"
repository = "https://github.com/linebender/parley"

[package]
name = "parley"
version = "0.1.0"
description = "Parley provides an API for implementing rich text layout."
keywords = ["text", "layout"]
categories = ["gui", "graphics"]
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
exclude = ["/.github/", "/doc/", ".gitignore"]

[workspace.lints]
clippy.doc_markdown = "warn"
clippy.semicolon_if_nothing_returned = "warn"
clippy.trivially_copy_pass_by_ref = "warn"
rust.unused_qualifications = "warn"

[lints]
workspace = true

[features]
default = ["system"]
std = ["fontique/std", "skrifa/std", "peniko/std"]
libm = ["fontique/libm", "skrifa/libm", "peniko/libm"]
# Enables support for system font backends
system = ["std", "fontique/system"]

[dependencies]
swash = "0.1.15"
skrifa = { workspace = true }
peniko = { workspace = true }
fontique = { workspace = true }

[workspace.dependencies]
fontique = { version = "0.1.0", default-features = false, path = "fontique" }
parley = { version = "0.1.0", default-features = false, path = "parley" }
skrifa = { version = "0.19.1", default-features = false }
peniko = { version = "0.1.0", default-features = false }
2 changes: 1 addition & 1 deletion examples/tiny_skia_render/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repository.workspace = true
publish = false

[dependencies]
parley = { workspace = true, default-features = true }
parley = { path = "../.." }
skrifa = { workspace = true }
peniko = { workspace = true }
tiny-skia = "0.11"
Expand Down
6 changes: 4 additions & 2 deletions examples/tiny_skia_render/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
//! Note: Emoji rendering is not currently implemented in this example. See the swash example
//! if you need emoji rendering.

use std::path::PathBuf;

use parley::layout::{Alignment, GlyphRun, Layout};
use parley::style::{FontStack, FontWeight, StyleProperty};
use parley::{FontContext, LayoutContext};
Expand Down Expand Up @@ -91,7 +93,7 @@ fn main() {
}

// Write image to PNG file in examples/_output dir
let output_path = {
let output_path: PathBuf = {
let path = std::path::PathBuf::from(file!());
let mut path = std::fs::canonicalize(path).unwrap();
path.pop();
Expand Down Expand Up @@ -126,7 +128,7 @@ fn render_glyph_run(glyph_run: &GlyphRun<PenikoColor>, pen: &mut TinySkiaPen<'_>
let normalized_coords = run
.normalized_coords()
.iter()
.map(|coord| NormalizedCoord::from_bits(*coord))
.map(|coord| skrifa::instance::NormalizedCoord::from_bits(*coord))
.collect::<Vec<_>>();

// Get glyph outlines using Skrifa. This can be cached in production code.
Expand Down
26 changes: 0 additions & 26 deletions parley/Cargo.toml

This file was deleted.

Loading
Loading