Skip to content

Commit

Permalink
Switch to GitHub Actions and update release to 2.1.3 (#546)
Browse files Browse the repository at this point in the history
Merging without review on the basis that this version actually builds, and _some_ CI environment is much better than _no_ CI! Also good to get @spoeschel 's `release/2.1.3` work into the wild. It's been too long.

Some experimentation involved in this merge since I cannot verify that the GitHub action to publish to gh-pages will work except by doing it!

* Fix nltk dependency

Use the last version that supports Python 2.7.

Fixes #533.

* Fix Pytest-BDD dependency

As versions newer than 3.2.1 don't work with the test suite, use the
last working version, as a maintenance fix to this legacy branch.

Addresses #537 regarding the legacy Python 2 branch.

* Pin used Python 2 packages

Prevents issues like #533 in the future, as it is expected that further
dependencies will remove Python 2 support in the future.

The updated file has been generated using `pip freeze` and replacing the
repository path of the toolkit by `.`. The `pkg-resources==0.0.0` line
has been removed, as it was present due to [a bug](pypa/pip#4022).

The `--index-url` parameter has been removed, as the specified URL
meanwhile forwards to the default package index.

Implements #538.

* Setup GitHub Actions CI workflows for test and for docs and UI generation.

Create test.yml
Update README.md to fix the build status badge
Create docs_and_ui.yml
Push docs to gh-pages on success
Add coveralls
Add Slack notification

* Up version to 2.1.3

Co-authored-by: Stefan Pöschel <spoeschel@irt.de>
  • Loading branch information
nigelmegitt and spoeschel committed Dec 21, 2021
1 parent a8d18ab commit dc4e7be
Show file tree
Hide file tree
Showing 9 changed files with 261 additions and 67 deletions.
96 changes: 96 additions & 0 deletions .github/workflows/docs_and_ui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Build the documentation and the UI

on:
push:
branches:
- master
pull_request:

jobs:
docs_and_ui:
name: Build the Documentation and UI
runs-on: ubuntu-latest
steps:
- name: Skip publishing to GitHub Pages
env:
REF_NAME: ${{ github.ref }}
if: ${{ 'refs/head/master' != env.REF_NAME }}
run: |
echo "This is NOT a push to master branch, not pushing to github-pages"
- uses: actions/checkout@v2
- name: Clean docs
run: |
if [ -d docs/build/ui ]; then rm -R docs/build/ui; fi
shell: bash
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: '16.x'
- name: Generate templates
run: |
npm install nunjucks
node_modules/nunjucks/bin/precompile ebu_tt_live/ui/user_input_producer/template/user_input_producer_template.xml > ebu_tt_live/ui/user_input_producer/template/user_input_producer_template.js
node_modules/nunjucks/bin/precompile ebu_tt_live/ui/user_input_producer/template/live_message_template.xml > ebu_tt_live/ui/user_input_producer/template/live_message_template.js
- name: Copy UI files into place
run: |
mkdir -p docs/build/ui
cp -R ebu_tt_live/ui/user_input_producer docs/build/ui/
cp -R ebu_tt_live/ui/test docs/build/ui/
cp -R ebu_tt_live/ui/assets docs/build/ui/user_input_producer/
cp -R ebu_tt_live/ui/assets docs/build/ui/test/
shell: bash
- name: Setup graphviz
uses: ts-graphviz/setup-graphviz@v1
- name: Setup Python 2.7
uses: actions/setup-python@v2
with:
python-version: '2.7'
cache: 'pip'
- name: Install older pip
run: |
python -m pip install pip==20.3.4
shell: bash
- name: Install dependencies
run: |
pip install -r requirements.txt
shell: bash
- name: Generate bindings
run: |
pyxbgen --binding-root=./ebu_tt_live/bindings -m __init__ --schema-root=./ebu_tt_live/xsd/ -r -u ebutt_all.xsd
shell: bash
- name: Build the documentation
run: |
python setup.py build_sphinx
- name: Publish to GitHub Pages
env:
REF_NAME: ${{ github.ref }}
if: ${{ 'refs/head/master' == env.REF_NAME }}
uses: JamesIves/github-pages-deploy-action@4.1.7
with:
branch: gh-pages
folder: docs/build
clean: true
clean-exclude: |
.nojekyll
- name: Skip publishing to GitHub Pages
env:
REF_NAME: ${{ github.ref }}
if: ${{ 'refs/head/master' != env.REF_NAME }}
run: |
echo "This is NOT a push to master branch, not pushing to github-pages"
- name: Build notification
if: always()
uses: edge/simple-slack-notify@v1.1.2
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
BRANCH: ${{ github.ref_name }}
ACTOR: ${{ github.actor }}
COMMIT_REF: ${{ github.sha }}
with:
channel: '#ci'
status: ${{ job.status }}
success_text: 'Build <${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}|#${env.GITHUB_RUN_NUMBER}> (${env.COMMIT_REF}) of ${env.BRANCH} by ${env.ACTOR} completed successfully'
failure_text: 'Build <${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}|#${env.GITHUB_RUN_NUMBER}> (${env.COMMIT_REF}) of ${env.BRANCH} by ${env.ACTOR} failed'
cancelled_text: 'Build <${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}|#${env.GITHUB_RUN_NUMBER}> (${env.COMMIT_REF}) of ${env.BRANCH} by ${env.ACTOR} was cancelled'
fields: |
[{ "title": "${env.GITHUB_WORKFLOW} log URL"}]
62 changes: 62 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Check the tests pass

on:
push:
branches:
- master
pull_request:

jobs:
build:
name: Install and build and test
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v2
- name: Setup Python 2.7
uses: actions/setup-python@v2
with:
python-version: '2.7'
cache: 'pip'
- name: Install older pip
run: |
python -m pip install pip==20.3.4
shell: bash
- name: Install dependencies
run: |
pip install -r requirements.txt
shell: bash
- name: Generate bindings
run: |
pyxbgen --binding-root=./ebu_tt_live/bindings -m __init__ --schema-root=./ebu_tt_live/xsd/ -r -u ebutt_all.xsd
shell: bash
- name: Test
run: |
python setup.py test
shell: bash
- name: Install coveralls
run: |
pip install "coveralls<2"
shell: bash
- name: Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
coveralls
- name: Build notification
if: always()
uses: edge/simple-slack-notify@v1.1.2
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
BRANCH: ${{ github.ref_name }}
ACTOR: ${{ github.actor }}
COMMIT_REF: ${{ github.sha }}
with:
channel: '#ci'
status: ${{ job.status }}
success_text: 'Build <${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}|#${env.GITHUB_RUN_NUMBER}> (${env.COMMIT_REF}) of ${env.BRANCH} by ${env.ACTOR} completed successfully'
failure_text: 'Build <${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}|#${env.GITHUB_RUN_NUMBER}> (${env.COMMIT_REF}) of ${env.BRANCH} by ${env.ACTOR} failed'
cancelled_text: 'Build <${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}|#${env.GITHUB_RUN_NUMBER}> (${env.COMMIT_REF}) of ${env.BRANCH} by ${env.ACTOR} was cancelled'
fields: |
[{ "title": "${env.GITHUB_WORKFLOW}"}]
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ ebu_tt_live/ui/user_input_producer/template/live_message_template.js
docs/build/*
!docs/build/index.html
!docs/build/img
!docs/build/.nojekyll

# Test Sequences export folder
export/
Expand Down
44 changes: 0 additions & 44 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://api.travis-ci.org/ebu/ebu-tt-live-toolkit.svg?branch=master)](https://travis-ci.org/ebu/ebu-tt-live-toolkit)
![Build Status](https://github.com/ebu/ebu-tt-live-toolkit/actions/workflows/test.yml/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/ebu/ebu-tt-live-toolkit/badge.svg?branch=ebu_master)](https://coveralls.io/github/ebu/ebu-tt-live-toolkit?branch=ebu_master)

# ebu-tt-live-toolkit
Expand Down
Empty file added docs/build/.nojekyll
Empty file.
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@
# built documents.
#
# The short X.Y version.
version = u'2.1.2'
version = u'2.1.3'
# The full version, including alpha/beta/rc tags.
release = u'2.1.2'
release = u'2.1.3'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
113 changes: 96 additions & 17 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,97 @@
--index-url https://pypi.python.org/simple/

ipython==4.2.0
sphinx
sphinx-autobuild
sphinxcontrib-plantuml
recommonmark
sphinx-rtd-theme
pytest-bdd
pytest-cov
pytest-mock
pytest-twisted
coverage
pytest-runner
pytest
jinja2
mock
alabaster==0.7.12
argh==0.26.2
atomicwrites==1.4.0
attrs==20.2.0
autobahn==17.10.1
Automat==20.2.0
Babel==2.8.0
backports-abc==0.5
backports.functools-lru-cache==1.6.1
backports.shutil-get-terminal-size==1.0.0
certifi==2020.6.20
cffi==1.14.2
chardet==3.0.4
commonmark==0.9.1
configman==1.3.0
configobj==5.0.6
configparser==4.0.2
constantly==15.1.0
contextlib2==0.6.0.post1
coverage==5.3
cryptography==3.1
decorator==4.4.2
docutils==0.16
-e .
enum34==1.1.10
funcsigs==1.0.2
future==0.18.2
futures==3.3.0
glob2==0.7
greenlet==0.4.16
hyperlink==17.1.1
idna==2.10
imagesize==1.2.0
importlib-metadata==1.7.0
incremental==17.5.0
ipaddress==1.0.23
ipdb==0.10.2
ipython==4.2.0
ipython-genutils==0.2.0
Jinja2==2.11.2
livereload==2.6.3
Mako==1.1.3
MarkupSafe==1.1.1
mock==3.0.5
more-itertools==5.0.0
nltk==3.4.5
packaging==20.4
parse==1.18.0
parse-type==0.5.2
pathlib2==2.3.5
pathtools==0.1.2
pexpect==4.8.0
pickleshare==0.7.5
pluggy==0.13.1
port-for==0.3.1
ptyprocess==0.6.0
py==1.9.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycparser==2.20
Pygments==2.5.2
PyHamcrest==1.10.1
pyparsing==2.4.7
pytest==4.6.11
pytest-bdd==3.2.1
pytest-cov==2.10.1
pytest-mock==2.0.0
pytest-runner==5.2
pytest-twisted==1.13.2
pytz==2020.1
PyXB==1.2.6
PyYAML==5.3.1
recommonmark==0.6.0
requests==2.24.0
scandir==1.10.0
service-identity==18.1.0
simplegeneric==0.8.1
singledispatch==3.4.0.3
six==1.15.0
snowballstemmer==2.0.0
sortedcontainers==2.2.2
Sphinx==1.8.5
sphinx-autobuild==0.7.1
sphinx-rtd-theme==0.5.0
sphinxcontrib-plantuml==0.18.1
sphinxcontrib-websupport==1.1.2
tornado==5.1.1
total-ordering==0.1.0
traitlets==4.3.3
Twisted==20.3.0
txaio==18.8.1
typing==3.7.4.3
urllib3==1.25.10
watchdog==0.10.3
wcwidth==0.2.5
zipp==1.2.0
zope.interface==5.1.0
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from setuptools import setup
extra = dict(
include_package_data=True,
setup_requires=['pytest-runner']
# setup_requires=['pytest-runner']
)
except ImportError:
from distutils.core import setup
Expand All @@ -23,7 +23,7 @@

setup(
name="ebu-tt-live",
version="2.1.2",
version="2.1.3",
description="EBU-TT Part 3 library implementing Specification EBU-3370",
install_requires=[
"PyXB",
Expand All @@ -33,7 +33,7 @@
"service_identity",
"twisted",
"autobahn<18",
"nltk",
"nltk<3.5",
"sortedcontainers",
"configman",
"six",
Expand Down

0 comments on commit dc4e7be

Please sign in to comment.