Skip to content

Commit 7eea60d

Browse files
authored
Migrate to GitHub Actions. (#738)
1 parent f004181 commit 7eea60d

File tree

13 files changed

+147
-95
lines changed

13 files changed

+147
-95
lines changed

.github/workflows/release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
build:
10+
if: github.repository == 'jazzband/django-pipeline'
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: 3.8
22+
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install -U pip
26+
python -m pip install -U setuptools twine wheel
27+
28+
- name: Build package
29+
run: |
30+
python setup.py --version
31+
python setup.py sdist --format=gztar bdist_wheel
32+
twine check dist/*
33+
34+
- name: Upload packages to Jazzband
35+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
36+
uses: pypa/gh-action-pypi-publish@master
37+
with:
38+
user: jazzband
39+
password: ${{ secrets.JAZZBAND_RELEASE_KEY }}
40+
repository_url: https://jazzband.co/projects/django-pipeline/upload

.github/workflows/test.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
fail-fast: false
10+
max-parallel: 5
11+
matrix:
12+
python-version: ['3.6', '3.7', '3.8', '3.9', 'pypy3']
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
22+
- name: Set up Node
23+
uses: actions/setup-node@v1
24+
with:
25+
node-version: '12'
26+
27+
- name: Instal Node dependencies
28+
run: npm install
29+
30+
- name: Get pip cache dir
31+
id: pip-cache
32+
run: |
33+
echo "::set-output name=dir::$(pip cache dir)"
34+
35+
- name: Cache
36+
uses: actions/cache@v2
37+
with:
38+
path: ${{ steps.pip-cache.outputs.dir }}
39+
key:
40+
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/tox.ini') }}
41+
restore-keys: |
42+
${{ matrix.python-version }}-v1-
43+
44+
- name: Install Python dependencies
45+
run: |
46+
python -m pip install --upgrade pip
47+
python -m pip install --upgrade tox tox-gh-actions
48+
49+
- name: Tox tests
50+
run: |
51+
tox -v
52+
53+
- name: Upload coverage
54+
uses: codecov/codecov-action@v1
55+
with:
56+
name: Python ${{ matrix.python-version }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ docs/_build/
1111
*.egg-info
1212
.coverage
1313
coverage/
14+
coverage.xml
1415
tests/static/
1516
tests/assets/js/dummy.js
1617
tests/node_modules/

.travis.yml

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

CONTRIBUTING.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ https://github.com/jazzband/django-pipeline/issues
2222
Running tests
2323
=============
2424

25-
We use tox to run the test suite on different versions locally (and travis-ci
25+
We use tox to run the test suite on different versions locally (and GitHub Actions
2626
to automate the check for PRs).
2727

2828
To tun the test suite locally, please make sure your python environment has

HISTORY.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
History
44
=======
55

6+
Unreleased
7+
==========
8+
9+
* Moving tests to GitHub Actions: https://github.com/jazzband/django-pipeline/actions
10+
611
2.0.5
712
======
813

README.rst

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
Pipeline
22
========
33

4-
.. image:: https://travis-ci.org/jazzband/django-pipeline.svg?branch=master
5-
:alt: Build Status
6-
:target: http://travis-ci.org/jazzband/django-pipeline
7-
8-
.. image:: https://coveralls.io/repos/github/jazzband/django-pipeline/badge.svg?branch=master
9-
:alt: Code Coverage
10-
:target: https://coveralls.io/github/jazzband/django-pipeline?branch=master
11-
124
.. image:: https://jazzband.co/static/img/badge.svg
135
:alt: Jazzband
146
:target: https://jazzband.co/
157

16-
.. image:: https://badge.fury.io/py/django-pipeline.svg
17-
:alt: PYPI
18-
:target: https://badge.fury.io/py/django-pipeline
8+
.. image:: https://github.com/jazzband/django-pipeline/workflows/Test/badge.svg
9+
:target: https://github.com/jazzband/django-pipeline/actions
10+
:alt: GitHub Actions
11+
12+
.. image:: https://codecov.io/gh/jazzband/django-pipeline/branch/master/graph/badge.svg
13+
:target: https://codecov.io/gh/jazzband/django-pipeline
14+
:alt: Coverage
1915

2016
.. image:: https://readthedocs.org/projects/django-pipeline/badge/?version=latest
2117
:alt: Documentation Status

docs/conf.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
#
1111
# All configuration values have a default; values that are commented out
1212
# serve to show the default.
13-
14-
import sys
15-
import os
13+
from pkg_resources import get_distribution
1614

1715
# If extensions (or modules to document with autodoc) are in another directory,
1816
# add these directories to sys.path here. If the directory is relative to the
@@ -48,10 +46,10 @@
4846
# |version| and |release|, also used in various other places throughout the
4947
# built documents.
5048
#
51-
# The short X.Y version.
52-
version = '2.0'
5349
# The full version, including alpha/beta/rc tags.
54-
release = '2.0.0'
50+
release = get_distribution("django-pipeline").version
51+
# The short X.Y version.
52+
version = ".".join(release.split(".")[:2])
5553

5654
# The language for content autogenerated by Sphinx. Refer to documentation
5755
# for a list of supported languages.

pipeline/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from pkg_resources import get_distribution, DistributionNotFound
2+
3+
try:
4+
__version__ = get_distribution("django-pipeline").version
5+
except DistributionNotFound:
6+
# package is not installed
7+
__version__ = None

setup.cfg

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
[wheel]
2-
universal = 1
3-
41
[metadata]
52
license_file = LICENSE

0 commit comments

Comments
 (0)