Skip to content

refactor(curves)!: replace flo-curves with kurbo #824

refactor(curves)!: replace flo-curves with kurbo

refactor(curves)!: replace flo-curves with kurbo #824

Workflow file for this run

name: test
on:
pull_request:
merge_group:
types:
- checks_requested
push:
branches:
- master
env:
CARGO_TERM_COLOR: always
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@stable
- name: Test native build
run: cargo build --workspace --verbose --locked
- name: Run simple tests
run: cargo test --workspace
- name: Run heavy tests
run: cargo test --workspace -- --ignored
- name: Generate font for validation
run: cargo run
- name: Upload generated font
uses: actions/upload-artifact@v7
with:
name: generated-font
path: out.ttf
if-no-files-found: error
validate-font:
runs-on: ubuntu-latest
needs: rust
steps:
- uses: actions/checkout@v7
- name: Download generated font
uses: actions/download-artifact@v8
with:
name: generated-font
path: .
- name: Validate font with FontValidator
id: fontvalidator
run: |
set -euo pipefail
mkdir -p target/fontval_tmp target/validate
curl -fsSL -o target/fontval_tmp/fontval.tgz https://github.com/HinTak/Font-Validator/releases/download/FontVal-2.1.6/FontVal-2.1.6-ubuntu-18.04-x64.tgz
tar -xzf target/fontval_tmp/fontval.tgz -C target/fontval_tmp
FONTVALIDATOR_BIN="$(find target/fontval_tmp -type f -name 'FontValidator*' -perm -u+x -print -quit)"
if [ -z "$FONTVALIDATOR_BIN" ]; then
echo "FontValidator binary not found in archive" >&2
echo "exit_code=2" >> "$GITHUB_OUTPUT"
exit 0
fi
chmod +x "$FONTVALIDATOR_BIN"
set +e
"$FONTVALIDATOR_BIN" -file out.ttf -report-dir target/validate
exit_code=$?
set -e
echo "exit_code=$exit_code" >> "$GITHUB_OUTPUT"
- name: Upload report
if: always()
uses: actions/upload-artifact@v7
with:
name: fontvalidator-report
path: target/validate/out.ttf.report.html
if-no-files-found: warn
- name: Check results
if: always()
run: |
report_output="$(./tools/fontvalidator_report.py target/validate/out.ttf.report.xml)"
echo "$report_output"
exit_code="${{ steps.fontvalidator.outputs.exit_code }}"
if [ -z "$exit_code" ]; then
echo "FontValidator exit code missing" >&2
exit 1
fi
if [ "$exit_code" -ne 0 ]; then
escaped_report_output="${report_output//'%'/'%25'}"
escaped_report_output="${escaped_report_output//$'\n'/'%0A'}"
escaped_report_output="${escaped_report_output//$'\r'/'%0D'}"
echo "::warning title=FontValidator reported errors::Exit code $exit_code%0A$escaped_report_output"
# TODO: Make this a hard failure once the font rendering is fixed
# exit "$exit_code"
fi
web-playground:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6
with:
version: latest
- uses: actions/setup-node@v7
with:
cache: pnpm
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Install deps
run: pnpm install --frozen-lockfile
- name: Build playground
working-directory: tools/playground
run: pnpm build
- name: Check formatting
run: pnpm fmt --check
- name: Run lint
run: pnpm lint