-
Notifications
You must be signed in to change notification settings - Fork 35
217 lines (188 loc) · 6.04 KB
/
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches:
- main
paths:
- .Rbuildignore
- R/**
- src/**
- tests/**
- tools/**
- vignettes/*
- configure*
- DESCRIPTION
- NAMESPACE
pull_request:
branches:
- main
paths:
- .github/workflows/check.yaml
- .Rbuildignore
- R/**
- src/**
- tests/**
- tools/**
- vignettes/*
- configure*
- DESCRIPTION
- NAMESPACE
workflow_dispatch:
name: R-CMD-check
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }}) ${{ matrix.config.full-features && 'full-features' || '' }}
strategy:
fail-fast: false
matrix:
config:
- { os: macos-latest, r: "release" }
- { os: windows-latest, r: "devel", rtools-version: "43" }
- { os: windows-latest, r: "release", rtools-version: "" }
- { os: ubuntu-latest, r: "devel", http-user-agent: "release" }
- { os: ubuntu-latest, r: "release" }
- { os: ubuntu-latest, r: "oldrel-1" }
include:
- config: { os: macos-latest, r: "release", full-features: true }
- config: { os: windows-latest, r: "release", full-features: true }
- config: { os: ubuntu-latest, r: "release", full-features: true }
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
LIBR_POLARS_BUILD: "true"
steps:
- uses: actions/checkout@v4
- name: Tune GitHub-hosted runner network
uses: smorimoto/tune-github-hosted-runner-network@v1
- name: Set rust target
id: rust-target
run: |
if [ "${{ runner.os }}" == "Windows" ]; then
echo "TARGET=x86_64-pc-windows-gnu" >>$GITHUB_OUTPUT
else
echo "TARGET=$(rustc -vV | grep host | cut -d' ' -f2)" >>$GITHUB_OUTPUT
fi
- name: Set env vars for build option
if: matrix.config.full-features
run: |
echo "RPOLARS_FULL_FEATURES=true" >>$GITHUB_ENV
echo "RPOLARS_PROFILE=release" >>$GITHUB_ENV
- uses: ./.github/actions/setup
with:
rust-nightly: "${{ matrix.config.full-features }}"
target: "${{ steps.rust-target.outputs.TARGET }}"
token: "${{ secrets.GITHUB_TOKEN }}"
- name: print files
run: print(list.files("..",recursive = TRUE,full.names=TRUE))
shell: Rscript {0}
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true
rtools-version: ${{ matrix.config.rtools-version }}
Ncpus: 2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check
- name: Build lib
env:
NOT_CRAN: "true"
run: |
Rscript -e 'pkgbuild::compile_dll()'
echo "LIBR_POLARS_PATH=$(pwd)/src/rust/target/${{ steps.rust-target.outputs.TARGET }}/release/libr_polars.a" >>$GITHUB_ENV
- uses: r-lib/actions/check-r-package@v2
env:
LIBR_POLARS_BUILD: "false"
with:
upload-snapshots: false
error-on: '"never"' #errors are filtered by rules below
# - name: print R CMD check - install log
# shell: bash
# env:
# RUNNER_OS: ${{ runner.os }}
# run: |
# echo $RUNNER_OS
# if [ "$RUNNER_OS" == "Linux" ]
# then
# less /home/runner/work/r-polars/r-polars/check/polars.Rcheck/00install.out
# fi
#
# if [ "$RUNNER_OS" == "Windows" ]
# then
# less D:/a/r-polars/r-polars/check/polars.Rcheck/00install.out
# fi
#
# if [ "$RUNNER_OS" == "macOS" ]
# then
# less /home/runner/work/r-polars/r-polars/check/polars.Rcheck/00install.out
# fi
- name: print files
run: print(list.files("..",recursive = TRUE,full.names=TRUE))
shell: Rscript {0}
- name: raise remaining rcmdcheck errors
run: |
print(getwd());
source("./inst/misc/filter_rcmdcheck.R");
shell: Rscript {0}
source-with-bin-check:
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} with pre-built binary (${{ matrix.r }})
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- windows-latest
- ubuntu-latest
r:
- oldrel-1
- release
- devel
exclude:
- os: macos-latest
r: devel
- os: macos-latest
r: oldrel-1
env:
NOT_CRAN: "true"
LIB_SUMS_PATH: "tools/lib-sums.tsv"
steps:
- uses: actions/checkout@v4
- name: Check for pre-built binary
run: |
if [[ -f "${LIB_SUMS_PATH}" ]]; then
echo "TEST_BIN_LIB=true" >>"${GITHUB_ENV}"
rm -f "$(rustup which cargo)"
else
echo "TEST_BIN_LIB=false" >>"${GITHUB_ENV}"
fi
- uses: r-lib/actions/setup-pandoc@v2
if: env.TEST_BIN_LIB == 'true'
- uses: r-lib/actions/setup-r@v2
if: env.TEST_BIN_LIB == 'true'
with:
r-version: ${{ matrix.r }}
use-public-rspm: true
Ncpus: "2"
- uses: r-lib/actions/setup-r-dependencies@v2
if: env.TEST_BIN_LIB == 'true'
with:
extra-packages: any::testthat, any::remotes
needs: check
- name: Install with pre-built binary
if: env.TEST_BIN_LIB == 'true'
shell: Rscript {0}
run: |
remotes::install_local(force = TRUE)
testthat::test_dir("tests")