Skip to content

Commit 4674d18

Browse files
committed
Update github actions
1 parent 4b251e0 commit 4674d18

6 files changed

Lines changed: 128 additions & 153 deletions

File tree

.github/workflows/R-CMD-check.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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+
8+
name: R-CMD-check.yaml
9+
10+
permissions: read-all
11+
12+
jobs:
13+
R-CMD-check:
14+
runs-on: ${{ matrix.config.os }}
15+
16+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
17+
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
config:
22+
- {os: macos-latest, r: 'release'}
23+
- {os: windows-latest, r: 'release'}
24+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
25+
- {os: ubuntu-latest, r: 'release'}
26+
- {os: ubuntu-latest, r: 'oldrel-1'}
27+
28+
env:
29+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
30+
R_KEEP_PKG_SOURCE: yes
31+
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- uses: r-lib/actions/setup-pandoc@v2
36+
37+
- uses: r-lib/actions/setup-r@v2
38+
with:
39+
r-version: ${{ matrix.config.r }}
40+
http-user-agent: ${{ matrix.config.http-user-agent }}
41+
use-public-rspm: true
42+
43+
- uses: r-lib/actions/setup-r-dependencies@v2
44+
with:
45+
extra-packages: any::rcmdcheck
46+
needs: check
47+
48+
- uses: r-lib/actions/check-r-package@v2
49+
with:
50+
upload-snapshots: true
51+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

.github/workflows/check-standard.yaml

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

.github/workflows/pkgdown.yaml

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +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
13
on:
24
push:
3-
branches:
4-
- main
5-
- master
5+
branches: [main, master]
6+
pull_request:
7+
release:
8+
types: [published]
9+
workflow_dispatch:
610

7-
name: pkgdown
11+
name: pkgdown.yaml
12+
13+
permissions: read-all
814

915
jobs:
1016
pkgdown:
11-
runs-on: macOS-latest
17+
runs-on: ubuntu-latest
18+
# Only restrict concurrency for non-PR jobs
19+
concurrency:
20+
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
1221
env:
1322
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
23+
permissions:
24+
contents: write
1425
steps:
15-
- uses: actions/checkout@v2
16-
17-
- uses: r-lib/actions/setup-r@v2
26+
- uses: actions/checkout@v4
1827

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

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

28-
- name: Restore R package cache
29-
uses: actions/cache@v2
34+
- uses: r-lib/actions/setup-r-dependencies@v2
3035
with:
31-
path: ${{ env.R_LIBS_USER }}
32-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
33-
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
34-
35-
- name: Install dependencies
36-
run: |
37-
remotes::install_deps(dependencies = TRUE)
38-
install.packages("pkgdown", type = "binary")
39-
shell: Rscript {0}
36+
extra-packages: any::pkgdown, local::.
37+
needs: website
4038

41-
- name: Install package
42-
run: R CMD INSTALL .
39+
- name: Build site
40+
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
41+
shell: Rscript {0}
4342

44-
- name: Deploy package
45-
run: |
46-
git config --local user.email "actions@github.com"
47-
git config --local user.name "GitHub Actions"
48-
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
43+
- name: Deploy to GitHub pages 🚀
44+
if: github.event_name != 'pull_request'
45+
uses: JamesIves/github-pages-deploy-action@v4.5.0
46+
with:
47+
clean: false
48+
branch: gh-pages
49+
folder: docs
Lines changed: 42 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,62 @@
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-
- dev
5+
branches: [main, master]
76
pull_request:
8-
branches:
9-
- main
10-
- master
11-
- dev
127

13-
name: test-coverage
8+
name: test-coverage.yaml
9+
10+
permissions: read-all
1411

1512
jobs:
1613
test-coverage:
17-
runs-on: macOS-latest
14+
runs-on: ubuntu-latest
1815
env:
1916
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
17+
2018
steps:
21-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v4
2220

2321
- uses: r-lib/actions/setup-r@v2
22+
with:
23+
use-public-rspm: true
2424

25-
- uses: r-lib/actions/setup-pandoc@v2
25+
- uses: r-lib/actions/setup-r-dependencies@v2
26+
with:
27+
extra-packages: any::covr, any::xml2
28+
needs: coverage
2629

27-
- name: Query dependencies
30+
- name: Test coverage
2831
run: |
29-
install.packages('remotes')
30-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
31-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
32+
cov <- covr::package_coverage(
33+
quiet = FALSE,
34+
clean = FALSE,
35+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
36+
)
37+
print(cov)
38+
covr::to_cobertura(cov)
3239
shell: Rscript {0}
3340

34-
- name: Restore R package cache
35-
uses: actions/cache@v2
41+
- uses: codecov/codecov-action@v5
3642
with:
37-
path: ${{ env.R_LIBS_USER }}
38-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
39-
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
40-
41-
- name: Install dependencies
43+
# Fail if error if not on PR, or if on PR and token is given
44+
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
45+
files: ./cobertura.xml
46+
plugins: noop
47+
disable_search: true
48+
token: ${{ secrets.CODECOV_TOKEN }}
49+
50+
- name: Show testthat output
51+
if: always()
4252
run: |
43-
install.packages(c("remotes"))
44-
remotes::install_deps(dependencies = TRUE)
45-
remotes::install_cran("covr")
46-
shell: Rscript {0}
53+
## --------------------------------------------------------------------
54+
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
55+
shell: bash
4756

48-
- name: Test coverage
49-
run: covr::codecov()
50-
shell: Rscript {0}
57+
- name: Upload test results
58+
if: failure()
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: coverage-test-failures
62+
path: ${{ runner.temp }}/package

README.Rmd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ knitr::opts_chunk$set(
2121
[<img src="https://img.shields.io/badge/License-MIT-blue.svg">](https://github.com/atorus-research/metacore/blob/master/LICENSE)
2222
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental-1)
2323
[![CRAN status](https://www.r-pkg.org/badges/version/metacore)](https://CRAN.R-project.org/package=metacore)
24+
[![R-CMD-check](https://github.com/atorus-research/metacore/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/atorus-research/metacore/actions/workflows/R-CMD-check.yaml)
2425
<!-- badges: end -->
2526

2627
Programming for clinical trial data analysis tends to be very standardized. With data standards such as [CDISC](https://www.cdisc.org/), expectations tend to be very clearly defined. Within these programming activities, there's ample room for the use of metadata. Metadata can be used for several different purposes, such as applying dataset attributes, establishing sort sequences, working with controlled terminology, and more. Despite CDISC standards, organizations tend to have their own means of storing metadata, be it in excel spreadsheets, databases, and more.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ status](https://github.com/atorus-research/metacore/workflows/R-CMD-check/badge.
1414
experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental-1)
1515
[![CRAN
1616
status](https://www.r-pkg.org/badges/version/metacore)](https://CRAN.R-project.org/package=metacore)
17+
[![R-CMD-check](https://github.com/atorus-research/metacore/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/atorus-research/metacore/actions/workflows/R-CMD-check.yaml)
1718
<!-- badges: end -->
1819

1920
Programming for clinical trial data analysis tends to be very

0 commit comments

Comments
 (0)