Skip to content

Commit

Permalink
update actions
Browse files Browse the repository at this point in the history
  • Loading branch information
tmelliott committed May 3, 2024
1 parent 1f3c667 commit 9626272
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 93 deletions.
69 changes: 16 additions & 53 deletions .github/workflows/R-CMD-CHECK.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,72 +12,35 @@ jobs:
fail-fast: false
matrix:
config:
- { os: windows-latest, r: "release" }
- { os: windows-latest, r: "devel" }
- { os: macOS-latest, r: "release" }
# - {os: macOS-latest, r: 'devel'}
- {
os: ubuntu-20.04,
r: "release",
rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest",
}
- { os: windows-latest, r: "4.1", cache: 1 }
- { os: windows-latest, r: "4.2", cache: 1 }
- { os: windows-latest, r: "release", cache: 1 }
- { os: macOS-latest, r: "release", cache: 1 }
- { os: ubuntu-latest, r: "release", cache: 1 }
- { os: ubuntu-latest, r: "devel", cache: 1 }

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.config.os }}-${{ matrix.config.r }}
cancel-in-progress: true

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
use-public-rspm: true
extra-repositories: "https://r.docker.stat.auckland.ac.nz"

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

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v3
- uses: r-lib/actions/setup-r-dependencies@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ matrix.config.os }}-r-${{ matrix.config.r }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ matrix.config.os }}-r-${{ matrix.config.r }}-1-

- name: Install system dependencies
if: runner.os == 'Linux'
env:
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
run: |
Rscript -e "remotes::install_github('r-hub/sysreqs')"
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
sudo -s eval "$sysreqs"
cache-version: ${{ matrix.config.cache }}
needs: |
check
dependencies
install-pandoc: true

- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}

- name: Check
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
shell: Rscript {0}

- name: Upload check results
if: failure()
uses: actions/upload-artifact@master
with:
name: ${{ matrix.config.os }}-r${{ matrix.config.r }}-results
path: check
- uses: r-lib/actions/check-r-package@v2
53 changes: 13 additions & 40 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,61 +12,34 @@ jobs:
fail-fast: false
matrix:
config:
- { os: windows-latest, r: "release" }
- { os: macOS-latest, r: "release" }
- {
os: ubuntu-20.04,
r: "release",
rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest",
}
- { os: windows-latest, r: "release", cache: 1 }
- { os: macOS-latest, r: "release", cache: 1 }
- { os: ubuntu-latest, r: "release", cache: 1 }

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.config.os }}-${{ matrix.config.r }}
cancel-in-progress: true

steps:
- uses: actions/checkout@v3

- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
use-public-rspm: true

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

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v3
- uses: r-lib/actions/setup-r-dependencies@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ matrix.config.os }}-r-${{ matrix.config.r }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ matrix.config.os }}-r-${{ matrix.config.r }}-1-

- name: Install system dependencies
if: runner.os == 'Linux'
env:
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
run: |
Rscript -e "remotes::install_github('r-hub/sysreqs')"
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
sudo -s eval "$sysreqs"
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}
cache-version: ${{ matrix.config.cache }}
needs: |
check
coverage
install-pandoc: true

- name: Test coverage
run: covr::codecov()
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
shell: Rscript {0}
5 changes: 5 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,8 @@ License: GPL-3
Encoding: UTF-8
Language: en-GB
RoxygenNote: 7.2.3
Config/Needs/dependencies:
rcmdcheck,
curl
Config/Needs/coverage:
covr

0 comments on commit 9626272

Please sign in to comment.