Compliance, CRAN packaging, UDP graphs, and cloud deploy #58
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: openeocraft Unit Tests | |
| on: | |
| pull_request: | |
| branches: | |
| - dev | |
| jobs: | |
| test: | |
| name: Run R Unit Tests | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Setup R | |
| uses: r-lib/actions/setup-r@v2 | |
| with: | |
| r-version: 'release' | |
| - name: Setup R dependencies | |
| uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| dependencies: '"hard"' | |
| extra-packages: | | |
| any::remotes | |
| any::testthat | |
| - name: Install openstac (dev with main fallback) | |
| run: | | |
| tryCatch( | |
| remotes::install_url("https://github.com/Open-Earth-Monitor/openstac/archive/refs/heads/dev.tar.gz"), | |
| error = function(e) { | |
| message("openstac dev tarball unavailable, falling back to main: ", conditionMessage(e)) | |
| remotes::install_url("https://github.com/Open-Earth-Monitor/openstac/archive/refs/heads/main.tar.gz") | |
| } | |
| ) | |
| shell: Rscript {0} | |
| - name: Install package | |
| run: | | |
| remotes::install_local(".", dependencies = FALSE, upgrade = "never") | |
| if (!requireNamespace("testthat", quietly = TRUE)) { | |
| stop("testthat was not installed successfully.") | |
| } | |
| shell: Rscript {0} | |
| - name: Run tests | |
| run: | | |
| testthat::test_local(reporter = "summary") | |
| shell: Rscript {0} |