From 624d8f3a767c7ab48ca2165b71caff23d5d0bb70 Mon Sep 17 00:00:00 2001 From: Martin Vonk Date: Wed, 8 Mar 2023 14:50:25 +0100 Subject: [PATCH] add github tests --- .github/workflows/tests.yaml | 65 ++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/tests.yaml diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..0114a5f --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,65 @@ +name: Tests + +on: + - push + - pull_request + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - name: Test suite with py310-ubuntu + python: "3.10" + os: ubuntu-latest + toxenv: py310 + - name: Test suite with py311-ubuntu + python: "3.11" + os: ubuntu-latest + toxenv: py311 + - name: Type check with mypy + python: "3.10" + os: ubuntu-latest + toxenv: type + - name: Formatting with black + isort + python: "3.10" + os: ubuntu-latest + toxenv: format + - name: Linting with flake8 + ruff + python: "3.10" + os: ubuntu-latest + toxenv: lint + + name: ${{ matrix.name }} + env: + # Color Output + # Rich (pip) + FORCE_COLOR: 1 + # Tox + PY_COLORS: 1 + # MyPy + TERM: xterm-color + MYPY_FORCE_COLOR: 1 + MYPY_FORCE_TERMINAL_WIDTH: 200 + # Pytest + PYTEST_ADDOPTS: "--color=yes" + steps: + - uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python }} + check-latest: true + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox + - name: Setup tox environment + run: tox -e ${{ matrix.toxenv }} --notest + + - name: Test + run: tox -e ${{ matrix.toxenv }} --skip-pkg-install