Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test django 3.2 with github action #2

Open
wants to merge 3 commits into
base: releases/2.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Tests

on:
push:
branches:
- master
- /^releases.*$/
pull_request:
branches:
- master
- /^releases.*$/

jobs:
test:
name: Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: [3.7, 3.8, 3.9]
django-version: [3.0, 3.1, 3.2]
services:
postgres:
image: postgres:9.6
ports:
- 5432/tcp
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install -e .[test]
pip install -r requirements.txt
pip install "django~=${{ matrix.django-version }}.0"
- name: Run tests
env:
DATABASE_USER: postgres
DATABASE_PASSWORD: postgres
DATABASE_HOST: localhost
DATABASE_PORT: ${{ job.services.postgres.ports[5432] }} # get randomly assigned published port
run: |
coverage run --parallel -m pytest -x
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
lint_python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run linters
run: |
flake8 src tests setup.py
isort -c -q --diff src/ tests/
lint_js:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up NodeJS
uses: actions/setup-node@v1
- name: Install dependencies
run: |
npm ci
- name: Run linters
run: |
npm run eslint
sandbox:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Build sandbox
run: |
python -m pip install --upgrade pip
make sandbox
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Build docs
run: |
make docs
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from oscar import get_version # noqa isort:skip

install_requires = [
'django>=2.2,<3.1',
'django>=2.2,<4.0',
# PIL is required for image fields, Pillow is the "friendly" PIL fork
'pillow>=6.0',
# We use the ModelFormSetView from django-extra-views for the basket page
Expand All @@ -37,7 +37,7 @@
# Used for oscar.test.newfactories
'factory-boy>=2.4.1,<3.0',
# Used for automatically building larger HTML tables
'django-tables2>=2.2,<2.3',
'django-tables2>=2.2',
# Used for manipulating form field attributes in templates (eg: add
# a css class)
'django-widget-tweaks>=1.4.1',
Expand Down