[workflows]: Add ci.yml
This commit is contained in:
43
.github/workflows/ci.yml
vendored
Normal file
43
.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
name: Continuous Integration
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
python-version: [3.13]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# Checkout the code
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
# Set up Python
|
||||||
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install -r server/src/requirements.txt
|
||||||
|
|
||||||
|
# Run tests with coverage
|
||||||
|
- name: Run tests with coverage
|
||||||
|
run: PYTHONPATH=$(pwd)/src pytest --cov=src/functions --cov-report=html
|
||||||
|
#
|
||||||
|
# Upload coverage report as an artifact
|
||||||
|
- name: Upload coverage report (HTML)
|
||||||
|
if: always()
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: coverage-report-html
|
||||||
|
path: htmlcov/
|
Reference in New Issue
Block a user