Skip to content

Commit 364dfea

Browse files
committed
CI
1 parent 9b40740 commit 364dfea

2 files changed

Lines changed: 116 additions & 45 deletions

File tree

.github/workflows/R-CMD-check.yml

Lines changed: 21 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -18,58 +18,34 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
config:
21-
- {os: windows-latest, r: 'release'}
22-
- {os: macOS-latest, r: 'release'}
23-
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
21+
- {os: macos-latest, r: 'release'}
22+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
23+
- {os: ubuntu-latest, r: 'release'}
24+
- {os: ubuntu-latest, r: 'oldrel'}
25+
- {os: ubuntu-latest, r: 'oldrel-1'}
26+
- {os: ubuntu-latest, r: 'oldrel-2'}
27+
- {os: ubuntu-latest, r: 'oldrel-3'}
2428

2529
env:
2630
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
27-
CRAN: ${{ matrix.config.cran }}
28-
31+
RSPM: ${{ matrix.config.rspm }}
32+
GITHUB_PAT: ${{ secrets.PAT }}
2933
steps:
30-
- uses: actions/checkout@v2
31-
- uses: r-lib/actions/setup-r@master
34+
- uses: actions/checkout@v3
35+
36+
- uses: r-lib/actions/setup-pandoc@v2
37+
38+
- uses: r-lib/actions/setup-r@v2
3239
with:
3340
r-version: ${{ matrix.config.r }}
34-
- uses: r-lib/actions/setup-pandoc@master
35-
36-
- uses: r-lib/actions/setup-r-dependencies@v1
37-
with:
38-
extra-packages: rcmdcheck
41+
http-user-agent: ${{ matrix.config.http-user-agent }}
42+
use-public-rspm: true
3943

40-
- name: Cache R packages
41-
if: runner.os != 'Windows'
42-
uses: actions/cache@v1
44+
- uses: r-lib/actions/setup-r-dependencies@v2
4345
with:
44-
path: ${{ env.R_LIBS_USER }}
45-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
46-
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
47-
48-
- name: Install dependencies
49-
run: |
50-
install.packages("tokenizers.bpe")
51-
install.packages("word2vec")
52-
install.packages("uwot")
53-
install.packages("dbscan")
54-
install.packages("udpipe")
55-
shell: Rscript {0}
56-
57-
- name: Session info
58-
run: |
59-
options(width = 100)
60-
pkgs <- installed.packages()
61-
pkgs[, c("Version"), drop = FALSE]
62-
shell: Rscript {0}
63-
64-
- name: Check
65-
env:
66-
_R_CHECK_CRAN_INCOMING_REMOTE_: false
67-
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran", "--no-multiarch"), error_on = "warning", check_dir = "check")
68-
shell: Rscript {0}
46+
extra-packages: any::rcmdcheck
47+
needs: check
6948

70-
- name: Upload check results
71-
if: failure()
72-
uses: actions/upload-artifact@master
49+
- uses: r-lib/actions/check-r-package@v2
7350
with:
74-
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
75-
path: check
51+
upload-snapshots: true

.github/workflows/rhub.yaml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# R-hub's generic GitHub Actions workflow file. It's canonical location is at
2+
# https://github.com/r-hub/actions/blob/v1/workflows/rhub.yaml
3+
# You can update this file to a newer version using the rhub2 package:
4+
#
5+
# rhub::rhub_setup()
6+
#
7+
# It is unlikely that you need to modify this file manually.
8+
9+
name: R-hub
10+
run-name: "${{ github.event.inputs.id }}: ${{ github.event.inputs.name || format('Manually run by {0}', github.triggering_actor) }}"
11+
12+
on:
13+
workflow_dispatch:
14+
inputs:
15+
config:
16+
description: 'A comma separated list of R-hub platforms to use.'
17+
type: string
18+
default: 'linux,windows,macos,clang-asan,clang-ubsan,gcc-asan,nold,rchk,ubuntu-clang,valgrind'
19+
name:
20+
description: 'Run name. You can leave this empty now.'
21+
type: string
22+
id:
23+
description: 'Unique ID. You can leave this empty now.'
24+
type: string
25+
26+
jobs:
27+
28+
setup:
29+
runs-on: ubuntu-latest
30+
outputs:
31+
containers: ${{ steps.rhub-setup.outputs.containers }}
32+
platforms: ${{ steps.rhub-setup.outputs.platforms }}
33+
34+
steps:
35+
# NO NEED TO CHECKOUT HERE
36+
- uses: r-hub/actions/setup@v1
37+
with:
38+
config: ${{ github.event.inputs.config }}
39+
id: rhub-setup
40+
41+
linux-containers:
42+
needs: setup
43+
if: ${{ needs.setup.outputs.containers != '[]' }}
44+
runs-on: ubuntu-latest
45+
name: ${{ matrix.config.label }}
46+
strategy:
47+
fail-fast: false
48+
matrix:
49+
config: ${{ fromJson(needs.setup.outputs.containers) }}
50+
container:
51+
image: ${{ matrix.config.container }}
52+
53+
steps:
54+
- uses: r-hub/actions/checkout@v1
55+
- uses: r-hub/actions/platform-info@v1
56+
with:
57+
token: ${{ secrets.RHUB_TOKEN }}
58+
job-config: ${{ matrix.config.job-config }}
59+
- uses: r-hub/actions/setup-deps@v1
60+
with:
61+
token: ${{ secrets.RHUB_TOKEN }}
62+
job-config: ${{ matrix.config.job-config }}
63+
- uses: r-hub/actions/run-check@v1
64+
with:
65+
token: ${{ secrets.RHUB_TOKEN }}
66+
job-config: ${{ matrix.config.job-config }}
67+
68+
other-platforms:
69+
needs: setup
70+
if: ${{ needs.setup.outputs.platforms != '[]' }}
71+
runs-on: ${{ matrix.config.os }}
72+
name: ${{ matrix.config.label }}
73+
strategy:
74+
fail-fast: false
75+
matrix:
76+
config: ${{ fromJson(needs.setup.outputs.platforms) }}
77+
78+
steps:
79+
- uses: r-hub/actions/checkout@v1
80+
- uses: r-hub/actions/setup-r@v1
81+
with:
82+
job-config: ${{ matrix.config.job-config }}
83+
token: ${{ secrets.RHUB_TOKEN }}
84+
- uses: r-hub/actions/platform-info@v1
85+
with:
86+
token: ${{ secrets.RHUB_TOKEN }}
87+
job-config: ${{ matrix.config.job-config }}
88+
- uses: r-hub/actions/setup-deps@v1
89+
with:
90+
job-config: ${{ matrix.config.job-config }}
91+
token: ${{ secrets.RHUB_TOKEN }}
92+
- uses: r-hub/actions/run-check@v1
93+
with:
94+
job-config: ${{ matrix.config.job-config }}
95+
token: ${{ secrets.RHUB_TOKEN }}

0 commit comments

Comments
 (0)