Skip to content

Move CI to GitHub Actions #7903

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

Merged
merged 5 commits into from
Apr 6, 2021
Merged
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
57 changes: 57 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: CI

on:
push:
branches:
- main
pull_request:

jobs:
tests:
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-20.04

strategy:
matrix:
python-version:
- '3.6'
- '3.7'
- '3.8'
- '3.9'

steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/*.txt') }}
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

- name: Run extra tox targets
if: ${{ matrix.python-version == '3.9' }}
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

- name: Upload coverage
run: |
codecov -e TOXENV,DJANGO
55 changes: 0 additions & 55 deletions .travis.yml

This file was deleted.

18 changes: 18 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,21 @@ commands = mkdocs build
deps =
-rrequirements/requirements-testing.txt
-rrequirements/requirements-documentation.txt

[testenv:py36-django32]
ignore_outcome = true

[testenv:py37-django32]
ignore_outcome = true

[testenv:py38-django32]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be allowing test failures on 3.2? It's due this week?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just copying what's there already - I think there's a process to update things when the release comes out.

ignore_outcome = true

[testenv:py39-django32]
ignore_outcome = true

[testenv:py38-djangomain]
ignore_outcome = true

[testenv:py39-djangomain]
ignore_outcome = true