Skip to content

Upgrade django and python versions #8

Upgrade django and python versions

Upgrade django and python versions #8

name: Django Drip Coverage
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
jobs:
test:
runs-on: ubuntu-latest
env:
# Set the secret for the code coverage tool
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
strategy:
matrix:
python-version: ["3.12"]
steps:
# Check out the code from the repository
- name: Checkout code
uses: actions/checkout@v3
# Set up Python environment
- 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 django==4.2
pip install -r requirements/github-actions-requirements.txt
# Prepare code coverage reporting
- name: Install Code Climate Test Reporter
run: |
pip install codeclimate-test-reporter
# Run tests
- name: Run tests with coverage
run: |
coverage run -m pytest .
coverage report --fail-under=90 -m
coverage xml
# Upload coverage data to Code Climate
- name: Setup Code Climate test-reporter
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
./cc-test-reporter after-build --coverage-input-type coverage.py --exit-code $?