Skip to content

Commit 6c43a34

Browse files
committed
feat: Shifted CI from Travis to Github Actions
1 parent eea6aaa commit 6c43a34

8 files changed

Lines changed: 118 additions & 60 deletions

File tree

.github/workflows/ci.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Python CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches:
8+
- '**'
9+
10+
jobs:
11+
run_tests:
12+
name: Tests
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os: [ubuntu-20.04]
17+
python-version: ['3.8']
18+
toxenv: [django22, django30, django31, django32, quality, docs]
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: setup python
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
27+
- name: Install pip
28+
run: pip install -r requirements/pip.txt
29+
30+
- name: Install Dependencies
31+
run: pip install -r requirements/ci.txt
32+
33+
- name: Run Tests
34+
env:
35+
TOXENV: ${{ matrix.toxenv }}
36+
run: tox
37+
38+
- name: Run Coverage
39+
if: matrix.python-version == '3.8' && matrix.toxenv=='django22'
40+
uses: codecov/codecov-action@v1
41+
with:
42+
flags: unittests
43+
fail_ci_if_error: true

.github/workflows/pypi-publish.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish package to PyPi
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
9+
push:
10+
runs-on: ubuntu-20.04
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
- name: setup python
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: 3.8
19+
20+
- name: Install pip
21+
run: pip install -r requirements/pip.txt
22+
23+
- name: Install Dependencies
24+
run: pip install setuptools wheel
25+
26+
- name: Build package
27+
run: python setup.py sdist bdist_wheel
28+
29+
- name: Publish to PyPi
30+
uses: pypa/gh-action-pypi-publish@master
31+
with:
32+
user: __token__
33+
password: ${{ secrets.PYPI_UPLOAD_TOKEN }}

.travis.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,14 @@ upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade
4141
upgrade: ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
4242
pip install -qr requirements/pip-tools.txt
4343
# Make sure to compile files after any other files they include!
44+
pip-compile --upgrade --allow-unsafe -o requirements/pip.txt requirements/pip.in
4445
pip-compile --upgrade -o requirements/pip-tools.txt requirements/pip-tools.in
4546
pip-compile --upgrade -o requirements/base.txt requirements/base.in
4647
pip-compile --upgrade -o requirements/django.txt requirements/django.in
4748
pip-compile --upgrade -o requirements/test.txt requirements/test.in
4849
pip-compile --upgrade -o requirements/doc.txt requirements/doc.in
4950
pip-compile --upgrade -o requirements/quality.txt requirements/quality.in
50-
pip-compile --upgrade -o requirements/travis.txt requirements/travis.in
51+
pip-compile --upgrade -o requirements/ci.txt requirements/ci.in
5152
pip-compile --upgrade -o requirements/dev.txt requirements/dev.in
5253
# Let tox control the Django version for tests
5354
sed '/^[dD]jango==/d' requirements/test.txt > requirements/test.tmp
@@ -57,6 +58,7 @@ quality: ## check coding style with pycodestyle and pylint
5758
tox -e quality
5859

5960
requirements: ## install development environment requirements
61+
pip install -qr requirements/pip.txt
6062
pip install -qr requirements/pip-tools.txt
6163
pip-sync requirements/dev.txt requirements/test.txt requirements/private.*
6264
pip install -e .
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Requirements for running tests in Travis
1+
# Requirements for running tests in Github Actions
22

33
-c constraints.txt
44

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,52 @@
11
#
2-
# This file is autogenerated by pip-compile
2+
# This file is autogenerated by pip-compile with python 3.8
33
# To update, run:
44
#
5-
# make upgrade
5+
# pip-compile --output-file=requirements/ci.txt requirements/ci.in
66
#
7-
appdirs==1.4.4
7+
backports.entry-points-selectable==1.1.0
88
# via virtualenv
9-
certifi==2020.12.5
9+
certifi==2021.5.30
1010
# via requests
11-
chardet==4.0.0
11+
charset-normalizer==2.0.4
1212
# via requests
13-
codecov==2.1.11
14-
# via -r requirements/travis.in
13+
codecov==2.1.12
14+
# via -r requirements/ci.in
1515
coverage==5.5
1616
# via codecov
17-
distlib==0.3.1
17+
distlib==0.3.2
1818
# via virtualenv
1919
filelock==3.0.12
2020
# via
2121
# tox
2222
# virtualenv
23-
idna==2.10
23+
idna==3.2
2424
# via requests
25-
packaging==20.9
25+
packaging==21.0
2626
# via tox
27+
platformdirs==2.2.0
28+
# via virtualenv
2729
pluggy==0.13.1
2830
# via tox
2931
py==1.10.0
3032
# via tox
3133
pyparsing==2.4.7
3234
# via packaging
33-
requests==2.25.1
35+
requests==2.26.0
3436
# via codecov
3537
six==1.16.0
3638
# via
3739
# tox
3840
# virtualenv
3941
toml==0.10.2
4042
# via tox
41-
tox-battery==0.6.1
42-
# via -r requirements/travis.in
43-
tox==3.23.1
43+
tox==3.24.1
4444
# via
45-
# -r requirements/travis.in
45+
# -r requirements/ci.in
4646
# tox-battery
47-
urllib3==1.26.4
47+
tox-battery==0.6.1
48+
# via -r requirements/ci.in
49+
urllib3==1.26.6
4850
# via requests
49-
virtualenv==20.4.6
51+
virtualenv==20.7.2
5052
# via tox

requirements/pip.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Core dependencies for installing other packages
2+
3+
pip
4+
setuptools
5+
wheel

requirements/pip.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#
2+
# This file is autogenerated by pip-compile with python 3.8
3+
# To update, run:
4+
#
5+
# pip-compile --allow-unsafe --output-file=requirements/pip.txt requirements/pip.in
6+
#
7+
wheel==0.37.0
8+
# via -r requirements/pip.in
9+
10+
# The following packages are considered to be unsafe in a requirements file:
11+
pip==21.2.4
12+
# via -r requirements/pip.in
13+
setuptools==57.4.0
14+
# via -r requirements/pip.in

0 commit comments

Comments
 (0)