Skip to content

Commit 6d05817

Browse files
authored
🔨 R-universe tests (#48)
* See PR #48 for more details.
1 parent ba075eb commit 6d05817

5 files changed

Lines changed: 125 additions & 0 deletions

File tree

.github/workflows/r-universe.yaml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
## this workflow is primarily meant
2+
## for testing against CRAN-systems and
3+
## not for aligning against r-universe.
4+
name: Test R-universe
5+
6+
on:
7+
push:
8+
branches: [devel]
9+
pull_request:
10+
branches: [devel]
11+
12+
## the permission has to be
13+
## set to write so we are allowed
14+
## to create a new branch
15+
permissions:
16+
contents: write
17+
18+
## this section is important
19+
## for this workflow - the
20+
## branch it works off of is
21+
## fixed, so if there is multiple pushes
22+
## it will cancel the old ones
23+
concurrency:
24+
group: r-universe-check
25+
cancel-in-progress: true
26+
27+
jobs:
28+
## r-universe builds directly from
29+
## the repository its being run from
30+
## without modifictions to the actual runs.
31+
## this means that untracked .Rd files never
32+
## enters the build/check - to mitigate this
33+
## we create a temporary branch where the .Rd
34+
## files are pushed, and let r-universe build
35+
## and test from there
36+
create-branch:
37+
name: Temporary branch creation
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v4
41+
with:
42+
persist-credentials: true
43+
44+
- name: Create and push r-universe/check-pkg
45+
run: |
46+
set -euo pipefail
47+
git config user.name "github-actions[bot]"
48+
git config user.email "github-actions[bot]@users.noreply.github.com"
49+
git checkout -B r-universe/check-pkg
50+
git push --force origin r-universe/check-pkg
51+
52+
## this step builds and pushes
53+
## the documentation to the temporary branch
54+
render-documentation:
55+
needs: create-branch
56+
name: Render documentation and NAMESPACE
57+
runs-on: ubuntu-latest
58+
59+
env:
60+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
61+
62+
outputs:
63+
sha: ${{ steps.push.outputs.sha }}
64+
65+
steps:
66+
- uses: actions/checkout@v4
67+
with:
68+
ref: r-universe/check-pkg
69+
submodules: recursive
70+
persist-credentials: true
71+
72+
- uses: r-lib/actions/setup-r@v2
73+
with:
74+
r-version: release
75+
use-public-rspm: true
76+
77+
- uses: r-lib/actions/setup-r-dependencies@v2
78+
with:
79+
extra-packages: any::devtools any::roxygen2
80+
needs: check
81+
82+
- name: Render documentation and NAMESPACE
83+
run: devtools::document()
84+
shell: Rscript {0}
85+
86+
- name: Commit rendered docs and push
87+
id: push
88+
run: |
89+
set -euo pipefail
90+
git config user.name "github-actions[bot]"
91+
git config user.email "github-actions[bot]@users.noreply.github.com"
92+
git add -f man/ NAMESPACE
93+
git commit --allow-empty -m "CI/CD: render documentation for r-universe build"
94+
git push origin r-universe/check-pkg
95+
echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
96+
97+
build:
98+
needs: render-documentation
99+
name: R-universe testing
100+
uses: r-universe-org/workflows/.github/workflows/build.yml@v3
101+
with:
102+
universe: ${{ github.repository_owner }}
103+
ref: ${{ needs.render-documentation.outputs.sha }}
104+
105+
cleanup:
106+
needs: [render-documentation, build]
107+
if: always()
108+
runs-on: ubuntu-latest
109+
steps:
110+
- uses: actions/checkout@v4
111+
- name: Delete temporary branch
112+
run: git push origin --delete r-universe/check-pkg || true

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<!-- badges: start -->
77

88
[![R-CMD-check](https://github.com/serkor1/ta-lib-R/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/serkor1/ta-lib-R/actions/workflows/R-CMD-check.yaml)
9+
[![Test
10+
R-universe](https://github.com/serkor1/ta-lib-R/actions/workflows/r-universe.yaml/badge.svg)](https://github.com/serkor1/ta-lib-R/actions/workflows/r-universe.yaml)
911
[![Remote
1012
Install](https://github.com/serkor1/ta-lib-R/actions/workflows/remote-install.yaml/badge.svg)](https://github.com/serkor1/ta-lib-R/actions/workflows/remote-install.yaml)
1113
[![Codecov test

configure

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ for arg in "$@"; do
9595
--force-vendor)
9696
FORCE_VENDOR=1
9797
;;
98+
## autotools-style arguments injected by `emconfigure` (and by other
99+
## cross-compile harnesses) — dropped so they don't leak into
100+
## CMAKE_C_FLAGS and get handed to the compiler as unknown flags.
101+
--build=*|--host=*|--target=*|ac_cv_*=*)
102+
;;
98103
*)
99104
OPTFLAGS="${OPTFLAGS} ${arg}"
100105
;;

configure.win

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ for arg in "$@"; do
2929
echo "{talib} on Windows will always use the vendored TA-Lib source."
3030
echo "Feel free to submit a PR, if you have a solid solution to Windows + {talib} using system/user-installed TA-Lib."
3131
;;
32+
## autotools-style arguments injected by cross-compile harnesses —
33+
## dropped so they don't leak into CMAKE_C_FLAGS as unknown compiler
34+
## flags. Kept parallel with the UNIX `configure` script.
35+
--build=*|--host=*|--target=*|ac_cv_*=*)
36+
;;
3237
*)
3338
OPTFLAGS="${OPTFLAGS} ${arg}"
3439
;;

dev/README.Rmd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ BTC <- tail(talib::BTC, 150)
3737

3838
<!-- badges: start -->
3939
[![R-CMD-check](https://github.com/serkor1/ta-lib-R/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/serkor1/ta-lib-R/actions/workflows/R-CMD-check.yaml)
40+
[![Test R-universe](https://github.com/serkor1/ta-lib-R/actions/workflows/r-universe.yaml/badge.svg)](https://github.com/serkor1/ta-lib-R/actions/workflows/r-universe.yaml)
4041
[![Remote Install](https://github.com/serkor1/ta-lib-R/actions/workflows/remote-install.yaml/badge.svg)](https://github.com/serkor1/ta-lib-R/actions/workflows/remote-install.yaml)
4142
[![Codecov test coverage](https://codecov.io/gh/serkor1/ta-lib-R/graph/badge.svg)](https://app.codecov.io/gh/serkor1/ta-lib-R)
4243
[![CRAN status](https://www.r-pkg.org/badges/version/talib)](https://CRAN.R-project.org/package=talib)

0 commit comments

Comments
 (0)