-
-
Notifications
You must be signed in to change notification settings - Fork 7k
adjust GitHub actions to test Django versions #7910
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,17 +8,36 @@ on: | |
|
||
jobs: | ||
tests: | ||
name: Python ${{ matrix.python-version }} | ||
name: Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }} | ||
runs-on: ubuntu-20.04 | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
django-version: | ||
- '3.1' | ||
- '3.2' | ||
python-version: | ||
- '3.6' | ||
- '3.7' | ||
- '3.8' | ||
- '3.9' | ||
|
||
include: | ||
# Old Django LTS only on older Pythons | ||
- django-version: '2.2' | ||
python-version: '3.6' | ||
|
||
- django-version: '2.2' | ||
python-version: '3.7' | ||
|
||
# Pre-release Django only on new Pythons | ||
- django-version: 'main' | ||
python-version: '3.8' | ||
|
||
- django-version: 'main' | ||
python-version: '3.9' | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
|
@@ -33,25 +52,33 @@ jobs: | |
restore-keys: | | ||
${{ runner.os }}-pip- | ||
|
||
- name: Upgrade packaging tools | ||
run: python -m pip install --upgrade pip setuptools virtualenv wheel | ||
|
||
- name: Install dependencies | ||
run: python -m pip install --upgrade codecov tox | ||
|
||
- name: Run tox targets for ${{ matrix.python-version }} | ||
run: | | ||
ENV_PREFIX=$(tr -C -d "0-9" <<< "${{ matrix.python-version }}") | ||
TOXENV=$(tox --listenvs | grep "^py$ENV_PREFIX" | tr '\n' ',') tox | ||
python -m pip install --upgrade pip setuptools virtualenv wheel | ||
python -m pip install --upgrade codecov tox tox-gh-actions | ||
|
||
- name: Run extra tox targets | ||
if: ${{ matrix.python-version == '3.9' }} | ||
- name: Run tox | ||
run: | | ||
python setup.py bdist_wheel | ||
rm -r djangorestframework.egg-info # see #6139 | ||
tox -e base,dist,docs | ||
tox -e dist --installpkg ./dist/djangorestframework-*.whl | ||
Comment on lines
-50
to
-53
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This appears to be no longer needed |
||
TOX_EXIT=0 | ||
tox || TOX_EXIT=$? | ||
|
||
if [[ $DJANGO == '3.2' && ${{ matrix.python-version }} == '3.9' ]]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could be done as before, but I believe it would not be run if the first fails. This should allow both to run and report an error if either fails. |
||
# Run extra tox targets | ||
# This would not be needed after https://github.com/ymyzk/tox-gh-actions/pull/60 | ||
tox -e base,dist,docs | ||
TOX_EXTRA_EXIT=$? | ||
|
||
if [[ $TOX_EXIT == 0 ]]; then | ||
TOX_EXIT=$TOX_EXTRA_EXIT | ||
fi | ||
fi | ||
|
||
exit $TOX_EXIT | ||
env: | ||
DJANGO: ${{ matrix.django-version }} | ||
|
||
- name: Upload coverage | ||
run: | | ||
codecov -e TOXENV,DJANGO | ||
codecov -e DJANGO | ||
env: | ||
DJANGO: ${{ matrix.django-version }} |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be filled in by
tox-gh-actions
and with ymyzk/tox-gh-actions#60 it could specify everything.