-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (51 loc) · 1.71 KB
/
Copy pathR.yml
File metadata and controls
62 lines (51 loc) · 1.71 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
# -----------------------------------------------------------------------------
# GitHub Actions Workflow for an R Package
# -----------------------------------------------------------------------------
name: R Package Check
# TRIGGERS
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
R-CMD-check:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
r-version: ['release', 'devel']
# 'steps' are a sequence of tasks that will be executed as part of the job.
steps:
# Step 1: Check out the repository code
- name: Check out repository
uses: actions/checkout@v4
# Step 2: Set up the R environment
- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.r-version }}
# Step 3: Install system dependencies (Linux only)
- name: Install system dependencies
# This 'if' condition ensures the step only runs on the Ubuntu runner
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y liblbfgs-dev
# Step 4: Install the R package dependencies
- name: Install dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: |
any::rcmdcheck
cache-version: 6
# Step 5: Install LaTeX for PDF documentation
- name: Install LaTeX
uses: r-lib/actions/setup-tinytex@v2
# Step 6: Run the R CMD Check
- name: Check package
run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error")
shell: Rscript {0}