Skip to content

Update repo and CI setup #205

Update repo and CI setup

Update repo and CI setup #205

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
jobs:
dist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.x"
- run: python -m pip install --upgrade pip build wheel twine
- run: python -m build --sdist --wheel
- run: python -m twine check dist/*
- uses: actions/upload-artifact@v6
with:
path: dist/*
pytest-python:
name: PyTest
strategy:
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
django-version:
- "4.2" # LTS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- run: python -m pip install .[test]
- run: python -m pip install django~=${{ matrix.django-version }}.0
- run: python -m pytest
- uses: codecov/codecov-action@v5
with:
flags: py${{ matrix.python-version }}
token: ${{ secrets.CODECOV_TOKEN }}
pytest-django:
name: PyTest
strategy:
matrix:
python-version:
- "3.11"
django-version:
# oldest LTS gets tested on all Python versions
- "5.1"
- "5.2"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- run: python -m pip install .[test]
- run: python -m pip install django~=${{ matrix.django-version }}.0
- run: python -m pytest
- uses: codecov/codecov-action@v5
with:
flags: dj${{ matrix.django-version }}
token: ${{ secrets.CODECOV_TOKEN }}
pytest-extras:
name: PyTest
strategy:
matrix:
extras:
- "whitenoise"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: 3.x
- run: python -m pip install .[test,${{ matrix.extras }}]
- run: python -m pytest
- uses: codecov/codecov-action@v5
with:
flags: dj${{ matrix.extras }}
token: ${{ secrets.CODECOV_TOKEN }}
codeql:
name: CodeQL
needs: [dist, pytest-python, pytest-django]
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [python]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
queries: +security-and-quality
- name: Autobuild
uses: github/codeql-action/autobuild@v4
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{ matrix.language }}"