Skip to content

Commit

Permalink
Merge pull request #23 from EPFL-ENAC/fix-ci-coverage
Browse files Browse the repository at this point in the history
Fix CI coverage
  • Loading branch information
sphamba authored Nov 27, 2023
2 parents 8233266 + 1273d5d commit dd1d1fc
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 14 deletions.
19 changes: 6 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on: [push, pull_request, workflow_dispatch]

jobs:
tests:
name: ${{ matrix.os }}, Python ${{ matrix.python-version }}${{ matrix.experimental && ', latest dependencies' || '' }}
name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }}${{ matrix.experimental && ', latest dependencies' || '' }}
runs-on: ${{ matrix.os }}
defaults:
run:
Expand All @@ -25,10 +25,6 @@ jobs:
experimental: false
coverage: true

- os: "windows-latest"
python-version: "3.11"
experimental: false

steps:
- uses: actions/checkout@v3
with:
Expand All @@ -49,26 +45,23 @@ jobs:
- name: Test with pytest
run: |
pytest
pytest # See pyproject.toml for cov options
env:
HDF5_USE_FILE_LOCKING: FALSE

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
if: matrix.coverage
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Generate coverage report in lcov format
if: matrix.coverage
run: |
coverage lcov -o coverage/lcov.info
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml

- name: Coveralls Parallel
uses: coverallsapp/github-action@v2
if: matrix.coverage
with:
parallel: true
files: lcov.info

end-coveralls:
needs: [tests]
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/tests_windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Tests Windows
on: [push, pull_request, workflow_dispatch]

jobs:
tests:
name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }}${{ matrix.experimental && ' with latest dependencies' || '' }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -el {0}

strategy:
fail-fast: false
matrix:
os: ["windows-latest"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
experimental: [false]

steps:
- uses: actions/checkout@v3

- name: Set up micromamba and install package dependencies
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ${{ matrix.experimental && 'ci/environment_latest.yml' || 'ci/environment.yml' }}
create-args: >-
python=${{ matrix.python-version }}
init-shell: >-
bash
- name: Install the package
run: |
pip install -e .[image,dev]
- name: Test with pytest
run: |
pytest
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ download_gpm_files="gpm_api.scripts.download_gpm_files:download_gpm_files"


[tool.pytest.ini_options]
addopts = "--ignore=gpm_api/tests/0_tmp/ --cov --cov-report term-missing --check-max-report=10"
addopts = "--ignore=gpm_api/tests/0_tmp/ --cov --cov-report term-missing --cov-report xml --cov-report lcov:lcov.info --check-max-report=10"

[tool.black]
line-length = 100
Expand Down

0 comments on commit dd1d1fc

Please sign in to comment.