Skip to content

Commit d95c4cd

Browse files
authored
Add GitHub actions CI pipeline (#145)
* Add GitHub actions CI pipeline * Remove Travis test setup * Deprecate pip release cache * README cleanup * Update CI badge from Travis to GH Actions * Allow failure for Django master
1 parent d2d566e commit d95c4cd

File tree

5 files changed

+107
-71
lines changed

5 files changed

+107
-71
lines changed

.github/workflows/release.yml

+40
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-embed-video'
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-embed-video/upload

.github/workflows/test.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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: Get pip cache dir
23+
id: pip-cache
24+
run: |
25+
echo "::set-output name=dir::$(pip cache dir)"
26+
27+
- name: Cache
28+
uses: actions/cache@v2
29+
with:
30+
path: ${{ steps.pip-cache.outputs.dir }}
31+
key:
32+
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.py') }}
33+
restore-keys: |
34+
${{ matrix.python-version }}-v1-
35+
36+
- name: Install dependencies
37+
run: |
38+
python -m pip install --upgrade pip
39+
python -m pip install --upgrade tox tox-gh-actions
40+
41+
- name: Tox tests
42+
run: |
43+
tox -v
44+
45+
- name: Upload coverage
46+
uses: codecov/codecov-action@v1
47+
with:
48+
name: Python ${{ matrix.python-version }}

.travis.yml

-50
This file was deleted.

README.rst

+6-4
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ Django app for easy embedding YouTube and Vimeo videos and music from SoundCloud
66
.. image:: https://jazzband.co/static/img/badge.svg
77
:target: https://jazzband.co/
88
:alt: Jazzband
9-
.. image:: https://travis-ci.org/jazzband/django-embed-video.svg?branch=master
10-
:target: https://travis-ci.org/jazzband/django-embed-video
11-
:alt: Travis CI build status
9+
.. image:: https://github.com/jazzband/django-embed-video/workflows/Test/badge.svg
10+
:target: https://github.com/jazzband/django-embed-video/actions
11+
:alt: GitHub Actions
1212
.. image:: https://coveralls.io/repos/yetty/django-embed-video/badge.svg?branch=master
1313
:target: https://coveralls.io/r/yetty/django-embed-video?branch=master
1414
:alt: Coveralls coverage percentage
@@ -19,10 +19,11 @@ Django app for easy embedding YouTube and Vimeo videos and music from SoundCloud
1919
:target: https://pypi.org/project/django-embed-video/
2020
:alt: Supported Django versions
2121

22+
2223
Documentation
2324
-------------
2425

25-
Documentation is here: http://django-embed-video.rtfd.org/
26+
Documentation is at: http://django-embed-video.rtfd.org/
2627

2728

2829
Quick start
@@ -90,6 +91,7 @@ Quick start
9091
class Item(models.Model):
9192
video = EmbedVideoField() # same like models.URLField()
9293
94+
9395
Contributing
9496
------------
9597

tox.ini

+13-17
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,39 @@
11
[tox]
22
envlist =
3-
qa
4-
py{36,37,38,39,py3}-django{22,30,31,master}
3+
py38-qa
4+
py{36,37,38,39,py3}-dj{22,30,31,master}
55

6-
[travis]
6+
[gh-actions]
77
python =
88
3.6: py36
99
3.7: py37
1010
3.8: py38
1111
3.9: py39
1212
pypy3: pypy3
1313

14-
[travis:env]
15-
DJANGO =
16-
2.2: django22
17-
3.0: django30
18-
3.1: django31
19-
master: djangomaster
20-
2114
[testenv]
2215
deps =
23-
django22: django>=2.2,<2.3
24-
django30: django>=3.0,<3.1
25-
django31: django>=3.1,<3.2
26-
djangomaster: https://github.com/django/django/archive/master.tar.gz
16+
dj22: django>=2.2,<2.3
17+
dj30: django>=3.0,<3.1
18+
dj31: django>=3.1,<3.2
19+
djmaster: https://github.com/django/django/archive/master.tar.gz
2720
usedevelop = True
2821
commands =
2922
python setup.py build
3023
python setup.py nosetests --verbosity 2 --with-coverage --cover-tests --cover-erase
3124
setenv =
3225
PYTHONDONTWRITEBYTECODE=1
3326

34-
[testenv:qa]
27+
[testenv:py{36,37,38,39,py3}-djmaster]
28+
ignore_errors = true
29+
ignore_outcome = true
30+
31+
[testenv:py38-qa]
3532
basepython = python3.8
3633
deps =
3734
black==20.8b1
3835
isort==5.6.4
39-
skip_install =
40-
True
36+
skip_install = true
4137
commands =
4238
isort --profile black --check-only --diff embed_video setup.py
4339
black -t py36 --check --diff embed_video

0 commit comments

Comments
 (0)