167 lines
4.7 KiB
YAML
167 lines
4.7 KiB
YAML
name: Google Fonts QA
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- "ofl/*/*"
|
|
- "ufl/*/*"
|
|
- "apache/*/*"
|
|
|
|
env:
|
|
DIFFENATOR3_VERSION: "0.1.2"
|
|
|
|
jobs:
|
|
diffbrowsers:
|
|
name: Build Google Fonts
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
python-version: ["3.10"]
|
|
os: [windows-latest, macos-13, ubuntu-22.04]
|
|
steps:
|
|
- name: Cancel previous
|
|
uses: styfle/cancel-workflow-action@0.11.0
|
|
with:
|
|
access_token: ${{ github.token }}
|
|
|
|
- uses: actions/checkout@v1
|
|
- name: Set up Python 3.10
|
|
uses: actions/setup-python@v4.4.0
|
|
with:
|
|
python-version: "3.10"
|
|
- name: Install packages
|
|
run: |
|
|
pip install gftools[qa] pytest
|
|
shell: bash
|
|
- name: Setup Chrome
|
|
uses: browser-actions/setup-chrome@v1.6.2
|
|
with:
|
|
chrome-version: "127.0.6509.0"
|
|
- name: Setup Chrome Driver
|
|
uses: nanasess/setup-chromedriver@v2.2.2
|
|
|
|
- name: Setup Firefox
|
|
uses: browser-actions/setup-firefox@latest
|
|
- name: Setup Firefox Driver
|
|
uses: browser-actions/setup-geckodriver@latest
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Run Diffbrowsers
|
|
run: |
|
|
mkdir out
|
|
python -m youseedee 0x078A
|
|
chromedriver --url-base=/wd/hub &
|
|
python3 .ci/run.py --render
|
|
env:
|
|
PYTHONIOENCODING: "utf-8"
|
|
PYTHONUTF8: "1"
|
|
shell: bash
|
|
|
|
- name: Check file existence
|
|
id: check_files
|
|
uses: andstor/file-existence-action@v2.0.0
|
|
with:
|
|
files: "out"
|
|
|
|
- name: Upload check results
|
|
if: steps.check_files.outputs.files_exists == 'true'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: qa-${{ matrix.os }}
|
|
path: out/
|
|
|
|
diffenator:
|
|
name: Diffenate fonts
|
|
runs-on: ubuntu-22.04
|
|
continue-on-error: true
|
|
permissions:
|
|
pull-requests: write
|
|
|
|
outputs:
|
|
finished: ${{ steps.check_files.outputs.files_exists }}
|
|
|
|
steps:
|
|
- name: Cancel previous
|
|
uses: styfle/cancel-workflow-action@0.11.0
|
|
with:
|
|
access_token: ${{ github.token }}
|
|
|
|
- uses: actions/checkout@v1
|
|
- name: Set up Python 3.10
|
|
uses: actions/setup-python@v4.4.0
|
|
with:
|
|
python-version: "3.10"
|
|
- name: Install packages
|
|
run: |
|
|
pip install --upgrade pip
|
|
pip install pytest
|
|
pip install "gftools[qa]"
|
|
shell: bash
|
|
- name: Set up Fontspector
|
|
uses: fonttools/setup-fontspector@main
|
|
with:
|
|
version: head
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Install diffenator3
|
|
run: |
|
|
wget "https://github.com/googlefonts/diffenator3/releases/download/v$DIFFENATOR3_VERSION/diffenator3-v$DIFFENATOR3_VERSION-x86_64-unknown-linux-musl.tar.gz"
|
|
tar zxvf diffenator3-v$DIFFENATOR3_VERSION-x86_64-unknown-linux-musl.tar.gz
|
|
cp diffenator3*/* /usr/local/bin/
|
|
- name: Install interpolatable
|
|
run: |
|
|
cargo install --git https://github.com/simoncozens/interpolatable
|
|
- name: Run Diffenator and Fontspector
|
|
run: |
|
|
mkdir out
|
|
python -m youseedee 0x078A
|
|
python3 .ci/run.py --pr-number $PR_NUMBER --pr-url-body https://www.github.com/google/fonts/pull/
|
|
env:
|
|
PYTHONIOENCODING: "utf-8"
|
|
PYTHONUTF8: "1"
|
|
GH_TOKEN: ${{ github.token }}
|
|
PR_NUMBER: ${{ github.event.number }}
|
|
shell: bash
|
|
|
|
- name: Check file existence
|
|
id: check_files
|
|
uses: andstor/file-existence-action@v2.0.0
|
|
with:
|
|
files: "out"
|
|
|
|
- name: Upload check results
|
|
if: steps.check_files.outputs.files_exists == 'true'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: qa-diffenator
|
|
path: out/
|
|
|
|
consolidate:
|
|
needs: [diffbrowsers, diffenator]
|
|
if: needs.diffenator.outputs.finished == 'true'
|
|
name: Consolidate results into a single zip
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/upload-artifact/merge@v4
|
|
with:
|
|
pattern: qa-*
|
|
name: qa
|
|
|
|
ftxvalidator:
|
|
name: Run ftxvalidator on new/changed fonts
|
|
runs-on: macos-latest
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- name: Download and install
|
|
run: |
|
|
${{secrets.OBTAIN_FONTTOOLS}}
|
|
hdiutil attach font_tools.dmg
|
|
sudo installer -pkg /Volumes/macOS\ Font\ Tools/macOS\ Font\ Tools.pkg -target /
|
|
hdiutil detach /Volumes/macOS\ Font\ Tools
|
|
- name: Set up Python 3.10
|
|
uses: actions/setup-python@v4.4.0
|
|
with:
|
|
python-version: "3.10"
|
|
- name: Test font with ftxvalidator
|
|
run: python3 .ci/ftxvalidator.py
|