Skip to content

Upgrade django and python versions #1

Upgrade django and python versions

Upgrade django and python versions #1

name: Django Tests
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 github-actions-requirements.txt
# Prepare code coverage reporting
- name: Install Code Climate Test Reporter
run: |
pip install codeclimate-test-reporter
codeclimate-test-reporter before-build
# Run tests
- name: Run tests with coverage
run: |
coverage run manage.py test
coverage report
# Upload coverage data to Code Climate
- name: Upload coverage to Code Climate
run: |
coverage xml
codeclimate-test-reporter after-build --exit-code ${{ job.status }}