Replace Travis with GitHub Actions (#10)

This commit is contained in:
Michaël Arnauts 2020-03-23 19:58:55 +01:00 committed by GitHub
parent b70544c0ad
commit 39cb2f35df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 66 additions and 30 deletions

62
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,62 @@
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
check-addon:
name: Run kodi-addon-checker
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get install libxml2-utils
python -m pip install --upgrade pip
pip install kodi-addon-checker
- name: Run kodi-addon-checker
run: |
make check-addon
tests:
name: Run unit tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get install gettext
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run checks
run: |
make check-pylint
make check-tox
make check-translations
- name: Run tests
env:
PYTHONIOENCODING: utf-8
ADDON_USERNAME: ${{ secrets.ADDON_USERNAME }}
ADDON_PASSWORD: ${{ secrets.ADDON_PASSWORD }}
run: |
make test
- name: Upload code coverage
uses: codecov/codecov-action@v1

View File

@ -1,27 +0,0 @@
language: python
python:
- '2.7'
- '3.5'
- '3.6'
- '3.7'
- '3.8'
os: linux
env:
PYTHONPATH: :test
PYTHONIOENCODING: utf-8
install:
- pip install -r requirements.txt
script:
- make check-pylint
- make check-tox
- make check-translations
- if [ "$TRAVIS_PYTHON_VERSION" == "3.8" ]; then pip install kodi-addon-checker && make check-addon; fi
- make test
after_success:
- codecov

View File

@ -39,8 +39,9 @@ test: test-unit
test-unit:
@echo ">>> Running unit tests"
ifdef TRAVIS_JOB_ID
ifdef GITHUB_ACTIONS
@coverage run -m unittest discover
@coverage xml
else
@python -m unittest discover -v -b -f
endif

View File

@ -5,5 +5,5 @@ pylint
python-dateutil
requests
git+git://github.com/dagwieers/kodi-plugin-routing.git@setup#egg=routing
tox-travis
six
tox
six