name: Fontbakery CI — static fonts

on:
  push:
    paths:
    - 'sources/**'
  pull_request:
    paths:
    - 'sources/**'

jobs:
  static-font-ci-job:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: [3.8]
    name: Fontbakery CI — static fonts
    steps:
      - name: Check out JetBrains Mono source repository
        uses: actions/checkout@v2
      - name: Set up Python v${{ matrix.python-version }} environment
        uses: actions/setup-python@v1
        with:
          python-version: ${{ matrix.python-version }}
      - name: Python build dependency cache lookup
        uses: actions/cache@v1
        with:
          path: ~/.cache/pip
          # Check for requirements file cache hit
          key: ${{ runner.os }}-pip-${{ hashFiles('${{ steps.config.outputs.dependpath }}') }}
      - name: Install Python build dependencies
        uses: py-actions/py-dependency-install@v2
        with:
          update-wheel: "true"
          update-setuptools: "true"
      - name: Build static fonts
        run: sources/build-statics.sh
      - name: Font Bakery CI static ttf
        uses: f-actions/font-bakery@v1
        with:
          version: "latest"
          subcmd: "check-googlefonts"
          args: "--succinct --loglevel WARN -x familyname -x fullfontname -x typographicfamilyname"
          path: "fonts/ttf/*.ttf"
