test.yaml 3.3 KB

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