Skip to content

Commit a87870b

Browse files
committed
adapt actions
1 parent 22a6aca commit a87870b

File tree

4 files changed

+109
-149
lines changed

4 files changed

+109
-149
lines changed

.github/workflows/check-standard-spatial.yaml

Lines changed: 0 additions & 87 deletions
This file was deleted.

.github/workflows/check-standard.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
9+
name: R-CMD-check
10+
11+
jobs:
12+
R-CMD-check:
13+
runs-on: ${{ matrix.config.os }}
14+
15+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
16+
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
config:
21+
- {os: macos-latest, r: 'release'}
22+
- {os: windows-latest, r: 'release'}
23+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
24+
- {os: ubuntu-latest, r: 'release'}
25+
- {os: ubuntu-latest, r: 'oldrel-1'}
26+
27+
env:
28+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
29+
R_KEEP_PKG_SOURCE: yes
30+
31+
steps:
32+
- uses: actions/checkout@v3
33+
34+
- uses: r-lib/actions/setup-pandoc@v2
35+
36+
- uses: r-lib/actions/setup-r@v2
37+
with:
38+
r-version: ${{ matrix.config.r }}
39+
http-user-agent: ${{ matrix.config.http-user-agent }}
40+
use-public-rspm: true
41+
42+
- uses: r-lib/actions/setup-r-dependencies@v2
43+
with:
44+
extra-packages: any::rcmdcheck
45+
needs: check
46+
47+
- uses: r-lib/actions/check-r-package@v2
48+
with:
49+
upload-snapshots: true

.github/workflows/pkgdown.yaml

Lines changed: 29 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,46 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
13
on:
24
push:
3-
branches:
4-
- main
5-
- master
6-
tags:
7-
-'*'
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
release:
9+
types: [published]
10+
workflow_dispatch:
811

912
name: pkgdown
1013

1114
jobs:
1215
pkgdown:
13-
runs-on: macOS-latest
16+
runs-on: ubuntu-latest
17+
# Only restrict concurrency for non-PR jobs
18+
concurrency:
19+
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
1420
env:
1521
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1622
steps:
17-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v3
1824

19-
- uses: r-lib/actions/setup-r@v1
25+
- uses: r-lib/actions/setup-pandoc@v2
2026

21-
- uses: r-lib/actions/setup-pandoc@v1
22-
23-
- name: Query dependencies
24-
run: |
25-
install.packages('remotes')
26-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
27-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
28-
shell: Rscript {0}
27+
- uses: r-lib/actions/setup-r@v2
28+
with:
29+
use-public-rspm: true
2930

30-
- name: Restore R package cache
31-
uses: actions/cache@v2
31+
- uses: r-lib/actions/setup-r-dependencies@v2
3232
with:
33-
path: ${{ env.R_LIBS_USER }}
34-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
35-
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
33+
extra-packages: any::pkgdown, local::.
34+
needs: website
3635

37-
- name: Install dependencies
38-
run: |
39-
remotes::install_deps(dependencies = TRUE)
40-
install.packages("pkgdown", type = "binary")
36+
- name: Build site
37+
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
4138
shell: Rscript {0}
4239

43-
- name: Install package
44-
run: R CMD INSTALL .
45-
46-
- name: Deploy package
47-
run: |
48-
git config --local user.email "actions@github.com"
49-
git config --local user.name "GitHub Actions"
50-
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
40+
- name: Deploy to GitHub pages 🚀
41+
if: github.event_name != 'pull_request'
42+
uses: JamesIves/github-pages-deploy-action@v4.4.1
43+
with:
44+
clean: false
45+
branch: gh-pages
46+
folder: docs

.github/workflows/test-coverage.yaml

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,50 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
13
on:
24
push:
3-
branches:
4-
- main
5-
- master
5+
branches: [main, master]
66
pull_request:
7-
branches:
8-
- main
9-
- master
7+
branches: [main, master]
108

119
name: test-coverage
1210

1311
jobs:
1412
test-coverage:
15-
runs-on: macOS-latest
13+
runs-on: ubuntu-latest
1614
env:
1715
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
16+
1817
steps:
19-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v3
2019

21-
- uses: r-lib/actions/setup-r@v1
20+
- uses: r-lib/actions/setup-r@v2
21+
with:
22+
use-public-rspm: true
2223

23-
- uses: r-lib/actions/setup-pandoc@v1
24+
- uses: r-lib/actions/setup-r-dependencies@v2
25+
with:
26+
extra-packages: any::covr
27+
needs: coverage
2428

25-
- name: Query dependencies
29+
- name: Test coverage
2630
run: |
27-
install.packages('remotes')
28-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
29-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
31+
covr::codecov(
32+
quiet = FALSE,
33+
clean = FALSE,
34+
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
35+
)
3036
shell: Rscript {0}
3137

32-
- name: Restore R package cache
33-
uses: actions/cache@v2
34-
with:
35-
path: ${{ env.R_LIBS_USER }}
36-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
37-
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
38-
39-
- name: Install dependencies
38+
- name: Show testthat output
39+
if: always()
4040
run: |
41-
install.packages(c("remotes"))
42-
remotes::install_deps(dependencies = TRUE)
43-
remotes::install_cran("covr")
44-
shell: Rscript {0}
41+
## --------------------------------------------------------------------
42+
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
43+
shell: bash
4544

46-
- name: Test coverage
47-
run: covr::codecov()
48-
shell: Rscript {0}
45+
- name: Upload test results
46+
if: failure()
47+
uses: actions/upload-artifact@v3
48+
with:
49+
name: coverage-test-failures
50+
path: ${{ runner.temp }}/package

0 commit comments

Comments
 (0)