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

[WIP] Move CI to Github Actions #692

Open
wants to merge 6 commits into
base: master
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
34 changes: 34 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Lint
on:
push:
branches-ignore:
- django-2.2
pull_request:
branches-ignore:
- django-2.2

jobs:
lint:
runs-on: ubuntu-16.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install project dependencies
run: |
pip install --upgrade pip
pip install nox
pip install coveralls
Copy link
Contributor

Choose a reason for hiding this comment

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

This shouldn't be required here

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice catch. 👍

- name: Check for linting issues
run: nox -s lint-3.8
54 changes: 54 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Test
on:
push:
branches-ignore:
- django-2.2
pull_request:
branches-ignore:
- django-2.2

jobs:
test:
strategy:
matrix:
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
runs-on: ubuntu-16.04
env:
DJANGO_SETTINGS_MODULE: "settings.test_settings"
services:
postgres:
image: postgres:12.2
ports:
- 5432:5432
redis:
image: redis:6
ports:
- 6379:6379
steps:
- name: Checkout code
uses: actions/checkout@v2
# Python 3.5 needs to be set up here since Django 1.9 does not run beyond that
- name: Setup Python 3.5
uses: actions/setup-python@v1
with:
python-version: 3.5
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install CI dependencies
run: |
pip install --upgrade pip
pip install celery==3.1.20 Django==1.9 # required for running celery
pip install nox
pip install codecov
- name: Run celery worker for tests
run: celery -A junction worker -l info --detach
- name: Run tests
run: nox -s test-${{ matrix.python-version }}
- name: Report coverage
uses: codecov/codecov-action@v1
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ repos:
rev: stable
hooks:
- id: black
language_version: python3.6
language_version: python3.8
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
include:
# Basic Checks
- stage: primary
env: NOXSESSION=lint-3.5
env: NOXSESSION=lint-3.8
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe take out this change since we are planning to move away from Travis ?

Copy link
Member Author

Choose a reason for hiding this comment

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

That is why the PR is labelled WIP. It is still functionally incomplete.

- env: NOXSESSION=test-2.7
- env: NOXSESSION=test-3.5
- env: NOXSESSION=docs
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test(session):
session.install("-r", "requirements.txt")
session.install("-r", "tools/requirements-test.txt")

session.run("pytest", "--cov", "-v", "--tb=native")
session.run("pytest", "--cov", "--cov-report=xml", "-v", "--tb=native")
session.run("coverage", "report", "-m")


Expand Down