test.yaml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. name: Google Fonts QA
  2. on:
  3. pull_request:
  4. branches:
  5. - main
  6. jobs:
  7. diffbrowsers:
  8. name: Build Google Fonts
  9. runs-on: ${{ matrix.os }}
  10. strategy:
  11. matrix:
  12. python-version: ['3.10']
  13. os: [windows-latest, macos-12, ubuntu-latest]
  14. steps:
  15. - name: Cancel previous
  16. uses: styfle/cancel-workflow-action@0.11.0
  17. with:
  18. access_token: ${{ github.token }}
  19. - uses: actions/checkout@v1
  20. - name: Set up Python 3.10
  21. uses: actions/setup-python@v4.4.0
  22. with:
  23. python-version: '3.10'
  24. - name: Install packages
  25. run: |
  26. pip install gftools[qa] pytest
  27. shell: bash
  28. - name: Setup Chrome
  29. uses: browser-actions/setup-chrome@v1.6.2
  30. with:
  31. chrome-version: '127.0.6509.0'
  32. - name: Setup Chrome Driver
  33. uses: nanasess/setup-chromedriver@v2.2.2
  34. - name: Setup Firefox
  35. uses: browser-actions/setup-firefox@latest
  36. - name: Setup Firefox Driver
  37. uses: browser-actions/setup-geckodriver@latest
  38. with:
  39. token: ${{ secrets.GITHUB_TOKEN }}
  40. - name: Run Diffbrowsers
  41. run: |
  42. mkdir out
  43. python -m youseedee 0x078A
  44. chromedriver --url-base=/wd/hub &
  45. python3 .ci/run.py --render
  46. env:
  47. PYTHONIOENCODING: 'utf-8'
  48. PYTHONUTF8: '1'
  49. shell: bash
  50. - name: Check file existence
  51. id: check_files
  52. uses: andstor/file-existence-action@v2.0.0
  53. with:
  54. files: "out"
  55. - name: Upload check results
  56. if: steps.check_files.outputs.files_exists == 'true'
  57. uses: actions/upload-artifact@v3
  58. with:
  59. name: qa
  60. path: out/
  61. diffenator:
  62. name: Diffenate fonts
  63. runs-on: ubuntu-latest
  64. continue-on-error: true
  65. steps:
  66. - name: Cancel previous
  67. uses: styfle/cancel-workflow-action@0.11.0
  68. with:
  69. access_token: ${{ github.token }}
  70. - uses: actions/checkout@v1
  71. - name: Set up Python 3.10
  72. uses: actions/setup-python@v4.4.0
  73. with:
  74. python-version: '3.10'
  75. - name: Install packages
  76. # The --pre flag below will ensure we use the latest Font Bakery pre-releases
  77. # and benefit from its newest checks:
  78. run: |
  79. pip install --upgrade pip
  80. pip install --pre fontbakery[googlefonts]
  81. pip install gftools[qa] pytest
  82. shell: bash
  83. - name: Run Diffenator and Fontbakery
  84. run: |
  85. mkdir out
  86. python -m youseedee 0x078A
  87. python3 .ci/run.py --pr-number $PR_NUMBER --pr-url-body https://www.github.com/google/fonts/pull/
  88. env:
  89. PYTHONIOENCODING: 'utf-8'
  90. PYTHONUTF8: '1'
  91. GH_TOKEN: ${{ github.token }}
  92. PR_NUMBER: ${{ github.event.number }}
  93. shell: bash
  94. - name: Check file existence
  95. id: check_files
  96. uses: andstor/file-existence-action@v2.0.0
  97. with:
  98. files: "out"
  99. - name: Upload check results
  100. if: steps.check_files.outputs.files_exists == 'true'
  101. uses: actions/upload-artifact@v3
  102. with:
  103. name: qa
  104. path: out/
  105. ftxvalidator:
  106. name: Run ftxvalidator on new/changed fonts
  107. runs-on: macos-latest
  108. steps:
  109. - uses: actions/checkout@v1
  110. - name: Download and install
  111. run: |
  112. ${{secrets.OBTAIN_FONTTOOLS}}
  113. hdiutil attach font_tools.dmg
  114. sudo installer -pkg /Volumes/macOS\ Font\ Tools/macOS\ Font\ Tools.pkg -target /
  115. hdiutil detach /Volumes/macOS\ Font\ Tools
  116. - name: Set up Python 3.10
  117. uses: actions/setup-python@v4.4.0
  118. with:
  119. python-version: '3.10'
  120. - name: Test font with ftxvalidator
  121. run: python3 .ci/ftxvalidator.py