moove coverage #5
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: Full CI | |
on: | |
push: | |
branches: [main, dev] | |
release: | |
types: [published] | |
workflow_dispatch: | |
inputs: | |
job: | |
description: 'Choose which job to run' | |
required: true | |
default: 'deploy' | |
type: choice | |
options: | |
- publish-module | |
- test-Django | |
- coverage | |
- all | |
permissions: | |
contents: read | |
jobs: | |
test-Django: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Dependencies | |
run: | | |
cd ./test/app/ | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install ../../ | |
- name: Run Tests | |
run: | | |
cd ./test/app/ | |
python manage.py test | |
coverage: | |
runs-on: ubuntu-latest | |
needs: test-Django | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.11' | |
- name: Install Dependencies | |
run: | | |
cd ./test/app/ | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install coverage | |
pip install ../../ | |
- name: Run Coverage | |
run: | | |
cd ./test/app/ | |
coverage run manage.py test | |
coverage xml | |
- name: Upload Coverage to GitHub | |
uses: actions/upload-artifact@v2 | |
with: | |
name: coverage-report | |
path: ./test/app/coverage.xml | |
- name: Report Coverage | |
uses: codecov/codecov-action@v2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./test/app/coverage.xml | |
publish-module: | |
runs-on: ubuntu-latest | |
needs: [test-Django, coverage] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install build | |
- name: Check current folder | |
run: | | |
ls | |
- name: Build package | |
run: | | |
python -m build | |
- name: Publish build | |
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} |