forked from username/flaskpaste
add gitea ci workflow
This commit is contained in:
34
.gitea/workflows/ci.yml
Normal file
34
.gitea/workflows/ci.yml
Normal file
@@ -0,0 +1,34 @@
|
||||
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
|
||||
Reference in New Issue
Block a user