forked from litalbarkai/open-redatam
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (66 loc) · 2.78 KB
/
build-rpkg.yml
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
# 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]
pull_request:
branches: [main]
name: R package
permissions: read-all
jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.name }}
strategy:
fail-fast: false
matrix:
config:
- {os: macos-13, r: 'release', name: 'macos-13-r-release'}
- {os: macos-14, r: 'release', name: 'macos-14-r-release'}
- {os: ubuntu-latest, r: 'release', name: 'ubuntu-latest-r-release'}
- {os: windows-latest, r: 'release', name: 'windows-latest-r-release'}
- {os: ubuntu-latest, r: 'devel', name: 'ubuntu-latest-r-devel'}
- {os: windows-latest, r: 'devel', name: 'windows-latest-r-devel'}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pandoc
uses: r-lib/actions/setup-pandoc@v2
- name: Setup R
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
- name: Restore R package cache
uses: actions/cache@v4
with:
path: ~/.cache/R
key: ${{ runner.os }}-r-${{ matrix.config.r }}-cache
- name: Install libpng (macOS)
if: matrix.config.os == 'macos-14' && matrix.config.r == 'devel'
run: |
curl -LO https://mac.r-project.org/bin/darwin20/arm64/libpng-1.6.38-darwin.20-arm64.tar.xz
sudo tar -xvf libpng-1.6.38-darwin.20-arm64.tar.xz -C /
echo "PKG_CONFIG_PATH=/opt/R/arm64/lib/pkgconfig" >> $GITHUB_ENV
- name: Install dependencies
run: |
Rscript -e 'if (!requireNamespace("pak", quietly = TRUE)) { install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/") }'
Rscript -e 'pak::pkg_install("decor", dependencies = TRUE)'
Rscript -e 'pak::pkg_install("rcmdcheck", dependencies = TRUE)'
Rscript -e 'pak::pkg_install("pkgbuild", dependencies = TRUE)'
Rscript -e 'pak::pkg_install(".", dependencies = TRUE)'
working-directory: ./rpkg
- name: Check
run: |
Rscript -e 'pkgbuild::check_build_tools(debug = TRUE)'
Rscript -e 'rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), build_args = "--no-manual", error_on = "error")'
working-directory: ./rpkg
- name: Save R package cache
uses: actions/cache@v4
with:
path: ~/.cache/R
key: ${{ runner.os }}-r-${{ matrix.config.r }}-cache