Don't use git ppa on 22.04 #167
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
# SPDX-FileCopyrightText: 2024 Calvin Walton | |
# | |
# SPDX-License-Identifier: CC0-1.0 | |
name: Tests | |
on: | |
push: | |
branches: [ "main" ] | |
paths-ignore: | |
- debian/** | |
pull_request: | |
branches: [ "main" ] | |
paths-ignore: | |
- debian/** | |
jobs: | |
test: | |
name: Code formatting, typechecking, and tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [ "3.10" ] | |
include: | |
- python-version: "3.10" | |
ubuntu-codename: "jammy" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update | |
DEBIAN_FRONTEND=noninteractive sudo apt-get install build-essential libgirepository1.0-dev gir1.2-glib-2.0 gir1.2-poppler-0.18 gir1.2-gtk-3.0 gir1.2-gdkpixbuf-2.0 gir1.2-pango-1.0 libcairo2-dev | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: pip | |
cache-dependency-path: | | |
setup.cfg | |
requirements-dev.txt | |
constraints-*.txt | |
- name: Install package and dependencies | |
run: | | |
pip install -r requirements-dev.txt -c constraints-ubuntu-${{ matrix.ubuntu-codename }}.txt | |
pip install -e . -c constraints-ubuntu-${{ matrix.ubuntu-codename }}.txt | |
- name: Check formatting with black | |
if: ${{ matrix.python-version == '3.10' }} | |
run: black --check . | |
- name: Check types with mypy | |
if: ${{ success() || failure() && matrix.python-version == '3.10' }} | |
run: mypy --junit-xml junit/mypy.xml | |
- name: Test with pytest | |
if: ${{ success() || failure() }} | |
run: pytest --junitxml=junit/pytest.xml | |
- name: Upload test results | |
if: ${{ success() || failure() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: junit | |
path: junit/ |