Replace Travis with GitHub Actions (#10)
This commit is contained in:
parent
b70544c0ad
commit
39cb2f35df
62
.github/workflows/ci.yml
vendored
Normal file
62
.github/workflows/ci.yml
vendored
Normal 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
|
27
.travis.yml
27
.travis.yml
@ -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
|
|
3
Makefile
3
Makefile
@ -39,8 +39,9 @@ test: test-unit
|
|||||||
|
|
||||||
test-unit:
|
test-unit:
|
||||||
@echo ">>> Running unit tests"
|
@echo ">>> Running unit tests"
|
||||||
ifdef TRAVIS_JOB_ID
|
ifdef GITHUB_ACTIONS
|
||||||
@coverage run -m unittest discover
|
@coverage run -m unittest discover
|
||||||
|
@coverage xml
|
||||||
else
|
else
|
||||||
@python -m unittest discover -v -b -f
|
@python -m unittest discover -v -b -f
|
||||||
endif
|
endif
|
||||||
|
@ -5,5 +5,5 @@ pylint
|
|||||||
python-dateutil
|
python-dateutil
|
||||||
requests
|
requests
|
||||||
git+git://github.com/dagwieers/kodi-plugin-routing.git@setup#egg=routing
|
git+git://github.com/dagwieers/kodi-plugin-routing.git@setup#egg=routing
|
||||||
tox-travis
|
tox
|
||||||
six
|
six
|
||||||
|
Loading…
Reference in New Issue
Block a user