From eba721b02795fbc2587d1ee2cb3fc63cb212a9b5 Mon Sep 17 00:00:00 2001 From: Dean Jackson Date: Thu, 21 May 2020 00:04:34 +0200 Subject: [PATCH 1/2] Add GitHub Action for tests & coverage --- .github/run-tests.yml | 45 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 3 ++- bin/travis-install-deps.sh | 27 ----------------------- requirements-ci.txt | 3 +++ 4 files changed, 50 insertions(+), 28 deletions(-) create mode 100644 .github/run-tests.yml delete mode 100755 bin/travis-install-deps.sh create mode 100644 requirements-ci.txt diff --git a/.github/run-tests.yml b/.github/run-tests.yml new file mode 100644 index 00000000..cefc18e7 --- /dev/null +++ b/.github/run-tests.yml @@ -0,0 +1,45 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: "Unit Tests & Coverage" + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + run: + runs-on: macos-latest + strategy: + matrix: + python-version: [2.7] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements-test.txt + pip install -r requirements-ci.txt + + - name: Lint + run: ./run-tests.sh -l + + - name: Unit tests + run: ./run-tests.sh + + - name: Codacy + run: python-codacy-coverage -r coverage.xml + + - name: Coveralls + run: coveralls + + - name: Codecov + run: bash <(curl -s https://codecov.io/bash) diff --git a/.travis.yml b/.travis.yml index e0158ef8..9eae351b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,8 @@ install: - git clone https://github.com/MacPython/terryfy - source terryfy/travis_tools.sh - get_python_environment $SOURCE $VERSION venv - - bin/travis-install-deps.sh + - pip install -r requirements-test.txt + - pip install -r requirements-ci.txt script: - ./run-tests.sh diff --git a/bin/travis-install-deps.sh b/bin/travis-install-deps.sh deleted file mode 100755 index 1f27999f..00000000 --- a/bin/travis-install-deps.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -# Install Python dependencies for Travis-CI.org - -set -e - -log() { - echo "$@" > /dev/stderr -} - -export CC=clang - -log "----------------- Test dependencies ----------------" -pip install \ - pytest \ - coveralls \ - codacy-coverage \ - pytest_cov \ - pytest_httpbin \ - pytest_localserver - -if [[ "$VERSION" =~ ^2.7.* ]]; then - log "----------------------- PyObc ----------------------" - pip install pyobjc-core - pip install pyobjc-framework-Cocoa -fi - -log "---------------------- Done ------------------------" diff --git a/requirements-ci.txt b/requirements-ci.txt new file mode 100644 index 00000000..d96b22b4 --- /dev/null +++ b/requirements-ci.txt @@ -0,0 +1,3 @@ +codacy-coverage==1.3.11 +coveralls=1.11.1 +pyobjc-framework-Cocoa==5.2 From 5011d7489c9752c7620d089b2b2f34cdbefcbb3d Mon Sep 17 00:00:00 2001 From: Dean Jackson Date: Thu, 21 May 2020 00:08:47 +0200 Subject: [PATCH 2/2] Add GitHub Action for tests & coverage --- requirements-ci.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-ci.txt b/requirements-ci.txt index d96b22b4..de71b233 100644 --- a/requirements-ci.txt +++ b/requirements-ci.txt @@ -1,3 +1,3 @@ codacy-coverage==1.3.11 -coveralls=1.11.1 +coveralls==1.11.1 pyobjc-framework-Cocoa==5.2