Skip to content

Switch from nose to pynose #129

Switch from nose to pynose

Switch from nose to pynose #129

Workflow file for this run

name: tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ['3.9']
django:
- 'Django>=3.2,<3.3'
- 'Django>=4.0,<4.1'
experimental: [false]
include:
- python: '3.9'
django: 'https://github.com/django/django/archive/refs/heads/stable/4.2.x.zip#egg=Django'
experimental: true
# NOTE this job will appear to pass even when it fails because of
# `continue-on-error: true`. Github Actions apparently does not
# have this feature, similar to Travis' allow-failure, yet.
# https://github.com/actions/toolkit/issues/399
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Setup
run: |
python --version
pip install --upgrade pip wheel
pip install "${{ matrix.django }}" psycopg2-binary pynose flake8 coverage
- name: Run tests
env:
DB_SETTINGS: >-
{
"ENGINE":"django.db.backends.postgresql_psycopg2",
"NAME":"field_audit",
"USER":"postgres",
"PASSWORD":"postgres",
"HOST":"localhost",
"PORT":"5432"
}
run: nosetests -v --with-coverage --cover-branches --cover-package=field_audit
continue-on-error: ${{ matrix.experimental }}
- name: Check migrations
run: |
./example/manage.py makemigrations field_audit
git add ./field_audit/migrations
trap 'git reset --hard HEAD' EXIT # discard changes on exit (needed for continue-on-error)
git diff --cached --exit-code
continue-on-error: ${{ matrix.experimental }}
- name: Check style
run: flake8 --config=setup.cfg