Skip to content

Commit dcdc41e

Browse files
Add GH actions
1 parent 751a0e2 commit dcdc41e

11 files changed

+139
-15
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ Scratch
77
^cran-comments\.md$
88
^codecov\.yml$
99
^CRAN-RELEASE$
10+
^\.github$

.github/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.html

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

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

.github/workflows/test-coverage.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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: test-coverage.yaml
10+
11+
permissions: read-all
12+
13+
jobs:
14+
test-coverage:
15+
runs-on: ubuntu-latest
16+
env:
17+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- uses: r-lib/actions/setup-r@v2
23+
with:
24+
use-public-rspm: true
25+
26+
- uses: r-lib/actions/setup-r-dependencies@v2
27+
with:
28+
extra-packages: any::covr, any::xml2
29+
needs: coverage
30+
31+
- name: Test coverage
32+
run: |
33+
cov <- covr::package_coverage(
34+
quiet = FALSE,
35+
clean = FALSE,
36+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
37+
)
38+
covr::to_cobertura(cov)
39+
shell: Rscript {0}
40+
41+
- uses: codecov/codecov-action@v4
42+
with:
43+
fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }}
44+
file: ./cobertura.xml
45+
plugin: noop
46+
disable_search: true
47+
token: ${{ secrets.CODECOV_TOKEN }}
48+
49+
- name: Show testthat output
50+
if: always()
51+
run: |
52+
## --------------------------------------------------------------------
53+
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
54+
shell: bash
55+
56+
- name: Upload test results
57+
if: failure()
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: coverage-test-failures
61+
path: ${{ runner.temp }}/package

README.Rmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ knitr::opts_chunk$set(
1515

1616
# ContourFunctions
1717

18+
<!-- badges: start -->
1819
[![Travis-CI Build Status](https://travis-ci.org/CollinErickson/ContourFunctions.svg?branch=master)](https://travis-ci.org/CollinErickson/ContourFunctions)
1920
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/ContourFunctions)](https://cran.r-project.org/package=ContourFunctions)
2021
[![Codecov test coverage](https://codecov.io/gh/CollinErickson/ContourFunctions/branch/master/graph/badge.svg)](https://codecov.io/gh/CollinErickson/ContourFunctions?branch=master)
22+
[![R-CMD-check](https://github.com/CollinErickson/ContourFunctions/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/CollinErickson/ContourFunctions/actions/workflows/R-CMD-check.yaml)
23+
<!-- badges: end -->
2124

2225
This is an R package that provides simple functions for creating contour plots.
2326

README.md

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@
33

44
# ContourFunctions
55

6+
<!-- badges: start -->
7+
68
[![Travis-CI Build
79
Status](https://travis-ci.org/CollinErickson/ContourFunctions.svg?branch=master)](https://travis-ci.org/CollinErickson/ContourFunctions)
8-
[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/ContourFunctions)](https://cran.r-project.org/package=ContourFunctions)
10+
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/ContourFunctions)](https://cran.r-project.org/package=ContourFunctions)
911
[![Codecov test
1012
coverage](https://codecov.io/gh/CollinErickson/ContourFunctions/branch/master/graph/badge.svg)](https://codecov.io/gh/CollinErickson/ContourFunctions?branch=master)
13+
[![R-CMD-check](https://github.com/CollinErickson/ContourFunctions/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/CollinErickson/ContourFunctions/actions/workflows/R-CMD-check.yaml)
14+
<!-- badges: end -->
1115

1216
This is an R package that provides simple functions for creating contour
1317
plots.
@@ -16,35 +20,36 @@ plots.
1620

1721
The main functions are:
1822

19-
- `cf_grid`: Makes a contour plot from grid data.
23+
- `cf_grid`: Makes a contour plot from grid data.
2024

21-
- `cf_func`: Makes a contour plot for a function.
25+
- `cf_func`: Makes a contour plot for a function.
2226

23-
- `cf_data`: Makes a contour plot for a data set by fitting a Gaussian
24-
process model.
27+
- `cf_data`: Makes a contour plot for a data set by fitting a Gaussian
28+
process model.
2529

26-
- `cf`: Passes arguments to `cf_function` or `cf_data` depending on
27-
whether the first argument is a function or numeric.
30+
- `cf`: Passes arguments to `cf_function` or `cf_data` depending on
31+
whether the first argument is a function or numeric.
2832

2933
All of these functions make the plot using base graphics by default. To
3034
make plots using ggplot2, add the argument `gg=TRUE`, or put g in front
31-
of the function name. E.g., `gcf_data(...)` is the same as `cf_data(...,
32-
gg=TRUE)`, and makes a similar plot to `cf_data` but using ggplot2.
35+
of the function name. E.g., `gcf_data(...)` is the same as
36+
`cf_data(..., gg=TRUE)`, and makes a similar plot to `cf_data` but using
37+
ggplot2.
3338

3439
There are two functions for making plots in higher dimensions:
3540

36-
- `cf_4dim`: Plots functions with four inputs by making a series of
37-
contour plots.
41+
- `cf_4dim`: Plots functions with four inputs by making a series of
42+
contour plots.
3843

39-
- `cf_highdim`: Plots for higher dimensional inputs by making a
40-
contour plot for each pair of input dimensions and holding the other
41-
inputs constant or averaging over them.
44+
- `cf_highdim`: Plots for higher dimensional inputs by making a contour
45+
plot for each pair of input dimensions and holding the other inputs
46+
constant or averaging over them.
4247

4348
## Installation
4449

4550
# It can be installed like any other package
4651
install.packages("ContourFunctions")
47-
52+
4853
# Or the the development version from GitHub:
4954
# install.packages("devtools")
5055
devtools::install_github("CollinErickson/contour")
@@ -80,6 +85,7 @@ x <- runif(20)
8085
y <- runif(20)
8186
z <- exp(-(x-.5)^2-5*(y-.5)^2)
8287
cf_data(x,y,z)
88+
#> Fitting with laGP since n <= 200
8389
```
8490

8591
![](tools/README-cf_data-1.png)<!-- -->

tools/README-cf_4dim-1.png

520 Bytes
Loading

tools/README-cf_data-1.png

152 Bytes
Loading

tools/README-cf_func-1.png

134 Bytes
Loading

tools/README-cf_grid-1.png

118 Bytes
Loading

0 commit comments

Comments
 (0)