feat: add test workflow and implement unit tests for main functionality
This commit is contained in:
39
.gitea/workflows/test-application.yaml
Normal file
39
.gitea/workflows/test-application.yaml
Normal file
@@ -0,0 +1,39 @@
|
||||
name: Test Application
|
||||
run-name: ${{ gitea.actor }} tests the application
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: Create and activate virtual environment
|
||||
run: |
|
||||
python -m venv venv
|
||||
source venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
pip install pytest
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
source venv/bin/activate
|
||||
pytest --maxfail=1 --disable-warnings -q
|
||||
|
||||
- name: Deactivate virtual environment
|
||||
run: deactivate
|
||||
|
||||
- name: Clean up virtual environment
|
||||
run: rm -rf venv
|
||||
Reference in New Issue
Block a user