Release 3.3.11 #1457
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests master | |
on: | |
# This avoids having duplicate builds for a pull request | |
push: | |
branches: | |
- master | |
- "*-maintenance" | |
pull_request: | |
branches: | |
- master | |
- "*-maintenance" | |
jobs: | |
############################################################################ | |
# Lint jobs | |
############################################################################ | |
lint: | |
name: lint | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "lts/*" | |
cache: "npm" | |
cache-dependency-path: "**/package-lock.json" | |
- name: Install node dependencies | |
run: make frontend/node_modules | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
cache: "pip" | |
cache-dependency-path: "**/setup.cfg" | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pre-commit | |
key: pre-commit|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }} | |
- name: Install python dependencies | |
id: pip | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install tox pre-commit | |
python -m pip freeze --local | |
- name: Run pylint | |
run: tox -e lint | |
- name: Run pre-commit | |
# run pre-commit check even if pylint check fails | |
if: steps.pip.outcome == 'success' | |
run: pre-commit run --show-diff-on-failure --color=always --all-files | |
############################################################################ | |
# Node tests | |
############################################################################ | |
node: | |
name: ${{ matrix.os}} node-${{ matrix.node }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
node: ["lts/*"] | |
os: ["ubuntu-latest", "macos-latest", "windows-latest"] | |
include: | |
- node: "current" | |
os: "ubuntu-latest" | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
cache: "npm" | |
cache-dependency-path: "**/package-lock.json" | |
- name: Build frontend | |
run: make | |
- name: Typecheck and run frontend tests | |
run: make test-js | |
############################################################################ | |
# Python tests | |
############################################################################ | |
python-tests: | |
name: ${{ matrix.os }} py${{ matrix.python }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["ubuntu-latest", "macos-latest", "windows-latest"] | |
python: ["3.7", "3.8", "3.9", "3.10", "3.11"] | |
exclude: | |
- os: "macos-latest" | |
python: "3.8" | |
- os: "macos-latest" | |
python: "3.9" | |
- os: "macos-latest" | |
python: "3.10" | |
- os: "windows-latest" | |
python: "3.8" | |
- os: "windows-latest" | |
python: "3.9" | |
- os: "windows-latest" | |
python: "3.10" | |
include: | |
- python: "3.6" | |
os: "ubuntu-20.04" | |
- python: "3.11" | |
install-imagemagick: true | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
cache: "pip" | |
cache-dependency-path: "**/setup.cfg" | |
- name: Install macOS system dependencies | |
if: startsWith(runner.os, 'macos') && matrix.install-imagemagick | |
run: brew install imagemagick ffmpeg | |
- name: Install Windows system dependencies | |
if: startsWith(runner.os, 'windows') && matrix.install-imagemagick | |
run: | | |
choco install --no-progress --timeout 600 imagemagick.app ffmpeg | |
# The imagemagick.app package, for whatever reason, installs | |
# magick.exe into a directory which is not in the default | |
# search path. Currently, it seems to get installed in a | |
# directory named something like: | |
# | |
# "C:\Program Files\ImageMagick-7.1.0-Q16-HDRI" | |
$ImDirs = ( | |
Get-ChildItem $env:ProgramFiles 'ImageMagick*' -Directory | |
| Select-Object -ExpandProperty FullName | |
) | |
if ($ImDirs.Length -eq 0) { Throw "Could not find path to ImageMagick" } | |
$ImDirs | Out-File $env:GITHUB_PATH utf8 -Append | |
$ImDirs | % { "::notice title=ImageMagick::ImageMagick installed at $_" } | |
continue-on-error: true | |
- name: Workaround for UnicodeDecodeError from tox on Windows | |
# Refs: | |
# https://github.com/lektor/lektor/pull/933#issuecomment-923107580 | |
# https://github.com/tox-dev/tox/issues/1550 | |
if: startsWith(runner.os, 'windows') | |
run: Out-File $env:GITHUB_ENV utf8 -Append -InputObject 'PYTHONIOENCODING=utf-8' | |
- name: Install python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install tox tox-gh-actions coverage[toml] | |
- name: Run python tests | |
run: tox | |
- name: Generate coverage.xml | |
shell: bash | |
run: | | |
coverage combine --append || true | |
coverage xml | |
- name: Publish coverage data to codecov | |
uses: codecov/codecov-action@v3 |