-
Notifications
You must be signed in to change notification settings - Fork 321
132 lines (107 loc) · 4.33 KB
/
R-CMD-check.yaml
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
schedule:
- cron: '21 3 * * Fri'
name: R-CMD-check
defaults:
run:
shell: Rscript {0}
jobs:
R-CMD-check:
name: ${{ matrix.os }}, tf-${{ matrix.tf }}, R-${{ matrix.r}}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- {os: 'ubuntu-latest' , tf: 'default', r: 'release'}
- {os: 'windows-latest', tf: 'default', r: 'release'}
- {os: 'macOS-latest' , tf: 'default', r: 'release'}
- {os: 'ubuntu-latest' , tf: 'default', r: 'oldrel'}
- {os: 'windows-latest', tf: 'default', r: 'oldrel'}
- {os: 'macOS-latest' , tf: 'default', r: 'oldrel'}
# - {os: 'ubuntu-20.04', tf: 'default', r: '3.6'} # default R in ubuntu-20.04
- {os: 'ubuntu-latest', tf: 'default', r: 'oldrel-1'}
- {os: 'ubuntu-latest', tf: 'default', r: 'oldrel-2'}
- {os: 'ubuntu-latest', tf: 'default', r: 'oldrel-3'}
## uncomment if/when tf "release" != "default"
# - {os: 'ubuntu-20.04' , tf: 'release', r: 'release'}
# - {os: 'windows-latest', tf: 'release', r: 'release'}
# - {os: 'macOS-latest' , tf: 'release', r: 'release'}
- {os: 'ubuntu-latest', tf: '2.12', r: 'release'}
- {os: 'ubuntu-latest', tf: '2.11' , r: 'release'}
- {os: 'ubuntu-latest', tf: '2.10' , r: 'release'}
- {os: 'ubuntu-latest', tf: '2.9' , r: 'release'}
- {os: 'ubuntu-latest', tf: '2.8' , r: 'release'}
# these are allowed to fail
# - {os: 'ubuntu-20.04', tf: 'default', r: 'devel'}
# - {os: 'ubuntu-20.04', tf: 'nightly' , r: 'release'}
# - {os: 'ubuntu-20.04', tf: '2.7.0rc1', r: 'release'}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.tf == 'nightly' || contains(matrix.tf, 'rc') || matrix.r == 'devel' }}
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: 'true'
R_COMPILE_AND_INSTALL_PACKAGES: 'never'
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v2
id: setup-r
with:
r-version: ${{ matrix.r }}
Ncpus: '2L'
use-public-rspm: true
- uses: actions/setup-python@v4
# this doesn't really do anything, since we find venv starters
# not through the PATH
- uses: r-lib/actions/setup-pandoc@v2
- name: Get Date
id: get-date
shell: bash
run: |
echo "::set-output name=year-week::$(date -u "+%Y-%U")"
echo "::set-output name=date::$(date -u "+%F")"
- name: Restore R package cache
uses: actions/cache@v2
id: r-package-cache
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ matrix.os }}-${{ steps.setup-r.outputs.installed-r-version }}-${{ steps.get-date.outputs.year-week }}-1
# - name: Install remotes
# if: steps.r-package-cache.outputs.cache-hit != 'true'
# run: install.packages("remotes")
- name: Install system dependencies
if: runner.os == 'Linux'
shell: bash
run: |
. /etc/os-release
while read -r cmd
do
echo "$cmd"
sudo $cmd
done < <(Rscript -e "writeLines(remotes::system_requirements('$ID-$VERSION_ID'))")
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: rcmdcheck remotes local::.
cache-version: 4
upgrade: 'TRUE'
# - name: Install package + deps
# run: remotes::install_local(dependencies = TRUE, force = TRUE)
- name: Install TensorFlow
run: tensorflow::install_tensorflow(version = '${{ matrix.tf }}-cpu')
# - name: Install rcmdcheck
# run: remotes::install_cran("rcmdcheck")
- name: Check
run: rcmdcheck::rcmdcheck(args = '--no-manual', error_on = 'warning', check_dir = 'check')
- name: Show testthat output
if: always()
shell: bash
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
- name: Don't use tar from old Rtools to store the cache
if: ${{ runner.os == 'Windows' && startsWith(steps.install-r.outputs.installed-r-version, '3') }}
shell: bash
run: echo "C:/Program Files/Git/usr/bin" >> $GITHUB_PATH