Skip to content

Commit

Permalink
updated actions and pkgdown config
Browse files Browse the repository at this point in the history
  • Loading branch information
dhersz committed Jan 17, 2025
1 parent e0fc8d2 commit af5c2d8
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 159 deletions.
70 changes: 10 additions & 60 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:
config:
- {os: windows-latest, r: 'release'}
- {os: macOS-latest, r: 'release'}
- {os: ubuntu-20.04, r: 'devel'}
- {os: ubuntu-20.04, r: 'release'}
- {os: ubuntu-20.04, r: 'oldrel'}
- {os: ubuntu-22.04, r: 'devel'}
- {os: ubuntu-22.04, r: 'release'}
- {os: ubuntu-22.04, r: 'oldrel'}

env:
RSPM: ${{ matrix.config.rspm }}
Expand All @@ -38,75 +38,25 @@ jobs:
- name: Setup conda
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: latest
activate-environment: my-env

- name: Update PATH env variable to include conda bin dir (Linux and MacOS)
run: echo "PATH=$PATH" >> $GITHUB_ENV
if: runner.os != 'Windows'

- name: Install osmium
run: conda install -c conda-forge osmium-tool
run: conda install -c conda-forge osmium-tool

- name: Install R
uses: r-lib/actions/setup-r@v2
id: install-r
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}

- uses: r-lib/actions/setup-pandoc@v2

- name: Install pak and query dependencies
run: |
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds")
shell: Rscript {0}

- name: Restore R package cache
uses: actions/cache@v3
- uses: r-lib/actions/setup-r-dependencies@v2
with:
path: |
${{ env.R_LIBS_USER }}/*
!${{ env.R_LIBS_USER }}/pak
key: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
restore-keys: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-

- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
pak::local_system_requirements(execute = TRUE)
pak::pkg_system_requirements("rcmdcheck", execute = TRUE)
shell: Rscript {0}

- name: Install dependencies
run: |
pak::local_install_dev_deps(upgrade = TRUE)
pak::pkg_install("rcmdcheck")
shell: Rscript {0}

- name: Session info
run: |
options(width = 100)
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}
extra-packages: any::rcmdcheck
needs: check

- name: Check
env:
_R_CHECK_CRAN_INCOMING_: false
run: |
options(crayon.enabled = TRUE)
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
shell: Rscript {0}

- name: Show testthat output
if: always()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ matrix.config.os }}-r${{ matrix.config.r }}-results
path: check
- uses: r-lib/actions/check-r-package@v2
64 changes: 7 additions & 57 deletions .github/workflows/check_as_cran.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,73 +23,23 @@ jobs:
fail-fast: false
matrix:
config:
- {os: ubuntu-20.04, r: 'release'}

env:
RSPM: ${{ matrix.config.rspm }}
- {os: ubuntu-22.04, r: 'release'}

steps:
- uses: actions/checkout@v4

- name: Install R
uses: r-lib/actions/setup-r@v2
id: install-r
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}

- name: Install pak and query dependencies
run: |
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds")
shell: Rscript {0}
- uses: r-lib/actions/setup-pandoc@v2

- name: Restore R package cache
uses: actions/cache@v3
- uses: r-lib/actions/setup-r-dependencies@v2
with:
path: |
${{ env.R_LIBS_USER }}/*
!${{ env.R_LIBS_USER }}/pak
key: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
restore-keys: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-

- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
pak::local_system_requirements(execute = TRUE)
pak::pkg_system_requirements("rcmdcheck", execute = TRUE)
shell: Rscript {0}

- name: Install dependencies
run: |
pak::local_install_dev_deps(upgrade = TRUE)
pak::pkg_install("rcmdcheck")
shell: Rscript {0}

- name: Session info
run: |
options(width = 100)
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}
extra-packages: any::rcmdcheck
needs: check

- name: Check
- uses: r-lib/actions/check-r-package@v2
env:
_R_CHECK_CRAN_INCOMING_: false
NOT_CRAN: false
run: |
options(crayon.enabled = TRUE)
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
shell: Rscript {0}

- name: Show testthat output
if: always()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ matrix.config.os }}-r${{ matrix.config.r }}-results
path: check
9 changes: 3 additions & 6 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,23 @@ jobs:
run:
shell: bash -l {0}

runs-on: ubuntu-20.04

env:
RSPM: https://packagemanager.rstudio.com/cran/__linux__/focal/latest
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4

- name: Setup conda
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: latest
activate-environment: my-env

- name: Update PATH env variable to include conda bin dir (Linux and MacOS)
run: echo "PATH=$PATH" >> $GITHUB_ENV
if: runner.os != 'Windows'

- name: Install osmium
run: conda install -c conda-forge osmium-tool
run: conda install -c conda-forge osmium-tool

- uses: r-lib/actions/setup-pandoc@v2

Expand Down
54 changes: 21 additions & 33 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,58 +15,46 @@ jobs:
run:
shell: bash -l {0}

runs-on: ubuntu-20.04

env:
RSPM: https://packagemanager.rstudio.com/cran/__linux__/focal/latest
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4

- name: Setup conda
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: latest
activate-environment: my-env

- name: Update PATH env variable to include conda bin dir (Linux and MacOS)
run: echo "PATH=$PATH" >> $GITHUB_ENV
if: runner.os != 'Windows'

- name: Install osmium
run: conda install -c conda-forge osmium-tool
run: conda install -c conda-forge osmium-tool

- uses: r-lib/actions/setup-r@v2
id: install-r

- name: Install pak and query dependencies
run: |
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds")
shell: Rscript {0}

- name: Restore R package cache
uses: actions/cache@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
path: |
${{ env.R_LIBS_USER }}/*
!${{ env.R_LIBS_USER }}/pak
key: ubuntu-20.04-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
restore-keys: ubuntu-20.04-${{ steps.install-r.outputs.installed-r-version }}-1-
extra-packages: any::covr, any::xml2
needs: coverage

- name: Install system dependencies
if: runner.os == 'Linux'
run: |
pak::local_system_requirements(execute = TRUE)
pak::pkg_system_requirements("covr", execute = TRUE)
shell: Rscript {0}

- name: Install dependencies
- name: Test coverage
run: |
pak::local_install_dev_deps(upgrade = TRUE)
pak::pkg_install("covr")
cov <- covr::package_coverage(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
covr::to_cobertura(cov)
shell: Rscript {0}

- name: Test coverage
run: covr::codecov(quiet = FALSE)
shell: Rscript {0}
- uses: codecov/codecov-action@v4
with:
# Fail if error if not on PR, or if on PR and token is given
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
file: ./cobertura.xml
plugin: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}
12 changes: 9 additions & 3 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
url: https://ipeagit.github.io/rosmium/

template:
bootstrap: 5
light-switch: true

development:
mode: auto

reference:
- title: "Functions"
- contents:
Expand All @@ -7,6 +16,3 @@ reference:
- title: "General documentation"
- contents:
- file_formats

development:
mode: auto

0 comments on commit af5c2d8

Please sign in to comment.