Skip to content

Commit

Permalink
ci: create ci workflow with new github actions configuration
Browse files Browse the repository at this point in the history
- add a new github actions file for ci
- define steps for fmt, clippy, test, and build jobs in the ci workflow
- modify the `parley` import in `src/shaper.rs` for better visibility
- update font settings in `src/test.rs` for `monospace xenon var regular` font styling
  • Loading branch information
falcucci committed Sep 17, 2024
1 parent e2f1d92 commit 2990e43
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 22 deletions.
104 changes: 104 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: CI

on:
push:
branches:
- ci

jobs:
fmt:
name: cargo fmt
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
toolchain: [stable, nightly]
steps:
- uses: actions/checkout@v4

- name: install stable toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: rustfmt

- name: cargo fmt
run: cargo fmt --all --check

clippy:
name: cargo clippy
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v4

- name: restore cache
uses: Swatinem/rust-cache@v2

- name: install toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: clippy

- name: Show toolchain info
run: cargo --version --verbose

- name: Run Clippy
run: cargo clippy --all-targets -- -D warnings
continue-on-error: ${{ matrix.toolchain == 'nightly' }}

event-upload:
needs: test
name: Upload Test Event
runs-on: ubuntu-latest
steps:
- uses: actions/upload-artifact@v4
with:
name: test-event
path: ${{ github.event_path }}

test:
name: cargo test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v4

- name: restore cache
uses: Swatinem/rust-cache@v2

- name: install stable toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}

- name: cargo test
run: cargo test --workspace --locked --all-features

build:
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- name: Setup toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}

- uses: Swatinem/rust-cache@v2

- name: Build
run: cargo build --locked --release
4 changes: 2 additions & 2 deletions src/shaper.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use palette::Srgba;
use parley::{
context::RangedBuilder, fontique::Collection, style::StyleProperty,
FontContext, Layout, LayoutContext,
context::RangedBuilder, fontique::Collection, style::StyleProperty, FontContext, Layout,
LayoutContext,
};

pub struct Shaper {
Expand Down
34 changes: 14 additions & 20 deletions src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,14 +485,12 @@ fn font_styles() {
fullname: "Monaspace Xenon Var Regular".into(),
attributes: Attributes::new(Stretch::NORMAL, Weight::NORMAL, Style::Normal),
synthesis: Synthesis {
vars: vec![
crate::Setting {
tag: SLNT,
// FIXME: This should be -11
// See: https://github.com/linebender/parley/issues/94
value: (14.0).into(),
},
],
vars: vec![crate::Setting {
tag: SLNT,
// FIXME: This should be -11
// See: https://github.com/linebender/parley/issues/94
value: (14.0).into(),
}],
embolden: false,
skew: 0.0.into(),
},
Expand All @@ -508,12 +506,10 @@ fn font_styles() {
fullname: "Monaspace Xenon Var Regular".into(),
attributes: Attributes::new(Stretch::NORMAL, Weight::NORMAL, Style::Normal),
synthesis: Synthesis {
vars: vec![
crate::Setting {
tag: SLNT,
value: (-10.0).into(),
},
],
vars: vec![crate::Setting {
tag: SLNT,
value: (-10.0).into(),
}],
embolden: false,
skew: 0.0.into(),
},
Expand All @@ -529,12 +525,10 @@ fn font_styles() {
fullname: "Monaspace Xenon Var Regular".into(),
attributes: Attributes::new(Stretch::NORMAL, Weight::NORMAL, Style::Normal),
synthesis: Synthesis {
vars: vec![
crate::Setting {
tag: SLNT,
value: (-5.0).into(),
},
],
vars: vec![crate::Setting {
tag: SLNT,
value: (-5.0).into(),
}],
embolden: false,
skew: 0.0.into(),
},
Expand Down

0 comments on commit 2990e43

Please sign in to comment.