35 lines
1009 B
YAML
35 lines
1009 B
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: debian:bookworm-slim
|
|
|
|
steps:
|
|
- name: Checkout
|
|
run: |
|
|
apt-get update && apt-get install -y --no-install-recommends git ca-certificates
|
|
git clone --depth 1 --branch "${GITHUB_REF_NAME}" \
|
|
"https://oauth2:${{ github.token }}@${GITHUB_SERVER_URL#https://}/${GITHUB_REPOSITORY}.git" .
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
apt-get install -y --no-install-recommends python3 python3-pip python3-venv
|
|
python3 -m venv venv
|
|
./venv/bin/pip install --quiet --upgrade pip
|
|
./venv/bin/pip install --quiet -r requirements.txt
|
|
./venv/bin/pip install --quiet pytest pytest-cov
|
|
|
|
- name: Run tests
|
|
run: ./venv/bin/pytest tests/ -v --tb=short
|
|
|
|
- name: Check syntax
|
|
run: ./venv/bin/python -m py_compile run.py wsgi.py app/*.py app/**/*.py
|