test.yaml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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@v1
  58. with:
  59. name: qa
  60. path: out/
  61. diffenator:
  62. name: Diffenate fonts
  63. runs-on: ubuntu-latest
  64. steps:
  65. - name: Cancel previous
  66. uses: styfle/cancel-workflow-action@0.11.0
  67. with:
  68. access_token: ${{ github.token }}
  69. - uses: actions/checkout@v1
  70. - name: Set up Python 3.10
  71. uses: actions/setup-python@v4.4.0
  72. with:
  73. python-version: '3.10'
  74. - name: Install packages
  75. # The --pre flag below will ensure we use the latest Font Bakery pre-releases
  76. # and benefit from its newest checks:
  77. run: |
  78. pip install --upgrade pip
  79. pip install --pre fontbakery[googlefonts]
  80. pip install gftools[qa] pytest
  81. shell: bash
  82. - name: Run Diffenator and Fontbakery
  83. run: |
  84. mkdir out
  85. python -m youseedee 0x078A
  86. python3 .ci/run.py --pr-number $PR_NUMBER --pr-url-body https://www.github.com/google/fonts/pull/
  87. env:
  88. PYTHONIOENCODING: 'utf-8'
  89. PYTHONUTF8: '1'
  90. GH_TOKEN: ${{ github.token }}
  91. PR_NUMBER: ${{ github.event.number }}
  92. shell: bash
  93. - name: Check file existence
  94. id: check_files
  95. uses: andstor/file-existence-action@v2.0.0
  96. with:
  97. files: "out"
  98. - name: Upload check results
  99. if: steps.check_files.outputs.files_exists == 'true'
  100. uses: actions/upload-artifact@v1
  101. with:
  102. name: qa
  103. path: out/