Skip to content

Feature: Switching from Poetry to UV, Composite to Dockerfile #50

Feature: Switching from Poetry to UV, Composite to Dockerfile

Feature: Switching from Poetry to UV, Composite to Dockerfile #50

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
test:
name: Test Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9","3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install uv
run: |
pip install uv
- name: Load cached dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt') }}
- name: Install project
run: |
uv venv
uv pip install -e ".[dev]"
- name: Run tests
run: |
source .venv/bin/activate
pytest -v --cov=docs_actions --cov-report=xml
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- name: Install uv
run: |
pip install uv
- name: Load cached dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-lint-${{ hashFiles('**/requirements.txt') }}
- name: Install dependencies
run: |
uv venv
uv pip install -e ".[dev]"
- name: Run pre-commit
run: |
source .venv/bin/activate
pre-commit run --all-files
security:
name: Security Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install bandit safety
- name: Run Bandit
run: bandit -r src/docs_actions -c pyproject.toml
- name: Run Safety Check
run: safety check