Skip to content

chore: Update GitHub Actions workflow to use Python 3.12 for testing #3

chore: Update GitHub Actions workflow to use Python 3.12 for testing

chore: Update GitHub Actions workflow to use Python 3.12 for testing #3

Workflow file for this run

name: Python package
on:
push:
branches-ignore:
- master
pull_request:
branches:
- master
jobs:
test:
strategy:
matrix:
python-version: ["3.12"]
runs-on: ubuntu-latest
container: ubuntu:latest@sha256:2e863c44b718727c860746568e1d54afd13b2fa71b160f5cd9058fc436217b30
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5
with:
python-version: ${{ matrix.python-version }}
- name: Install OS dependencies for snok/install-poetry
run: |
DEBIAN_FRONTEND=noninteractive apt update
DEBIAN_FRONTEND=noninteractive apt install curl sqlite3 -y
- uses: snok/install-poetry@93ada01c735cc8a383ce0ce2ae205a21c415379b # v1
with:
version: 1.8.3 # pin the version as they keep changing their APIs
virtualenvs-create: false
virtualenvs-in-project: false
- name: Install dependencies
run: |
python -m venv venv
. venv/bin/activate
poetry install --with dev --no-interaction --sync
python -c "import os; print(os.environ['VIRTUAL_ENV'])"
- name: Lint with flake8
run: |
. venv/bin/activate
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
. venv/bin/activate
pytest --cov pydantic_tfl_api --cov-report=xml
# - name: Upload coverage reports to Codecov
# uses: codecov/codecov-action@0cfda1dd0a4ad9efc75517f399d859cd1ea4ced1 # v4
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}