Skip to content

Commit

Permalink
Update test-package.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiocaccamo committed Mar 10, 2022
1 parent c912968 commit 6afdc7e
Showing 1 changed file with 53 additions and 11 deletions.
64 changes: 53 additions & 11 deletions .github/workflows/test-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,70 @@ on:
workflow_dispatch:

jobs:
build:

prepare:

runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Create matrix
uses: fabiocaccamo/create-matrix-action@v2
id: create_matrix
with:
matrix: |
python-version {2.7}, django-version {1.7,1.8,1.9,1.10,1.11}, database {sqlite}
python-version {3.6}, django-version {1.8,1.9,1.10,1.11,2.0,2.1,2.2,3.0,3.1,3.2}, database {sqlite}
python-version {3.7}, django-version {2.0,2.1,2.2,3.0,3.1,3.2}, database {sqlite}
python-version {3.8}, django-version {2.2,3.0,3.1,3.2}, database {sqlite}
python-version {3.9}, django-version {2.2,3.0,3.1,3.2}, database {sqlite}
python-version {3.10}, django-version {3.2,4.0}, database {sqlite}
outputs:
matrix: ${{ steps.create_matrix.outputs.matrix }}

test:

needs: prepare
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['2.7', '3.6', '3.7', '3.8', '3.9', '3.10']
matrix:
include: ${{fromJson(needs.prepare.outputs.matrix)}}

steps:

- uses: actions/checkout@v1
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install dependencies

- name: Upgrade pip version
run: |
pip install pip --upgrade
- name: Install django
run: |
pip install "Django ~= ${{ matrix.django-version }}"
- name: Install requirements
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
pip install -r requirements.txt
- name: Test with tox
run: tox
pip install -r requirements-test.txt
- name: Run tests
run: |
coverage run --append --source=colorfield setup.py test
coverage xml -o ./coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: false
files: ./coverage.xml
flags: unittests
verbose: true

0 comments on commit 6afdc7e

Please sign in to comment.