Repository navigation
Enhance GDAL runtime installation and CI/CD workflows #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0c3fbb3
fix: resolve "latest" runtime by scanning releases for bundle assets
jimbrig d87de00
feat(cicd): scheduled upstream GDAL check and e2e verification workfl…
jimbrig 4b908ba
refactor: centralize repo slugs, asset patterns, and dll naming in R/…
jimbrig 8eb0f46
refactor: move shared constants to R/aaa.R using dot-prefixed convention
jimbrig c661683
fix: authenticate GitHub API requests and harden asset selection (#21…
jimbrig 576b89a
refactor(docs): move importFrom tags to the functions that use them
jimbrig File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,131 @@ | ||
| # ============================================================================= | ||
| # e2e.yml — End-to-end verification of the full user workflow on a clean | ||
| # Windows machine (#20). | ||
| # | ||
| # Proves the documented workflow exactly as a user machine would run it: | ||
| # 1. install the package (local checkout) | ||
| # 2. install_gdal_runtime() — published GDAL runtime bundle | ||
| # 3. install_gdalraster() — source build against the bundle | ||
| # 4. verify_gdalraster_runtime() — Algorithm API registry is populated | ||
| # 5. add_gdal_rprofile_hook() — startup hook, verified in a fresh | ||
| # R session via plain library(gdalraster) | ||
| # | ||
| # This workflow only consumes exported package functionality — build, link, | ||
| # and activation logic are never reimplemented in CI (see AGENTS.md | ||
| # responsibility split). gdalraster's own R dependencies are installed as | ||
| # CRAN binaries so the only from-source compile is gdalraster itself. | ||
| # | ||
| # Triggers: | ||
| # - workflow_dispatch : manually, optionally pinning a runtime release tag | ||
| # - schedule : weekly (Mondays 08:00 UTC, after the upstream check) | ||
| # - release published : gdal-v* bundle releases, so every new bundle is | ||
| # proven against gdalraster automatically | ||
| # ============================================================================= | ||
|
|
||
| name: E2E Runtime Verification | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| runtime_tag: | ||
| description: 'GDAL runtime release tag to install (or "latest")' | ||
| required: false | ||
| default: 'latest' | ||
| schedule: | ||
| - cron: '0 8 * * 1' | ||
| release: | ||
| types: [published] | ||
|
|
||
| permissions: read-all | ||
|
|
||
| jobs: | ||
| e2e: | ||
| name: "E2E: runtime + gdalraster + hook" | ||
| # release trigger fires for package releases (v*) too; only bundle | ||
| # releases are relevant here | ||
| if: github.event_name != 'release' || startsWith(github.event.release.tag_name, 'gdal-v') | ||
| runs-on: windows-latest | ||
| timeout-minutes: 90 | ||
| env: | ||
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
| RUNTIME_TAG: ${{ github.event_name == 'release' && github.event.release.tag_name || github.event.inputs.runtime_tag || 'latest' }} | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - uses: r-lib/actions/setup-r@v2 | ||
| with: | ||
| r-version: 'release' | ||
| use-public-rspm: true | ||
|
|
||
| # installs gdalraster.windows (local checkout) plus its dependencies | ||
| - uses: r-lib/actions/setup-r-dependencies@v2 | ||
| with: | ||
| extra-packages: any::pak, local::. | ||
|
|
||
| - name: Install GDAL runtime bundle | ||
| shell: Rscript {0} | ||
| run: | | ||
| tag <- Sys.getenv("RUNTIME_TAG", unset = "latest") | ||
| if (!nzchar(tag)) tag <- "latest" | ||
| gdalraster.windows::install_gdal_runtime(tag = tag) | ||
|
|
||
| - name: Install gdalraster R dependencies (CRAN binaries) | ||
| shell: Rscript {0} | ||
| run: | | ||
| src <- file.path(tempdir(), "gdalraster-src.tar.gz") | ||
| utils::download.file( | ||
| "https://codeload.github.com/firelab/gdalraster/tar.gz/HEAD", | ||
| destfile = src, mode = "wb", quiet = TRUE | ||
| ) | ||
| exdir <- file.path(tempdir(), "gdalraster-src") | ||
| utils::untar(src, exdir = exdir) | ||
| pkg_dir <- list.dirs(exdir, recursive = FALSE)[[1]] | ||
| pak::local_install_deps(pkg_dir) | ||
|
|
||
| - name: Build gdalraster from source against the bundle | ||
| shell: Rscript {0} | ||
| run: | | ||
| gdalraster.windows::install_gdalraster() | ||
|
|
||
| - name: Verify algorithm API (explicit load) | ||
| shell: Rscript {0} | ||
| run: | | ||
| ok <- gdalraster.windows::verify_gdalraster_runtime() | ||
| stopifnot(isTRUE(ok)) | ||
|
|
||
| - name: Verify algorithm API (startup hook, fresh session) | ||
| shell: Rscript {0} | ||
| run: | | ||
| rprofile <- file.path(getwd(), "e2e-hook.Rprofile") | ||
| gdalraster.windows::add_gdal_rprofile_hook(rprofile = rprofile) | ||
|
|
||
| script <- file.path(getwd(), "e2e-hook-check.R") | ||
| writeLines( | ||
| c( | ||
| "library(gdalraster)", | ||
| "n <- length(gdalraster::gdal_global_reg_names())", | ||
| "cat('algorithm registry entries:', n, '\n')", | ||
| "stopifnot(n > 0L)" | ||
| ), | ||
| con = script | ||
| ) | ||
|
|
||
| status <- withr::with_envvar( | ||
| c(R_PROFILE_USER = rprofile), | ||
| system2(file.path(R.home("bin"), "Rscript.exe"), args = script) | ||
| ) | ||
| stopifnot(identical(status, 0L)) | ||
|
|
||
| - name: Write summary | ||
| if: always() | ||
| shell: pwsh | ||
| run: | | ||
| @" | ||
| ## E2E runtime verification | ||
|
|
||
| | Item | Value | | ||
| |------|-------| | ||
| | Runtime tag | ``$env:RUNTIME_TAG`` | | ||
| | Trigger | ``${{ github.event_name }}`` | | ||
| | Result | ${{ job.status }} | | ||
| "@ | Out-File -Append -Encoding utf8 $env:GITHUB_STEP_SUMMARY |
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
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
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
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.