atomic data preparation #1483
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: test | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
permissions: | |
id-token: write | |
contents: read | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
pyrenew-hew-test: | |
name: Run pyrenew_hew tests and collect coverage | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Pyrenew-HEW via UV | |
uses: ./.github/actions/setup-pyrenew-hew | |
- name: run tests | |
env: | |
NHSN_API_KEY_ID: ${{ secrets.NHSN_API_KEY_ID }} | |
NHSN_API_KEY_SECRET: ${{ secrets.NHSN_API_KEY_SECRET }} | |
XLA_FLAGS: --xla_force_host_platform_device_count=2 | |
run: | | |
uv run pytest tests \ | |
--mpl --mpl-default-tolerance=10 \ | |
--cov=pyrenew_hew --cov-report=term --cov-report=xml:pyrenew_hew-coverage.xml . | |
- name: Upload results to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
env_vars: OS,PYTHON | |
fail_ci_if_error: true | |
flags: pyrenew_hew | |
files: pyrenew_hew-coverage.xml | |
token: ${{ secrets.CODECOV_TOKEN }} | |
verbose: true | |
pipelines-test: | |
name: Run pipelines tests and collect coverage | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Pyrenew-HEW via UV | |
uses: ./.github/actions/setup-pyrenew-hew | |
- name: run tests | |
env: | |
XLA_FLAGS: --xla_force_host_platform_device_count=2 | |
run: | | |
uv run pytest pipelines \ | |
--mpl --mpl-default-tolerance=10 \ | |
--cov=pipelines --cov-report=term --cov-report=xml:pipelines-coverage.xml . | |
- name: Upload results to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
env_vars: OS,PYTHON | |
fail_ci_if_error: true | |
flags: pipelines | |
files: pipelines-coverage.xml | |
token: ${{ secrets.CODECOV_TOKEN }} | |
verbose: true | |
hewr-test: | |
name: Run hewr tests and collect coverage | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up R with hewr | |
uses: ./.github/actions/setup-hewr | |
- name: Test coverage | |
run: | | |
cov <- covr::package_coverage( | |
path = "hewr", | |
quiet = FALSE, | |
clean = FALSE, | |
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") | |
) | |
covr::to_cobertura(cov) | |
shell: Rscript {0} | |
- uses: codecov/codecov-action@v5 | |
with: | |
fail_ci_if_error: true | |
files: ./cobertura.xml | |
plugins: noop | |
flags: hewr | |
disable_search: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Show testthat output | |
if: always() | |
run: | | |
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true | |
shell: bash | |
- name: Upload test results | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-test-failures | |
path: ${{ runner.temp }}/package |