ci: add Gitea Actions for Python
This commit is contained in:
12
.drone.yml
12
.drone.yml
@@ -1,12 +0,0 @@
|
|||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: test
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: run tests
|
|
||||||
image: python:3.10
|
|
||||||
commands:
|
|
||||||
- pip install --upgrade pip
|
|
||||||
- pip install -r requirements.txt
|
|
||||||
- pip install pytest
|
|
||||||
- pytest tests/
|
|
||||||
34
.gitea/workflows/python-test.yml
Normal file
34
.gitea/workflows/python-test.yml
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
name: Python Test
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "master", "main" ]
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: "3.10"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
if [ -f "requirements.txt" ]; then
|
||||||
|
pip install -r requirements.txt
|
||||||
|
fi
|
||||||
|
pip install pytest
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: |
|
||||||
|
if [ -d "tests" ]; then
|
||||||
|
pytest tests/ --verbose
|
||||||
|
else
|
||||||
|
echo "No tests directory found, skipping tests."
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user