From d2d3097a46249020dac23a1683e5f5a7f4d9ea3a Mon Sep 17 00:00:00 2001 From: Olivier Boulant Date: Wed, 20 Oct 2021 15:23:22 +0200 Subject: [PATCH] ci: add tests in CI for windows python v3.9 (#219) * ci: add tests in CI for windows python v3.9 * ci: merge tests and coverage into a single .yml * ci: update upload to codecov and actually generate report --- .github/workflows/run-test-coverage.yml | 41 ------------------------- .github/workflows/run-test.yml | 32 ++++++++++++++++--- 2 files changed, 27 insertions(+), 46 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 5350cd89..f8f6a98f 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,14 +16,11 @@ on: - 'mkdocs.yml' jobs: - build: + tests: strategy: 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 @@ -38,3 +35,28 @@ 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 --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