diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6b26f5ae..62d2e61c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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: @@ -25,10 +25,6 @@ jobs: experimental: false coverage: true - - os: "windows-latest" - python-version: "3.11" - experimental: false - steps: - uses: actions/checkout@v3 with: @@ -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] diff --git a/.github/workflows/tests_windows.yml b/.github/workflows/tests_windows.yml new file mode 100644 index 00000000..591d04e8 --- /dev/null +++ b/.github/workflows/tests_windows.yml @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 1ff35359..2a402ce5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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