-
Notifications
You must be signed in to change notification settings - Fork 371
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Add testing for django 5.0 and django main (#566)
* ci: Improving tox workflow and updating test versions * build: Update classifiers * fix: Don't filter favs with unsaved (playground) queries * ci: Update github actions to run tox * fix: Change job name * fix: Adjust coverage path * fix: Remove coverage reporting from tox --------- Co-authored-by: Mark Walker <[email protected]>
- Loading branch information
1 parent
65a99d3
commit 5d2448b
Showing
10 changed files
with
67 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,116 +1,79 @@ | ||
name: Tests | ||
|
||
on: [push, pull_request] | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
group: ${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
|
||
jobs: | ||
unit-tests: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.8', '3.9', '3.10', '3.11'] | ||
django-version: ['3.2', '4.0', '4.1', '4.2b1'] | ||
os: [ | ||
ubuntu-20.04, | ||
] | ||
exclude: | ||
- python-version: '3.11' | ||
django-version: '3.2' | ||
- python-version: '3.11' | ||
django-version: '4.0' | ||
env: | ||
ENABLE_TASKS: no | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements/base.txt | ||
pip install Django==${{ matrix.django-version }} | ||
python setup.py install | ||
- name: Run tests | ||
run: coverage run --source=explorer manage.py test | ||
tests: | ||
name: Python ${{ matrix.python-version }} | ||
runs-on: ubuntu-22.04 | ||
|
||
- name: Upload Coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
|
||
unit-tests-with-optional-packages: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.8', '3.9', '3.10', '3.11'] | ||
django-version: ['3.2', '4.0', '4.1', '4.2b1'] | ||
os: [ | ||
ubuntu-20.04, | ||
] | ||
exclude: | ||
- python-version: '3.11' | ||
django-version: '3.2' | ||
- python-version: '3.11' | ||
django-version: '4.0' | ||
env: | ||
ENABLE_TASKS: yes | ||
python-version: | ||
- '3.10' | ||
- '3.11' | ||
- '3.12' | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: pip | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements/base.txt | ||
pip install -r requirements/optional.txt | ||
pip install Django==${{ matrix.django-version }} | ||
python setup.py install | ||
- name: Run tests | ||
run: coverage run --source=explorer manage.py test | ||
python -m pip install --upgrade pip setuptools wheel | ||
python -m pip install --upgrade 'tox>=4.0.0rc3' | ||
- name: Upload Coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
- name: Run tox targets for ${{ matrix.python-version }} | ||
run: tox run -f py$(echo ${{ matrix.python-version }} | tr -d .) | ||
|
||
unit-tests-future-versions: | ||
# Runs for all Django/Python versions which are not yet supported | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.10', '3.11'] | ||
django-version: [ | ||
'https://github.com/django/django/archive/main.tar.gz' | ||
] | ||
os: [ | ||
ubuntu-20.04, | ||
] | ||
- name: Upload coverage data | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: coverage-data-${{ matrix.python-version }} | ||
path: '${{ github.workspace }}/.coverage*' | ||
|
||
coverage: | ||
name: Coverage | ||
runs-on: ubuntu-22.04 | ||
needs: tests | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
|
||
uses: actions/setup-python@v5 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
python-version: '3.12' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install ${{ matrix.django-version }} coverage | ||
python setup.py install | ||
run: python -m pip install --upgrade coverage[toml] | ||
|
||
- name: Download data | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: ${{ github.workspace }} | ||
pattern: coverage-data-* | ||
merge-multiple: true | ||
|
||
- name: Run coverage | ||
run: coverage run --source=explorer manage.py test | ||
continue-on-error: true | ||
- name: Combine coverage | ||
run: | | ||
python -m coverage combine | ||
python -m coverage html --skip-covered --skip-empty | ||
python -m coverage report | ||
- name: Upload Coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
- name: Upload HTML report | ||
if: ${{ failure() }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: html-report | ||
path: htmlcov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
/build | ||
*# | ||
*~ | ||
.coverage | ||
.coverage* | ||
/htmlcov/ | ||
*.orig | ||
tmp | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
-r base.txt | ||
|
||
importlib-metadata<5.0; python_version <= '3.7' | ||
celery>=4.0 | ||
boto3>=1.20.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters