-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (62 loc) · 2.21 KB
/
roxygen.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
---
name: Roxygen 📄
on:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
branches:
- main
push:
branches:
- main
workflow_call:
concurrency:
group: roxygen-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
roxygen:
name: ${{ vars.CI_IMAGE }}
runs-on: ubuntu-latest
container:
image: ${{ vars.CI_IMAGE }}
steps:
- name: Checkout project ⬇️
uses: actions/checkout@v4
with:
path: ${{ github.event.repository.name }}
- name: Install package dependencies 📄
run: |
if (file.exists("dependencies.yml")) {
repos <- yaml::yaml.load(readLines("dependencies.yml"))$dependencies |>
sapply(function(x) x$repo)
if(repos |> length() > 0) {
repos |>
pak::pak(dependencies = TRUE, ask = FALSE, upgrade = FALSE)
}
}
shell: Rscript {0}
working-directory: ${{ github.event.repository.name }}
- name: Generate man pages 📄
run: |
Rscript -e 'roxygen2::roxygenize()'
if [[ -n $(git status -s | grep -E "man|DESCRIPTION") ]]
then
ROXYGEN_VERSION="$(Rscript -e 'packageVersion("roxygen2")' | awk '{print $NF}')"
echo "⚠️ Manuals are not up-to-date with roxygen comments!"
echo "Here are the differences:"
git diff man/* DESCRIPTION
echo -e "\n Please rerun the following command on your workstation and push your changes"
echo "--------------------------------------------------------------------"
echo "roxygen2::roxygenize('.')"
echo "--------------------------------------------------------------------"
echo "ℹ️ roxygen2 version that was used in this workflow: $ROXYGEN_VERSION"
echo "Please ensure that the 'RoxygenNote' field in the DESCRIPTION file matches this version"
exit 1
else
echo "👍 Manuals are up-to-date with roxygen comments"
fi
shell: bash
working-directory: ${{ github.event.repository.name }}