Skip to content

Commit

Permalink
Update GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
nfrerebeau committed Sep 18, 2024
1 parent 5a598db commit 78b72a6
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 77 deletions.
Original file line number Diff line number Diff line change
@@ -1,36 +1,46 @@
# CI GitHub Action ... adapted from usethis::use_github_actions()
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [master]

branches: [main, master]
pull_request:
branches: [master, new_feature]
branches: [main, master]

name: GitHub Actions CI
name: R-CMD-check.yaml

## change if caches needs to be refreshed
env:
cache-version: v4
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: windows-latest, r: 'release', not_cran: 'true'}
- {os: macos-12, r: 'release', not_cran: 'true'}
- {os: ubuntu-latest, r: 'devel', not_cran: 'true'}
- {os: ubuntu-latest, r: 'release', not_cran: 'true'}
- {os: ubuntu-latest, r: 'oldrel', not_cran: 'true'}
- {os: macos-12, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
_R_CHECK_FORCE_SUGGESTS_: true
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v4

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

- 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

- name: Install JAGS on macOS
if: runner.os == 'macOS'
run: brew install jags
Expand All @@ -48,30 +58,12 @@ jobs:
curl --progress-bar -s -o 'C:\JAGS-4.3.1.exe' -L 'https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Windows/JAGS-4.3.1.exe'
C:\JAGS-4.3.1.exe /S
- uses: actions/checkout@v4

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

- 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
any::XML
any::covr
extra-packages: any::rcmdcheck
needs: check


- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true

- name: Test coverage
run: |
covr::codecov()
shell: Rscript {0}
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
61 changes: 61 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: test-coverage.yaml

permissions: read-all

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr, any::xml2
needs: coverage

- name: Test coverage
run: |
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}

- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }}
file: ./cobertura.xml
plugin: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
35 changes: 16 additions & 19 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ library(BayLum)
# BayLum <img width=120px src="man/figures/logo_BayLum.png" align="right" />

<!-- badges: start -->
[![R-CMD-check](https://github.com/crp2a/BayLum/actions/workflows/GitHub_Actions_CI.yaml/badge.svg)](https://github.com/crp2a/BayLum/actions/workflows/GitHub_Actions_CI.yaml)
[![R-CMD-check](https://github.com/crp2a/BayLum/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/crp2a/BayLum/actions/workflows/R-CMD-check.yaml)
[![codecov](https://codecov.io/gh/crp2a/BayLum/graph/badge.svg?token=cOdZr6imKX)](https://app.codecov.io/gh/crp2a/BayLum)

[![r-universe](https://crp2a.r-universe.dev/badges/BayLum)](https://crp2a.r-universe.dev/BayLum)
Expand All @@ -41,32 +41,29 @@ print(cite, bibtex = FALSE)

## Installation

To install the latest development builds directly from GitHub, run
**You need to have [JAGS](https://mcmc-jags.sourceforge.io) installed on your computer.**

```{r gh-installation, eval = FALSE}
if(!require("devtools"))
install.packages("devtools")
devtools::install_github("crp2a/BayLum@master")
```

To install a developer build other than 'master', replace the term 'master' in the codeline by the name
of the wanted developer build.

**Please note that you need to have [JAGS](https://mcmc-jags.sourceforge.io) installed on your computer**

## Note
You can install the released version of **BayLum** from [CRAN](https://CRAN.R-project.org) with:

**The package comes without any guarantee!**
```{r cran-installation, eval=FALSE}
install.packages("BayLum")
```

Please further note that this version is a development version and may change day by day. For stable branches please visit
the package on [CRAN 'BayLum'](https://CRAN.R-project.org/package=BayLum ).
And the development version from [GitHub](https://github.com/) with:

## Funding
```{r gh-installation, eval=FALSE}
# install.packages("remotes")
remotes::install_github("crp2a/BayLum")
```

The development of `'BayLum'` received a state financial support managed by the Agence Nationale de la Recherche (France) through the program *Investissements d'avenir* (ref. [ANR-10-LABX-52](https://lascarbx.labex.u-bordeaux.fr)) between 2015 and 2018.
Please note that development versions may change day by day.

## License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the [GNU General Public License](https://github.com/crp2a/BayLum/blob/master/LICENSE) for more details.

## Acknowledgements

The development of **BayLum** received a state financial support managed by the Agence Nationale de la Recherche (France) through the program *Investissements d'avenir* (ref. [ANR-10-LABX-52](https://lascarbx.labex.u-bordeaux.fr)) between 2015 and 2018.
45 changes: 21 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<!-- badges: start -->

[![R-CMD-check](https://github.com/crp2a/BayLum/actions/workflows/GitHub_Actions_CI.yaml/badge.svg)](https://github.com/crp2a/BayLum/actions/workflows/GitHub_Actions_CI.yaml)
[![R-CMD-check](https://github.com/crp2a/BayLum/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/crp2a/BayLum/actions/workflows/R-CMD-check.yaml)
[![codecov](https://codecov.io/gh/crp2a/BayLum/graph/badge.svg?token=cOdZr6imKX)](https://app.codecov.io/gh/crp2a/BayLum)

[![r-universe](https://crp2a.r-universe.dev/badges/BayLum)](https://crp2a.r-universe.dev/BayLum)
Expand Down Expand Up @@ -49,35 +49,24 @@ Optically Stimulated (OSL) **Lum**inescence Dating

## Installation

To install the latest development builds directly from GitHub, run
**You need to have [JAGS](https://mcmc-jags.sourceforge.io) installed on
your computer.**

You can install the released version of **BayLum** from
[CRAN](https://CRAN.R-project.org) with:

``` r
if(!require("devtools"))
install.packages("devtools")
devtools::install_github("crp2a/BayLum@master")
install.packages("BayLum")
```

To install a developer build other than ‘master’, replace the term
‘master’ in the codeline by the name of the wanted developer build.

**Please note that you need to have
[JAGS](https://mcmc-jags.sourceforge.io) installed on your computer**

## Note
And the development version from [GitHub](https://github.com/) with:

**The package comes without any guarantee!**

Please further note that this version is a development version and may
change day by day. For stable branches please visit the package on [CRAN
‘BayLum’](https://CRAN.R-project.org/package=BayLum).
``` r
# install.packages("remotes")
remotes::install_github("crp2a/BayLum")
```

## Funding

The development of `'BayLum'` received a state financial support managed
by the Agence Nationale de la Recherche (France) through the program
*Investissements d’avenir* (ref.
[ANR-10-LABX-52](https://lascarbx.labex.u-bordeaux.fr)) between 2015 and
2018.
Please note that development versions may change day by day.

## License

Expand All @@ -92,3 +81,11 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the [GNU
General Public
License](https://github.com/crp2a/BayLum/blob/master/LICENSE) for more
details.

## Acknowledgements

The development of **BayLum** received a state financial support managed
by the Agence Nationale de la Recherche (France) through the program
*Investissements d’avenir* (ref.
[ANR-10-LABX-52](https://lascarbx.labex.u-bordeaux.fr)) between 2015 and
2018.

0 comments on commit 78b72a6

Please sign in to comment.