update submodule to ehrdata 0.4.0 #506
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CPU tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| schedule: | |
| - cron: "0 5 1,15 * *" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: bash -euo pipefail {0} | |
| jobs: | |
| get-environments: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| envs: ${{ steps.get-envs.outputs.envs }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| filter: blob:none | |
| fetch-depth: 0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Get test environments | |
| id: get-envs | |
| run: | | |
| ENVS_JSON=$(uvx hatch env show --json | jq -c 'to_entries | |
| | map( | |
| select(.key | startswith("hatch-test.")) | |
| | { | |
| name: .key, | |
| label: (if (.key | contains("pre")) then .key + " (PRE-RELEASE DEPENDENCIES)" else .key end), | |
| python: .value.python | |
| } | |
| )') | |
| echo "envs=${ENVS_JSON}" | tee $GITHUB_OUTPUT | |
| test: | |
| needs: get-environments | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest] | |
| env: ${{ fromJSON(needs.get-environments.outputs.envs) }} | |
| name: ${{ matrix.env.label }} | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| filter: blob:none | |
| fetch-depth: 0 | |
| submodules: true | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: ${{ matrix.env.python }} | |
| cache-dependency-glob: pyproject.toml | |
| - name: Restore datasets cache | |
| id: data-cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: ehrapy_data | |
| key: ehrapy-data-tests-v1 | |
| - name: create hatch environment | |
| run: uvx hatch env create ${{ matrix.env.name }} | |
| - name: Show installed packages | |
| run: uvx hatch run ${{ matrix.env.name }}:uv pip freeze | |
| - name: run tests using hatch | |
| env: | |
| MPLBACKEND: agg | |
| PLATFORM: ${{ matrix.os }} | |
| DISPLAY: :42 | |
| EHRDATA_DOWNLOAD_MAX_RETRIES: "5" | |
| EHRDATA_DOWNLOAD_RETRY_DELAY: "10" | |
| run: uvx hatch run ${{ matrix.env.name }}:run-cov -v --color=yes -n auto | |
| - name: Save datasets cache | |
| if: steps.data-cache.outputs.cache-hit != 'true' && success() | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: ehrapy_data | |
| key: ehrapy-data-tests-v1 | |
| - name: generate coverage report | |
| run: | | |
| # See https://coverage.readthedocs.io/en/latest/config.html#run-patch | |
| test -f .coverage || uvx hatch run ${{ matrix.env.name }}:cov-combine | |
| uvx hatch run ${{ matrix.env.name }}:cov-report # report visibly | |
| uvx hatch run ${{ matrix.env.name }}:coverage xml # create report for upload | |
| - name: Upload coverage | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| check: | |
| name: Tests pass in all hatch environments | |
| if: always() | |
| needs: | |
| - get-environments | |
| - test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: re-actors/alls-green@release/v1 | |
| with: | |
| jobs: ${{ toJSON(needs) }} |