# Multi-platform R CMD check, running on the GitHub mirror. # # This exists because the canonical Gitea runner is Linux-only, and this # package hard-depends on duckdb and httr2 -- both compiled, both with real # platform variance -- while having never been checked on Windows or macOS. # A large share of the audience is on Windows. # # Gitea reads .gitea/workflows and GitHub reads .github/workflows, so this # file is inert on the canonical repo and coexists with the Gitea CI that # remains authoritative for deploys. # # The suite needs NO credentials: tests/testthat/setup.R points USCOGDATA_URL # at the bundled fixture corpus. That is exactly why inst/extdata/fixture_corpus # must never be added to .Rbuildignore. on: push: branches: [main] pull_request: name: R-CMD-check permissions: read-all jobs: R-CMD-check: runs-on: ${{ matrix.config.os }} name: ${{ matrix.config.os }} (${{ matrix.config.r }}) strategy: fail-fast: false matrix: config: - {os: macos-latest, r: 'release'} - {os: windows-latest, r: 'release'} - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} - {os: ubuntu-latest, r: 'release'} env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} R_KEEP_PKG_SOURCE: yes steps: - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 - name: Drop the unused google-chrome apt source if: runner.os == 'Linux' run: | set -x grep -rl 'dl\.google\.com' /etc/apt/sources.list.d/ /etc/apt/sources.list 2>/dev/null || true sudo sh -c "grep -rl 'dl\.google\.com' /etc/apt/sources.list.d/ /etc/apt/sources.list 2>/dev/null | xargs -r rm -f" grep -rl 'dl\.google\.com' /etc/apt/sources.list.d/ /etc/apt/sources.list 2>/dev/null && exit 1 || true # setup-r@v2 runs `sudo apt-get update` before installing R, and that # command fails outright if ANY configured apt source is broken -- # even one we never use. The google-chrome source baked into GitHub's # ubuntu-latest image intermittently serves a stale Packages.gz that # doesn't match its own Release file's hash (a Google CDN sync race, # not anything about R or this repo), which took down every ubuntu # leg of this matrix on 2026-09-09. `rm -f` on a guessed filename # (google-chrome.list) reported success but removed nothing -- the # file it actually is on this image apparently doesn't match that # name, since the source kept showing up in setup-r's `apt-get # update` afterward. Find-by-content instead of guessing the # filename, and fail loudly here (before setup-r even runs) if a # matching source is still present, so a future runner-image change # surfaces as a clear failure in this step instead of a confusing # one in setup-r. - uses: r-lib/actions/setup-r@v2 with: r-version: ${{ matrix.config.r }} http-user-agent: ${{ matrix.config.http-user-agent }} use-public-rspm: true - uses: r-lib/actions/setup-r-dependencies@v2 with: extra-packages: any::rcmdcheck needs: check - uses: r-lib/actions/check-r-package@v2 with: upload-snapshots: true build_args: 'c("--no-manual")'