Merge pull request #13 from demodrive-ai/sp/dockerfile #57
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
uses: astral-sh/setup-uv@v5 | |
- name: Load cached dependencies | |
uses: actions/cache@v4 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/uv.lock') }} | |
- 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 | |
uses: astral-sh/setup-uv@v5 | |
- name: Load cached dependencies | |
uses: actions/cache@v4 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-lint-${{ hashFiles('**/uv.lock') }} | |
- 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 |