-
Notifications
You must be signed in to change notification settings - Fork 0
149 lines (126 loc) · 4.51 KB
/
pkgdown.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
on:
push:
branches:
- master
- main
- "docs*"
- "cran-*"
- "r-*"
tags:
- "v*"
pull_request:
branches:
- main
- master
- "r-*"
schedule:
- cron: '20 0 * * *'
name: pkgdown
jobs:
pkgdown:
runs-on: ubuntu-18.04
# Begin custom: services
# End custom: services
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
# prevent rgl issues because no X11 display is available
RGL_USE_NULL: true
# Begin custom: env vars
# End custom: env vars
steps:
- name: Check rate limits
run: |
curl -s --header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/rate_limit
shell: bash
- uses: actions/checkout@v2
- name: Install pkgdown sysdeps
if: runner.os == 'Linux'
env:
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
run: |
# Needed because of install-r: false
sudo apt-get update
# For some reason harfbuzz and gert are installed from source and needs this
sudo apt-get install -y libharfbuzz-dev libfribidi-dev libgit2-dev
- name: Configure Git identity
if: github.event_name == 'push'
run: |
env | sort
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
shell: bash
# Begin custom: before install
# End custom: before install
- uses: r-lib/actions/setup-r@v1
with:
install-r: false
- uses: r-lib/actions/setup-pandoc@v1
- name: Install remotes
run: |
if (!requireNamespace("curl", quietly = TRUE)) install.packages("curl")
if (!requireNamespace("remotes", quietly = TRUE)) install.packages("remotes")
shell: Rscript {0}
- name: Query dependencies
if: runner.os != 'Windows'
run: |
saveRDS(remotes::dev_package_deps(dependencies = TRUE, type = .Platform$pkgType), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}
- name: Restore R package cache
if: runner.os != 'Windows'
uses: actions/cache@v2
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 system dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update -y
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'req <- remotes::system_requirements("ubuntu", "18.04"); if (length(req) > 0) cat(req, sep = "\n")')
- name: Add fake qpdf and checkbashisms
if: runner.os == 'Linux'
run: |
sudo ln -s $(which true) /usr/local/bin/qpdf
sudo ln -s $(which true) /usr/local/bin/checkbashisms
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE, type = .Platform$pkgType)
remotes::install_github("r-lib/pkgdown")
# Begin custom: dep install
remotes::install_github("tidyverse/tidytemplate")
# End custom: dep install
shell: Rscript {0}
# Begin custom: install
# End custom: install
- name: Session info
run: |
options(width = 100)
if (!requireNamespace("sessioninfo", quietly = TRUE)) install.packages("sessioninfo")
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}
# Begin custom: after install
# End custom: after install
- name: Install package
run: R CMD INSTALL . --with-keep.source --with-keep.parse.data
- name: Deploy package
if: github.event_name == 'push'
run: |
pkgdown::deploy_to_branch(new_process = FALSE)
shell: Rscript {0}
- name: Build site
if: github.event_name != 'push'
run: |
pkgdown::build_site()
shell: Rscript {0}
- name: Check rate limits
if: always()
run: |
curl -s --header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/rate_limit
shell: bash