Skip to content

Bump actions/setup-python from 4 to 5 #140

Bump actions/setup-python from 4 to 5

Bump actions/setup-python from 4 to 5 #140

Workflow file for this run

name: Tests
on:
push:
branches:
- main
paths:
- '**.py'
- '**.txt'
- '**.yaml'
- '**.toml'
pull_request:
branches:
- main
paths:
- '**.py'
- '**.txt'
- '**.toml'
- '**.yaml'
env:
GITHUB_WORKFLOW: true
jobs:
test:
name: Test
runs-on: ubuntu-latest
# test matrix
strategy:
fail-fast: false
matrix:
python-version:
- 3.8
- 3.9
- "3.10"
- "3.11"
- "3.12"
django:
- 3.2
- 4.0
- 4.1
- 4.2
- 5.0
database:
- sqlite
- mysql
- postgres
exclude:
- python-version: 3.8
django: 5.0
- python-version: 3.9
django: 5.0
- python-version: "3.11"
django: 3.2
- python-version: "3.12"
django: 3.2
# additional service containers to run
services:
# postgres service
postgres:
# docker hub image
image: postgres:13-alpine
# configure the instance
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
# set health checks to wait until service has started
options: >-
--health-cmd="pg_isready"
--health-interval=10s
--health-timeout=5s
--health-retries=5
# mysql service
mysql:
# docker hub image
image: mysql:8
# configure the instance
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: test
ports:
- 3306:3306
# set health checks to wait until service has started
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=5
steps:
# check out revision to test
- uses: actions/checkout@v4
# install python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# upgrade pip
- name: Update pip
run: python -m pip install --upgrade pip
# install environment specific dependencies
- name: Install coverage
run: pip install coverage>=5.3 setuptools
- name: Install Django 3.2
if: matrix.django == 3.2
run: pip install "Django>=3.2,<4.0"
- name: Install Django 4.0
if: matrix.django == 4.0
run: pip install "Django>=4.0,<4.1"
- name: Install Django 4.1
if: matrix.django == 4.1
run: pip install "Django>=4.1,<4.2"
- name: Install Django 4.2
if: matrix.django == 4.2
run: pip install "Django>=4.2,<5.0"
- name: Install Django 5.0
if: matrix.django == 5.0
run: pip install "Django>=5.0,<5.1"
- name: Install MySQL libs
if: matrix.database == 'mysql'
run: pip install mysqlclient>=2.0.1 django-mysql>=3.9.0
- name: Install postgres libs
if: matrix.database == 'postgres'
run: pip install psycopg2-binary>=2.8.6
- name: Install Django ReST framework libraries
run: pip install -U django-rest-framework rest-framework-generic-relations drf-spectacular
# install our package
- name: Install package
run: pip install -e .
# execute the tests
- name: Run tests
run: coverage run runtests/manage.py test -v3 --noinput actstream testapp testapp_nested
env:
DATABASE_ENGINE: ${{ matrix.database }}
# COVERAGE_FILE: ".coverage.${{ matrix.python_version }}"
- name: Store coverage file
uses: actions/upload-artifact@v3
with:
name: coverage
path: .coverage #.${{ matrix.python_version }}
- name: Coveralls
uses: AndreMiras/coveralls-python-action@develop
with:
parallel: true
flag-name: Unit Test
coveralls_finish:
needs: test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true