-
Notifications
You must be signed in to change notification settings - Fork 3
118 lines (108 loc) · 4.31 KB
/
rhub.yaml
File metadata and controls
118 lines (108 loc) · 4.31 KB
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
# GitHub Action workflow for R-hub testing
#
# This file is a heavily-modified version of the generic workflow file generated by
# `rhub::rhub_setup()`. See r-hub documentation for details.
#
# The heavy modifications are to allow installation of NGCHMSupportFiles and
# NGCHMDemoData from the non-standard R-universe repository. (These packages
# are listed ans 'Enhances' and the R-universe repository is listed in the
# "Additional_repositories" field of the DESCRIPTION file.)
name: R-hub
run-name: "${{ github.sha }}: ${{ github.event.inputs.name || format('Manually run by {0}', github.triggering_actor) }}"
on:
workflow_dispatch:
inputs:
config:
description: 'A comma separated list of R-hub platforms to use.'
type: string
default: 'linux,windows,macos'
name:
description: 'Run name. You can leave this empty now.'
type: string
id:
description: 'Unique ID. You can leave this empty now.'
type: string
jobs:
setup:
runs-on: ubuntu-latest
outputs:
containers: ${{ steps.rhub-setup.outputs.containers }}
platforms: ${{ steps.rhub-setup.outputs.platforms }}
steps:
- uses: r-hub/actions/setup@v1
with:
config: ${{ github.event.inputs.config }}
id: rhub-setup
# In r_hub 2.0.0, the linux containers (based on ubuntu and fedora) are used
# to run R CMD CHECK for various versions of R, compilers (e.g. gcc, clang), etc.
linux-containers:
needs: setup
if: ${{ needs.setup.outputs.containers != '[]' }}
runs-on: ubuntu-latest
name: ${{ matrix.config.label }}
strategy:
fail-fast: false
matrix:
config: ${{ fromJson(needs.setup.outputs.containers) }}
container:
image: ${{ matrix.config.container }}
steps:
- uses: r-hub/actions/checkout@v1
# marohrdanz tried all the 'standard' ways to configure this workflow to allow for
# NGCHMDemoData and NGCHMSupportFiles setup from R-universe, but none of them worked here.
# So, using a custom Rprofile to set the repos option explicitly.
# Note (this method doesn't work on Windows, so it is not used in the 'other-platform' job below.
# Instead one of the 'standard' methods is used there.)
- name: Create Rprofile with R-universe repo
run: |
echo 'local({
r <- getOption("repos")
r["CRAN"] <- "https://cloud.r-project.org/"
r["MDA"] <- "https://md-anderson-bioinformatics.r-universe.dev"
options(repos = r)
})' > ~/.Rprofile
- uses: r-hub/actions/platform-info@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
- uses: r-hub/actions/setup-deps@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
- uses: r-hub/actions/run-check@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
# In r_hub 2.0.0, "other-platforms" are linux, macos, macos-arm64, and windows
other-platforms:
needs: setup
if: ${{ needs.setup.outputs.platforms != '[]' }}
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.label }}
strategy:
fail-fast: false
matrix:
config: ${{ fromJson(needs.setup.outputs.platforms) }}
steps:
- uses: r-hub/actions/checkout@v1
- uses: r-hub/actions/setup-r@v1
with:
job-config: ${{ matrix.config.job-config }}
token: ${{ secrets.RHUB_TOKEN }}
# using r-lib action instead of r-hub/actions/setup-r because of need for extra-repositories input
- uses: r-lib/actions/setup-r@v2
with:
extra-repositories: "https://md-anderson-bioinformatics.r-universe.dev"
- uses: r-hub/actions/platform-info@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
# using r-lib action instead of r-hub/actions/setup-deps because of need for extra-repositories above
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck, local::.
needs: check
- uses: r-hub/actions/run-check@v1
with:
job-config: ${{ matrix.config.job-config }}
token: ${{ secrets.RHUB_TOKEN }}