Skip to content

Commit

Permalink
Tweak per code review: build once, stable date
Browse files Browse the repository at this point in the history
  • Loading branch information
rsheeter committed Dec 14, 2023
1 parent 9354b88 commit 8466305
Showing 1 changed file with 32 additions and 39 deletions.
71 changes: 32 additions & 39 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,47 +160,19 @@ jobs:
- name: cargo test fea-rs
run: cargo test -p fea-rs

# Confirm we can still compile GS
build-gs:
runs-on: ubuntu-latest
name: Build GS
steps:
- name: Check out fontc source repository
uses: actions/checkout@v4
- name: Install the latest stable Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Build and install fontc
run: cd fontc && cargo install --path . --debug
- name: Check out font project source repository
uses: actions/checkout@v4
with:
repository: googlefonts/googlesans
token: ${{ secrets.GS_READ_FONTC }}
- name: Download and unzip OTS v9.1.0
run: |
curl -OL "https://github.com/khaledhosny/ots/releases/download/v9.1.0/ots-9.1.0-Linux.zip"
unzip "ots-9.1.0-Linux.zip" "ots-9.1.0-Linux/ots-sanitize"
- name: Compile Roman variable font
run: fontc source/GoogleSans/GoogleSans.designspace
- name: OTS tests, Roman
run: ots-9.1.0-Linux/ots-sanitize build/font.ttf
- name: Compile Italic variable font
run: fontc source/GoogleSans/GoogleSans-Italic.designspace
- name: OTS tests, Italic
run: ots-9.1.0-Linux/ots-sanitize build/font.ttf

# Check if GS build is repeatable, https://github.com/googlefonts/fontc/issues/647
# Check if GS builds, builds repeatably, and passes OTS
# https://github.com/googlefonts/fontc/issues/647
build-gs-repeatably:
runs-on: ubuntu-latest
name: Build GS and get a consistent result
name: Build GS and check the result
steps:
- name: Check out fontc source repository
uses: actions/checkout@v4

- name: Install the latest stable Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Build and install fontc
- name: Build and install fontc (release mode)
run: cd fontc && pwd && cargo install --path .

- name: Check out font project source repository
Expand All @@ -209,20 +181,41 @@ jobs:
repository: googlefonts/googlesans
token: ${{ secrets.GS_READ_FONTC }}

- name: Pin SOURCE_DATE_EPOCH
run: export SOURCE_DATE_EPOCH=$(date +%s)

- name: Compile me once, shame on you
run: |
rm -rf build
echo "TEMPORARY DIAGNOSTICS"
pwd
ls
fontc source/GoogleSans/GoogleSans.designspace
cp build/font.ttf ./first.ttf
cp build/font.ttf ./first-roman.ttf
rm -rf build
fontc source/GoogleSans/GoogleSans-Italic.designspace
cp build/font.ttf ./first-italic.ttf
- name: Fetch OTS
run: |
curl -OL "https://github.com/khaledhosny/ots/releases/download/v9.1.0/ots-9.1.0-Linux.zip"
unzip "ots-9.1.0-Linux.zip" "ots-9.1.0-Linux/ots-sanitize"
- name: OTS tests, Roman
run: ots-9.1.0-Linux/ots-sanitize build/font.ttf

- name: OTS tests, Italic
run: ots-9.1.0-Linux/ots-sanitize build/font.ttf

- name: Compile me twice, shame on me
run: |
rm -rf build
fontc source/GoogleSans/GoogleSans.designspace
cp build/font.ttf ./second.ttf
cp build/font.ttf ./second-roman.ttf
rm -rf build
fontc source/GoogleSans/GoogleSans-Italic.designspace
cp build/font.ttf ./second-italic.ttf
- name: Stable Roman?
run: cmp first-roman.ttf second-roman.ttf

- name: Same output?
run: cmp first.ttf second.ttf
- name: Stable Italic?
run: cmp first-italic.ttf second-italic.ttf

0 comments on commit 8466305

Please sign in to comment.