-
Notifications
You must be signed in to change notification settings - Fork 191
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
palnabarun
wants to merge
6
commits into
pythonindia:master
Choose a base branch
from
palnabarun:add-github-actions
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
54f1e0e
Use Python 3.8 instead of Python 3.6 in black pre-commit config
palnabarun 9c76c3c
Use Python 3.8 nox environment for lint checks
palnabarun 65f40f6
Add Github Actions workflow for lint checks
palnabarun e1d7ae3
Add Github Actions workflow for running tests
palnabarun 637f19e
TBR: Comment coverage report -m
palnabarun 9af2371
fixup! TBR: Comment coverage report -m
palnabarun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 | ||
- name: Check for linting issues | ||
run: nox -s lint-3.8 |
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 |
---|---|---|
@@ -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 |
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 |
---|---|---|
|
@@ -36,4 +36,4 @@ repos: | |
rev: stable | ||
hooks: | ||
- id: black | ||
language_version: python3.6 | ||
language_version: python3.8 |
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 |
---|---|---|
|
@@ -20,7 +20,7 @@ jobs: | |
include: | ||
# Basic Checks | ||
- stage: primary | ||
env: NOXSESSION=lint-3.5 | ||
env: NOXSESSION=lint-3.8 | ||
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. Maybe take out this change since we are planning to move away from Travis ? 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. That is why the PR is labelled |
||
- env: NOXSESSION=test-2.7 | ||
- env: NOXSESSION=test-3.5 | ||
- env: NOXSESSION=docs | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 shouldn't be required here
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.
Nice catch. 👍