test.yaml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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-latest, 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@latest
  30. - name: Setup Chrome Driver
  31. uses: nanasess/setup-chromedriver@master
  32. - name: Setup Firefox
  33. uses: browser-actions/setup-firefox@latest
  34. - name: Setup Firefox Driver
  35. uses: browser-actions/setup-geckodriver@latest
  36. with:
  37. token: ${{ secrets.GITHUB_TOKEN }}
  38. - name: Run Diffbrowsers
  39. run: |
  40. mkdir out
  41. python -m youseedee 0x078A
  42. chromedriver --url-base=/wd/hub &
  43. python3 .ci/run.py --render
  44. env:
  45. PYTHONIOENCODING: 'utf-8'
  46. PYTHONUTF8: '1'
  47. shell: bash
  48. - name: Check file existence
  49. id: check_files
  50. uses: andstor/file-existence-action@v2.0.0
  51. with:
  52. files: "out"
  53. - name: Upload check results
  54. if: steps.check_files.outputs.files_exists == 'true'
  55. uses: actions/upload-artifact@v1
  56. with:
  57. name: qa
  58. path: out/
  59. diffenator:
  60. name: Diffenate fonts
  61. runs-on: ubuntu-latest
  62. steps:
  63. - name: Cancel previous
  64. uses: styfle/cancel-workflow-action@0.11.0
  65. with:
  66. access_token: ${{ github.token }}
  67. - uses: actions/checkout@v1
  68. - name: Set up Python 3.10
  69. uses: actions/setup-python@v4.4.0
  70. with:
  71. python-version: '3.10'
  72. - name: Install packages
  73. # The --pre flag below will ensure we use the latest Font Bakery pre-releases
  74. # and benefit from its newest checks:
  75. run: |
  76. pip install --upgrade pip
  77. pip install --pre fontbakery[googlefonts]
  78. pip install gftools[qa] pytest
  79. shell: bash
  80. - name: Run Diffenator and Fontbakery
  81. run: |
  82. mkdir out
  83. python -m youseedee 0x078A
  84. python3 .ci/run.py --pr-number $PR_NUMBER --pr-url-body https://www.github.com/google/fonts/pull/
  85. env:
  86. PYTHONIOENCODING: 'utf-8'
  87. PYTHONUTF8: '1'
  88. GH_TOKEN: ${{ github.token }}
  89. PR_NUMBER: ${{ github.event.number }}
  90. shell: bash
  91. - name: Check file existence
  92. id: check_files
  93. uses: andstor/file-existence-action@v2.0.0
  94. with:
  95. files: "out"
  96. - name: Upload check results
  97. if: steps.check_files.outputs.files_exists == 'true'
  98. uses: actions/upload-artifact@v1
  99. with:
  100. name: qa
  101. path: out/