-
Notifications
You must be signed in to change notification settings - Fork 79
134 lines (107 loc) · 3.9 KB
/
build.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
on: [push, pull_request]
name: build
permissions:
contents: write
deployments: write
statuses: write
jobs:
build-r:
runs-on: ${{ matrix.config.os }}
name: 'R: ${{ matrix.config.r }} (${{ matrix.config.os }})'
strategy:
fail-fast: false
matrix:
config:
- { os: macOS-latest, r: 'release' }
- { os: windows-latest, r: 'release' }
- { os: windows-latest, r: 'oldrel' }
- { os: ubuntu-20.04, r: 'devel', http-user-agent: 'release' }
- { os: ubuntu-20.04, r: 'release', release: true }
- { os: ubuntu-20.04, r: 'oldrel-1' }
- { os: ubuntu-20.04, r: 'oldrel-2' }
- { os: ubuntu-20.04, r: 'oldrel-3' }
- { os: ubuntu-20.04, r: 'oldrel-4' }
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
steps:
- uses: actions/checkout@v3
- 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
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: |
any::rcmdcheck
- uses: r-lib/actions/check-r-package@v2
- name: Test coverage
if: matrix.config.release
run: covr::codecov(quiet = FALSE)
shell: Rscript {0}
- name: Install pkgdown dependencies
if: matrix.config.release
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: local::., [email protected]
# Install Quarto for pkgdown Quarto vignettes
# https://pkgdown.r-lib.org/articles/quarto.html#github-actions
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
- name: Build pkgdown site
if: matrix.config.release
run: Rscript pkgdown/build-docs.R
- name: Set Netlify alias
if: matrix.config.release
run: |
version="v$(cat DESCRIPTION | grep Version: | cut -d' ' -f2)"
# Netlify aliases can't have periods, so replace them with dashes
version_alias=${version//./-}
if [ "$GITHUB_REF" = "refs/heads/$version" ]; then
echo "NETLIFY_ALIAS=$version_alias" >> $GITHUB_ENV
else
github_sha_short=$(echo $GITHUB_SHA | cut -c 1-7)
echo "NETLIFY_ALIAS=${version_alias}-${github_sha_short}" >> $GITHUB_ENV
fi
- name: Deploy pkgdown site to Netlify
if: matrix.config.release
uses: nwtgck/[email protected]
with:
publish-dir: './docs'
github-token: ${{ secrets.GITHUB_TOKEN }}
alias: ${{ env.NETLIFY_ALIAS }}
deploy-message: 'Deploy from GitHub Actions: ${{ github.ref }} (${{ github.sha }})'
enable-pull-request-comment: false
enable-commit-comment: false
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 1
- name: Rebuild pkgdown site search index for GitHub Pages
if: matrix.config.release && github.ref == 'refs/heads/main'
run: Rscript pkgdown/build-search-gh.R
- name: Deploy pkgdown site to GitHub Pages
if: matrix.config.release && github.ref == 'refs/heads/main'
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: docs
build-node:
runs-on: ubuntu-latest
name: Node.js
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Test
run: npm run test:cover
- name: Lint
run: npm run lint
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3