Skip to content

Commit 84220e1

Browse files
committed
test shifting from travis to gh actions for CI
1 parent b307e71 commit 84220e1

File tree

4 files changed

+87
-0
lines changed

4 files changed

+87
-0
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
^\.github$

.github/.gitignore

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

.github/workflows/ci.yaml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
2+
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
- devel
9+
pull_request:
10+
branches:
11+
- main
12+
- master
13+
- devel
14+
15+
name: CI
16+
17+
jobs:
18+
CI:
19+
runs-on: ${{ matrix.config.os }}
20+
21+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
22+
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
config:
27+
- {os: windows-latest, r: 'release'}
28+
- {os: macOS-latest, r: 'release'}
29+
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
30+
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
31+
32+
env:
33+
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
34+
RSPM: ${{ matrix.config.rspm }}
35+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
36+
NIMBLE_TEST_BATCH: 1
37+
38+
steps:
39+
- uses: actions/checkout@v2
40+
41+
- uses: r-lib/actions/setup-r@v1
42+
with:
43+
r-version: ${{ matrix.config.r }}
44+
45+
- uses: r-lib/actions/setup-pandoc@v1
46+
47+
- name: Query dependencies
48+
run: |
49+
install.packages('remotes')
50+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
51+
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
52+
shell: Rscript {0}
53+
54+
- name: Restore R package cache
55+
if: runner.os != 'Windows'
56+
uses: actions/cache@v2
57+
with:
58+
path: ${{ env.R_LIBS_USER }}
59+
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
60+
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
61+
62+
- name: Install system dependencies
63+
if: runner.os == 'Linux'
64+
run: |
65+
while read -r cmd
66+
do
67+
eval sudo $cmd
68+
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
69+
70+
- name: Install dependencies
71+
run: |
72+
./install_requirements.R
73+
74+
- name: Check
75+
env:
76+
NIMBLE_TEST_BATCH: 1
77+
run: |
78+
./run_tests.R
79+
80+
- name: Upload check results
81+
if: failure()
82+
uses: actions/upload-artifact@main
83+
with:
84+
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
85+
path: check
File renamed without changes.

0 commit comments

Comments
 (0)