Skip to content

Commit 470e643

Browse files
committed
Use github actions for CI tests
1 parent ae01728 commit 470e643

File tree

5 files changed

+200
-29
lines changed

5 files changed

+200
-29
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
2+
# Runs without suggested packages as these must be handled conditionally
3+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
4+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
5+
6+
on:
7+
push:
8+
branches: [main, master]
9+
pull_request:
10+
branches: [main, master]
11+
12+
#name: R-CMD-check
13+
14+
jobs:
15+
R-CMD-check:
16+
runs-on: ${{ matrix.config.os }}
17+
18+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
config:
24+
- {os: macOS-latest, r: 'release'}
25+
- {os: windows-latest, r: 'release'}
26+
- {os: ubuntu-latest, r: 'release'}
27+
28+
env:
29+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
30+
R_KEEP_PKG_SOURCE: yes
31+
_R_CHECK_CRAN_INCOMING_: false
32+
_R_CHECK_FORCE_SUGGESTS_: false
33+
_R_CHECK_DEPENDS_ONLY_: true
34+
35+
steps:
36+
- uses: actions/checkout@v2
37+
38+
# Always try to use the latest pandoc version
39+
# https://github.com/jgm/pandoc/releases
40+
- uses: r-lib/actions/setup-pandoc@v2
41+
with:
42+
pandoc-version: '2.19.2'
43+
44+
- uses: r-lib/actions/setup-r@v2
45+
with:
46+
r-version: ${{ matrix.config.r }}
47+
http-user-agent: ${{ matrix.config.http-user-agent }}
48+
use-public-rspm: true
49+
50+
# TODO: Check which of the ignore conditions are still relevant given the
51+
# current suggested dependencies and the minimum supported R version.
52+
# Update if anything out of date or not needed anymore.
53+
#
54+
# `{EGAnet}` needs `{XML}`, and there are currently issues in downloading
55+
# it for certain R versions. So just don't install it for now.
56+
- uses: r-lib/actions/setup-r-dependencies@v2
57+
with:
58+
pak-version: devel
59+
extra-packages: |
60+
any::rcmdcheck
61+
needs: check
62+
63+
# Don't error on "note" because if any of the suggested packages are not available
64+
# for a given R version, this generates a NOTE causing unnecessary build failure
65+
- uses: r-lib/actions/check-r-package@v2
66+
with:
67+
error-on: '"warning"'
68+
upload-snapshots: true

.github/workflows/R-check.yaml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
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+
4+
on:
5+
push:
6+
branches: [main, master]
7+
pull_request:
8+
branches: [main, master]
9+
10+
#name: R-CMD-check
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: 'devel'}
23+
- {os: macOS-latest, r: 'release'}
24+
- {os: macOS-latest, r: 'oldrel'}
25+
26+
- {os: windows-latest, r: 'devel'}
27+
- {os: windows-latest, r: 'release'}
28+
- {os: windows-latest, r: 'oldrel'}
29+
30+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
31+
- {os: ubuntu-latest, r: 'release'}
32+
- {os: ubuntu-latest, r: 'oldrel'}
33+
34+
env:
35+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
36+
R_KEEP_PKG_SOURCE: yes
37+
_R_CHECK_CRAN_INCOMING_: false
38+
_R_CHECK_FORCE_SUGGESTS_: false
39+
40+
steps:
41+
- uses: actions/checkout@v2
42+
43+
# Always try to use the latest pandoc version
44+
# https://github.com/jgm/pandoc/releases
45+
- uses: r-lib/actions/setup-pandoc@v2
46+
with:
47+
pandoc-version: '2.19.2'
48+
49+
- uses: r-lib/actions/setup-r@v2
50+
with:
51+
r-version: ${{ matrix.config.r }}
52+
http-user-agent: ${{ matrix.config.http-user-agent }}
53+
use-public-rspm: true
54+
55+
# TODO: Check which of the ignore conditions are still relevant given the
56+
# current suggested dependencies and the minimum supported R version.
57+
# Update if anything out of date or not needed anymore.
58+
#
59+
# `{EGAnet}` needs `{XML}`, and there are currently issues in downloading
60+
# it for certain R versions. So just don't install it for now.
61+
- uses: r-lib/actions/setup-r-dependencies@v2
62+
with:
63+
pak-version: devel
64+
extra-packages: |
65+
any::rcmdcheck
66+
needs: check
67+
68+
# Don't error on "note" because if any of the suggested packages are not available
69+
# for a given R version, this generates a NOTE causing unnecessary build failure
70+
- uses: r-lib/actions/check-r-package@v2
71+
with:
72+
error-on: '"warning"'
73+
upload-snapshots: true

.github/workflows/codecov.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/master/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
10+
11+
jobs:
12+
test-coverage:
13+
runs-on: ubuntu-latest
14+
env:
15+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
- uses: r-lib/actions/setup-r@v1
21+
with:
22+
use-public-rspm: true
23+
24+
- uses: r-lib/actions/setup-r-dependencies@v1
25+
with:
26+
extra-packages: covr
27+
28+
- name: Test coverage
29+
run: covr::codecov()
30+
shell: Rscript {0}

.github/workflows/lint.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/master/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: lint
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
env:
15+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
16+
steps:
17+
- uses: actions/checkout@v2
18+
19+
- uses: r-lib/actions/setup-r@v1
20+
with:
21+
use-public-rspm: true
22+
23+
- uses: r-lib/actions/setup-r-dependencies@v1
24+
with:
25+
extra-packages: lintr
26+
27+
- name: Lint
28+
run: lintr::lint_package()
29+
shell: Rscript {0}

.travis.yml

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

0 commit comments

Comments
 (0)