From bd67ae47cb65cd1962a23bdad3f48c937613073b Mon Sep 17 00:00:00 2001 From: Olivier Boulant Date: Wed, 20 Oct 2021 11:38:28 +0200 Subject: [PATCH 1/3] add tests in CI for windows pyhton v3.9 --- .github/workflows/run-test.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/run-test.yml b/.github/workflows/run-test.yml index 5350cd89..89428278 100644 --- a/.github/workflows/run-test.yml +++ b/.github/workflows/run-test.yml @@ -21,9 +21,6 @@ jobs: matrix: python-version: [3.6, 3.7, 3.8, 3.9] os: [ubuntu-latest, windows-latest, macos-latest] - exclude: - - os: windows-latest - python-version: 3.9 runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 From 5f0d6fe6d77a5ece6d1d66b718d6b0515e1e3f75 Mon Sep 17 00:00:00 2001 From: Olivier Boulant Date: Wed, 20 Oct 2021 11:51:29 +0200 Subject: [PATCH 2/3] Merge tests and coverage into a single .yml --- .github/workflows/run-test-coverage.yml | 41 ------------------------- .github/workflows/run-test.yml | 26 ++++++++++++++-- 2 files changed, 24 insertions(+), 43 deletions(-) delete mode 100644 .github/workflows/run-test-coverage.yml diff --git a/.github/workflows/run-test-coverage.yml b/.github/workflows/run-test-coverage.yml deleted file mode 100644 index 5e63e643..00000000 --- a/.github/workflows/run-test-coverage.yml +++ /dev/null @@ -1,41 +0,0 @@ -# This workflow will install Python dependencies, run tests, generate coverage -# report and upload it to codecov. -# For more information, see: -# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: Run tests with coverage - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - paths-ignore: - - '.pre-commit-config.yaml' - - 'docs/**' - - 'images/**' - - '**.md' - - 'mkdocs.yml' - -jobs: - coverage: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.8 - uses: actions/setup-python@v2 - with: - python-version: '3.8' - - name: Install ruptures - run: | - python -m pip install --upgrade pip - python -m pip install .[test] - - name: Test with pytest - run: | - python -m pytest - - name: Upload to Codecov - run: | - bash <(curl -s https://codecov.io/bash) - - uses: actions/upload-artifact@v2 - with: - path: coverage.xml diff --git a/.github/workflows/run-test.yml b/.github/workflows/run-test.yml index 89428278..9e30cc97 100644 --- a/.github/workflows/run-test.yml +++ b/.github/workflows/run-test.yml @@ -1,7 +1,7 @@ # 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: Run tests +name: Tests and coverage on: push: @@ -16,7 +16,7 @@ on: - 'mkdocs.yml' jobs: - build: + tests: strategy: matrix: python-version: [3.6, 3.7, 3.8, 3.9] @@ -35,3 +35,25 @@ jobs: - name: Test with pytest run: | python -m pytest --no-cov + + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: '3.8' + - name: Install ruptures + run: | + python -m pip install --upgrade pip + python -m pip install .[test] + - name: Test with pytest + run: | + python -m pytest + - name: Upload to Codecov + run: | + bash <(curl -s https://codecov.io/bash) + - uses: actions/upload-artifact@v2 + with: + path: coverage.xml From 741eccec3e843a78b6cbdd615e2aeb3ec728a507 Mon Sep 17 00:00:00 2001 From: Olivier Boulant Date: Wed, 20 Oct 2021 15:07:03 +0200 Subject: [PATCH 3/3] update upload to codecov and actually generate report --- .github/workflows/run-test.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run-test.yml b/.github/workflows/run-test.yml index 9e30cc97..f8f6a98f 100644 --- a/.github/workflows/run-test.yml +++ b/.github/workflows/run-test.yml @@ -50,10 +50,13 @@ jobs: python -m pip install .[test] - name: Test with pytest run: | - python -m pytest - - name: Upload to Codecov - run: | - bash <(curl -s https://codecov.io/bash) + python -m pytest --cov-report=xml --cov-report=term:skip-covered --cov=src/ruptures + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v2 + with: + files: ./coverage.xml + flags: unittests + fail_ci_if_error: true - uses: actions/upload-artifact@v2 with: path: coverage.xml