added celery,pytest,workflows not tested #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- "main" | |
jobs: | |
test: | |
name: Run tests & display coverage | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
contents: write | |
steps: | |
# Step 1: Checkout the code | |
- uses: actions/checkout@v4 | |
# Step 2: Set up Python and install dependencies | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install pytest pytest-cov # Install pytest and coverage plugin | |
# Step 3: Run pytest with coverage | |
- name: Run tests with pytest | |
run: | | |
pytest --cov=. # Run pytest and generate coverage for the entire project | |
# Step 4: Generate a coverage report | |
- name: Generate coverage report | |
run: | | |
coverage xml # Generates an XML report | |
# Step 5: Post coverage comment | |
- name: Coverage comment | |
uses: py-cov-action/python-coverage-comment-action@v3 | |
with: | |
GITHUB_TOKEN: ${{ github.token }} |