From 39cb2f35dfdb9770cdd1bf1cf206dcabaeb2fe02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Arnauts?= Date: Mon, 23 Mar 2020 19:58:55 +0100 Subject: [PATCH] Replace Travis with GitHub Actions (#10) --- .github/workflows/ci.yml | 62 +++++++++++++++++++++++++++++++++++++ .travis.yml | 27 ---------------- Makefile | 3 +- .codecov.yml => codecov.yml | 0 requirements.txt | 4 +-- 5 files changed, 66 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml rename .codecov.yml => codecov.yml (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..98c2abf --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a1f9e9c..0000000 --- a/.travis.yml +++ /dev/null @@ -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 diff --git a/Makefile b/Makefile index 3f2bb3d..682c45d 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/.codecov.yml b/codecov.yml similarity index 100% rename from .codecov.yml rename to codecov.yml diff --git a/requirements.txt b/requirements.txt index a1466dd..0a5a135 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,5 +5,5 @@ pylint python-dateutil requests git+git://github.com/dagwieers/kodi-plugin-routing.git@setup#egg=routing -tox-travis -six \ No newline at end of file +tox +six