-
Notifications
You must be signed in to change notification settings - Fork 6
103 lines (88 loc) · 3.31 KB
/
Win-Dev-Dev.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
on:
workflow_dispatch:
push:
branches:
- dev
pull_request:
branches:
- dev
# for now, CRON jobs only run on the default branch of the repo (i.e. usually on master)
schedule:
# * is a special character in YAML so you have to quote this string
# Here it will run after every 8 hours starting from 0th hour of the day
- cron: "0 0/12 * * *"
name: Win-Dev-Dev
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'}
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
with:
ref: dev
- uses: r-lib/actions/setup-r@master
with:
r-version: ${{ matrix.config.r }}
- uses: r-lib/actions/setup-pandoc@master
- name: Install system dependencies
if: runner.os == 'Linux'
run: |
Rscript -e 'install.packages("remotes")'
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "20.04"), sep = "\n")')
- name: Query R packages
run: |
install.packages('devtools', dependencies = c('Depends', 'Imports'))
saveRDS(devtools::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
install.packages('remotes')
shell: Rscript {0}
- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
- name: Install R packages
run: |
remotes::install_deps(dependencies = TRUE)
# Your "dev" dependencies go here
remotes::install_github(c('bd-R/bdutilities@dev',
'bd-R/bdDwC@dev',
'bd-R/bdutilities.app@dev',
'bd-R/bddwc.app@dev',
'bd-R/bdchecks@dev',
'bd-R/bdchecks.app@dev',
'bd-R/bdclean@dev',
'bd-R/bdverse@dev',
'bd-R/bdtests@dev'),
depenedencies = FALSE)
# End "dev" here
remotes::install_cran("rcmdcheck")
remotes::install_cran("testthat")
shell: Rscript {0}
- name: Check
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: |
rcmdcheck::rcmdcheck(args = c("--no-manual"), error_on = "warning", check_dir = "check")
testthat::test_local()
shell: Rscript {0}
- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check