From e9f99914e288c0fc6fde19a63c232a142e1d7c8e Mon Sep 17 00:00:00 2001 From: Lukas Puehringer Date: Tue, 15 Dec 2020 19:37:18 +0100 Subject: [PATCH] Publish coverage on coveralls in gh workflow (WIP) TODO: Needs more troubleshooting: - Official coveralls action does not seem to work well for Python https://github.com/coverallsapp/github-action/issues/4 https://github.com/coverallsapp/github-action/issues/30 - Official coveralls cli triggers 500 on coveralls.io - Inofficial coveralls action seems to correctly talk to the API but has issues finding the coverage data in the tests folder, or the corresponding code. https://github.com/AndreMiras/coveralls-python-action --- .github/workflows/ci.yml | 42 +++++++++++++++++++++++++++++----------- tests/.coveragerc | 1 + 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c751d1fae2..14de150169 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,18 +12,20 @@ jobs: # Run regular TUF tests on each OS/Python combination, plus special tests # (sslib master) and linters on Linux/Python3.x only. matrix: - python-version: [2.7, 3.6, 3.7, 3.8, 3.9] - os: [ubuntu-latest, macos-latest, windows-latest] + # python-version: [2.7, 3.6, 3.7, 3.8, 3.9] + python-version: [3.9] + # os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest] toxenv: [py] - include: - - python-version: 3.x - os: ubuntu-latest - toxenv: with-sslib-master - experimental: true - # TODO: Change to 3.x once pylint fully supports Python 3.9 - - python-version: 3.8 - os: ubuntu-latest - toxenv: lint + # include: + # - python-version: 3.x + # os: ubuntu-latest + # toxenv: with-sslib-master + # experimental: true + # # TODO: Change to 3.x once pylint fully supports Python 3.9 + # - python-version: 3.8 + # os: ubuntu-latest + # toxenv: lint runs-on: ${{ matrix.os }} @@ -57,3 +59,21 @@ jobs: - name: Run tox run: tox -e ${{ matrix.toxenv }} + + - name: Publish coverage + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}" + COVERALLS_PARALLEL: 'true' + COVERALLS_FLAG_NAME: ${{ runner.os }} / Python ${{ matrix.python-version }} + run: | + coveralls --verbose + + finish: + needs: build + runs-on: ubuntu-latest + steps: + - name: Publish coverage (fin) + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}" + run: | + coveralls --finish --verbose diff --git a/tests/.coveragerc b/tests/.coveragerc index dd9c57e8ab..f6379603ed 100644 --- a/tests/.coveragerc +++ b/tests/.coveragerc @@ -1,5 +1,6 @@ [run] branch = True +relative_files = True omit = # Command-line scripts.