v0.3.9 #39
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
| # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples | |
| # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| name: test-coverage.yaml | |
| permissions: read-all | |
| jobs: | |
| test-coverage: | |
| runs-on: ubuntu-latest | |
| env: | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: r-lib/actions/setup-r@v2 | |
| with: | |
| use-public-rspm: true | |
| - uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| extra-packages: any::covr, any::xml2, any::reticulate | |
| needs: coverage | |
| - name: Install Miniconda via reticulate | |
| run: | | |
| Rscript -e 'reticulate::install_miniconda(update = FALSE, force = FALSE)' | |
| - name: Free disk space on Ubuntu runner | |
| if: runner.os == 'Linux' | |
| run: | | |
| curl -fsSL https://raw.githubusercontent.com/kou/arrow/e49d8ae15583ceff03237571569099a6ad62be32/ci/scripts/util_free_space.sh | bash | |
| # source: https://www.dzombak.com/blog/2024/09/freeing-disk-space-on-github-actions-runners/ | |
| - name: Create empty conda env 'fiora' | |
| run: | | |
| Rscript -e 'reticulate::conda_create("fiora")' | |
| - name: Preinstall CPU-only PyTorch and fiora (Linux) | |
| if: runner.os == 'Linux' | |
| shell: bash | |
| run: | | |
| # reticulate-Miniforge path (may be different in GitHub Actions) | |
| CONDA_BIN="${HOME}/.local/share/r-miniconda/bin/conda" | |
| "$CONDA_BIN" run -n fiora python -m pip install --upgrade pip | |
| # CPU-Only Wheels (no CUDA-Runtime): | |
| "$CONDA_BIN" run -n fiora python -m pip install --index-url https://download.pytorch.org/whl/cpu torch torchvision torchaudio | |
| # fiora from Git-Repo WITHOUT requirements.txt | |
| "$CONDA_BIN" run -n fiora python -m pip install git+https://github.com/BAMeScience/fiora.git | |
| # pin reticulate to this env | |
| Rscript -e 'reticulate::use_condaenv("fiora", required = TRUE)' | |
| # source: https://pytorch.org/get-started/locally/)[2](https://github.com/pytorch/pytorch/issues/146786 | |
| - name: Install fiora (macOS/Windows) | |
| if: runner.os != 'Linux' | |
| run: | | |
| Rscript -e 'reticulate::conda_install("fiora", packages = "git+https://github.com/BAMeScience/fiora.git", pip = TRUE)' | |
| Rscript -e 'reticulate::use_condaenv("fiora", required = TRUE)' | |
| - name: Test coverage | |
| run: | | |
| cov <- covr::package_coverage( | |
| quiet = FALSE, | |
| clean = FALSE, | |
| install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") | |
| ) | |
| print(cov) | |
| covr::to_cobertura(cov) | |
| shell: Rscript {0} | |
| - uses: codecov/codecov-action@v5 | |
| with: | |
| fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }} | |
| files: ./cobertura.xml | |
| plugins: noop | |
| 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 |