febus982/bootstrap-python-fastapi

View on GitHub
.github/workflows/python-tests.yml

Summary

Maintainability
Test Coverage
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python tests

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]
  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

jobs:
  test:
    strategy:
      matrix:
        version: ["3.9", "3.10", "3.11", "3.12"]
        os: [ubuntu-latest]
    runs-on: ${{ matrix.os }}
    steps:
    - uses: actions/checkout@v4
    - name: Set up Python ${{ matrix.version }}
      uses: actions/setup-python@v5
      with:
        python-version: "${{ matrix.version }}"
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        python -m pip install poetry
        poetry config virtualenvs.create false
        make dev-dependencies
    - name: Test with pytest
      run: |
        make ci-test
    - name: Check typing
      run: |
        make typing