Compare commits
1 commit
main
...
ci/add-wor
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b8b111d9c8 |
1 changed files with 56 additions and 0 deletions
56
.forgejo/workflows/ci.yml
Normal file
56
.forgejo/workflows/ci.yml
Normal file
|
|
@ -0,0 +1,56 @@
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: docker-x64
|
||||||
|
container:
|
||||||
|
image: python:3.12-slim
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install system deps
|
||||||
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y --no-install-recommends git build-essential
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
- name: Install uv (fast Python package manager)
|
||||||
|
run: |
|
||||||
|
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||||
|
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
||||||
|
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||||
|
|
||||||
|
- name: Setup Python
|
||||||
|
run: |
|
||||||
|
uv python install 3.12
|
||||||
|
uv venv --python 3.12 .venv
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
if [ -f pyproject.toml ]; then
|
||||||
|
uv pip install --python .venv/bin/python -e ".[dev]" 2>/dev/null || \
|
||||||
|
uv pip install --python .venv/bin/python -e .
|
||||||
|
if [ -f requirements.txt ]; then
|
||||||
|
uv pip install --python .venv/bin/python -r requirements.txt
|
||||||
|
fi
|
||||||
|
elif [ -f requirements.txt ]; then
|
||||||
|
uv pip install --python .venv/bin/python -r requirements.txt
|
||||||
|
fi
|
||||||
|
uv pip install --python .venv/bin/python ruff mypy pytest pytest-asyncio pytest-cov
|
||||||
|
|
||||||
|
- name: Lint (ruff)
|
||||||
|
run: source .venv/bin/activate && ruff check . && ruff format --check .
|
||||||
|
|
||||||
|
- name: Type check (mypy)
|
||||||
|
run: source .venv/bin/activate && mypy . --ignore-missing-imports || true
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
|
- name: Test (pytest)
|
||||||
|
run: source .venv/bin/activate && pytest --maxfail=1 -x -q 2>&1 || true
|
||||||
|
continue-on-error: true
|
||||||
Loading…
Add table
Add a link
Reference in a new issue