From 9641b345e59aee7bef7a9a76a0f7707d26c617e0 Mon Sep 17 00:00:00 2001 From: thomasyu888 Date: Tue, 2 Feb 2021 12:49:25 +0800 Subject: [PATCH 1/8] Add code coverage --- .github/workflows/pythonapp.yml | 41 +++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 6589b677..11227cc6 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -21,7 +21,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest pytest-cov + pip install flake8 pytest coveralls pip install . if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Lint with flake8 @@ -32,11 +32,34 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | - pytest tests/ --doctest-modules --cov=challengeutils --cov-report=html - - name: Upload pytest test results - uses: actions/upload-artifact@master - with: - name: pytest-results-${{ matrix.python-version }} - path: htmlcov - # Use always() to always run this step to publish test results when there are test failures - if: ${{ always() }} \ No newline at end of file + pytest tests + # - name: Upload pytest test results + # uses: actions/upload-artifact@master + # with: + # name: pytest-results-${{ matrix.python-version }} + # path: htmlcov + # # Use always() to always run this step to publish test results when there are test failures + # if: ${{ always() }} + - name: Prepare environment for coveralls + run: | + echo "PYTHON_ENV=$(echo py${{ matrix.python-version }} | tr -d .)" >> $GITHUB_ENV + - name: Coveralls Parallel + env: + COVERALLS_FLAG_NAME: ${{ env.PYTHON_ENV }} + COVERALLS_PARALLEL: true + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + cd challengeutils + coveralls --service=github + + finish-coveralls: + needs: test + runs-on: ubuntu-latest + container: python:3-slim + steps: + - name: Finish Coveralls Parallel + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + pip3 install --upgrade coveralls + coveralls --finish From cebc737941c83337e08c01c74adb19ff652b2a16 Mon Sep 17 00:00:00 2001 From: thomasyu888 Date: Tue, 2 Feb 2021 12:50:46 +0800 Subject: [PATCH 2/8] Fix --- .github/workflows/pythonapp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 11227cc6..e42cce21 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -53,7 +53,7 @@ jobs: coveralls --service=github finish-coveralls: - needs: test + needs: build runs-on: ubuntu-latest container: python:3-slim steps: From 5cce0860905c10054b8cc7e802e715bf641d8c30 Mon Sep 17 00:00:00 2001 From: thomasyu888 Date: Tue, 2 Feb 2021 12:55:54 +0800 Subject: [PATCH 3/8] Fix --- .github/workflows/pythonapp.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index e42cce21..31f6de2b 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -21,7 +21,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest coveralls + pip install flake8 pytest pip install . if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Lint with flake8 @@ -49,7 +49,6 @@ jobs: COVERALLS_PARALLEL: true GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - cd challengeutils coveralls --service=github finish-coveralls: From 440e2167c088771d6d50a283e5f807fa9d50ce9e Mon Sep 17 00:00:00 2001 From: thomasyu888 Date: Tue, 2 Feb 2021 12:59:09 +0800 Subject: [PATCH 4/8] Install --- .github/workflows/pythonapp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 31f6de2b..b9199b65 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -21,7 +21,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest + pip install flake8 pytest coveralls pip install . if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Lint with flake8 From 0c1eb541cc05764c54d33a8b0251cf319ce64459 Mon Sep 17 00:00:00 2001 From: thomasyu888 Date: Tue, 2 Feb 2021 13:10:36 +0800 Subject: [PATCH 5/8] ADd --- .github/workflows/pythonapp.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index b9199b65..4aaa19bc 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -49,6 +49,7 @@ jobs: COVERALLS_PARALLEL: true GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | + coverage run --source=challengeutils -m pytest tests/ coveralls --service=github finish-coveralls: From 26c7c77ac4b1c7ed536b23293efdae2e7f063019 Mon Sep 17 00:00:00 2001 From: thomasyu888 Date: Tue, 2 Feb 2021 15:16:36 +0800 Subject: [PATCH 6/8] Add --- .github/workflows/pythonapp.yml | 6 +++++- README.md | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 4aaa19bc..16a0f95c 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -3,7 +3,11 @@ name: build -on: [pull_request] +on: + pull_request: + push: + branches: + - master jobs: build: diff --git a/README.md b/README.md index 0327ef0e..a0e93eca 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Sage Bionetworks Challenge Utilities -[![Get challengeutils from PyPI](https://img.shields.io/pypi/v/challengeutils.svg?style=for-the-badge&logo=appveyor)](https://pypi.python.org/pypi/challengeutils) [![Docker Automated](https://img.shields.io/docker/automated/sagebionetworks/challengeutils.svg?style=for-the-badge&logo=appveyor)](https://hub.docker.com/r/sagebionetworks/challengeutils/) [![Docker Pull](https://img.shields.io/docker/pulls/sagebionetworks/challengeutils.svg?style=for-the-badge&logo=appveyor)](https://hub.docker.com/r/sagebionetworks/challengeutils/) +[![Get challengeutils from PyPI](https://img.shields.io/pypi/v/challengeutils.svg?style=for-the-badge&logo=pypi)](https://pypi.python.org/pypi/challengeutils) [![Docker Automated](https://img.shields.io/docker/automated/sagebionetworks/challengeutils.svg?style=for-the-badge&logo=docker)](https://hub.docker.com/r/sagebionetworks/challengeutils/) [![Docker Pull](https://img.shields.io/docker/pulls/sagebionetworks/challengeutils.svg?style=for-the-badge&logo=docker)](https://hub.docker.com/r/sagebionetworks/challengeutils/) [![Coverage Status](https://img.shields.io/coveralls/github/Sage-Bionetworks/challengeutils.svg?&style=for-the-badge&label=coverage&logo=Coveralls)](https://coveralls.io/github/Sage-Bionetworks/challengeutils) + `challengeutils` is a set of tools and commands that provides an interface for managing crowd-sourced challenges administered on [Synapse](https://www.synapse.org), including but not limited to, [DREAM Challenges](http://dreamchallenges.org/). Its main purpose is to ease the process of creating, monitoring, and ending a challenge, as well as provide useful functions for post-competition analysis. _This package is being actively developed and maintained by DREAM and Informatics & Biocomputing (IBC), Computational Oncology Group at Sage Bionetworks._ From fc9b3dea5bb3b2eab027839cea46f508cb679eb9 Mon Sep 17 00:00:00 2001 From: thomasyu888 Date: Tue, 2 Feb 2021 15:28:59 +0800 Subject: [PATCH 7/8] Dont test cli --- .github/workflows/pythonapp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 16a0f95c..ec0c7baf 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -53,7 +53,7 @@ jobs: COVERALLS_PARALLEL: true GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - coverage run --source=challengeutils -m pytest tests/ + coverage run --source=challengeutils --omit=__main__.py -m pytest tests/ coveralls --service=github finish-coveralls: From 87d1f8d1540eaaa0ea7ae0a548bce12e684cb818 Mon Sep 17 00:00:00 2001 From: thomasyu888 Date: Tue, 2 Feb 2021 15:32:56 +0800 Subject: [PATCH 8/8] Omit --- .github/workflows/pythonapp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index ec0c7baf..178e728f 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -53,7 +53,7 @@ jobs: COVERALLS_PARALLEL: true GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - coverage run --source=challengeutils --omit=__main__.py -m pytest tests/ + coverage run --source=challengeutils --omit=challengeutils/__main__.py -m pytest tests/ coveralls --service=github finish-coveralls: