-
Notifications
You must be signed in to change notification settings - Fork 17
126 lines (109 loc) · 3.78 KB
/
R-CMD-check.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
# Workflow derived from https://github.com/rstudio/shiny-workflows
#
# NOTE: This Shiny team GHA workflow is overkill for most R packages.
# For most R packages it is better to use https://github.com/r-lib/actions
on:
push:
branches: [main, rc-**]
pull_request:
branches: [main]
schedule:
- cron: "0 9 * * 1" # every monday
name: Package checks
jobs:
website:
uses: rstudio/shiny-workflows/.github/workflows/website.yaml@v1
routine:
uses: rstudio/shiny-workflows/.github/workflows/routine.yaml@v1
R-CMD-check:
uses: rstudio/shiny-workflows/.github/workflows/R-CMD-check.yaml@v1
integration:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Python - 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Upgrade pip
run: |
python -m pip install --upgrade pip
- name: Install py-shinylive
run: |
pip install shinylive
- name: Install assets for py-shinylive
run: |
shinylive assets info
shinylive assets download
shinylive assets info
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
- name: Install quarto-ext/shinylive
shell: bash
run: |
cd local/quarto
quarto add quarto-ext/shinylive --no-prompt
- name: Install R, system dependencies, and package dependencies
uses: rstudio/shiny-workflows/setup-r-package@v1
with:
needs: quarto
- name: Check out 'posit-dev/shinylive' repo into './shinylive_assets'
uses: actions/checkout@v3
with:
repository: posit-dev/shinylive
path: shinylive_assets
- name: Build shinylive assets
shell: bash
run: |
cd shinylive_assets
make submodules
make all
- name: Link shinylive assets
shell: Rscript {0}
run: |
shinylive::assets_install_copy("shinylive_assets")
shinylive::assets_info()
- name: Update lua script for debugging
shell: Rscript {0}
run: |
shinylive_lua <- file.path(
"local", "quarto", "_extensions", "quarto-ext", "shinylive", "shinylive.lua"
)
shinylive_lua |>
brio::read_file() |>
sub(
pattern = "-- print(\"Calling",
replacement = "print(\"Calling",
fixed = TRUE
) |>
sub(
pattern = " local deps = quarto.json.decode(depJson)",
replacement = " print(depJson)\n local deps = quarto.json.decode(depJson)",
fixed = TRUE
) |>
sub(
pattern = " local appDeps = quarto.json.decode(appDepsJson)",
replacement = " print(appDepsJson)\n local appDeps = quarto.json.decode(appDepsJson)",
fixed = TRUE
) |>
brio::write_file(shinylive_lua)
cat(brio::read_file(shinylive_lua),"\n")
- name: Run shinylive R package tests
env:
TEST_ASSETS: "TRUE"
shell: Rscript {0}
run: |
shinylive::assets_info()
dir(shinylive:::assets_cache_dir())
dir(shinylive:::assets_dirs())
as.list(fs::file_info(shinylive:::assets_dirs()))
shinylive::assets_ensure()
testthat::test_local()
# If this (^^) completes, it is a big success!
# Run quarto test after testthat test
- name: Test shinylive quarto extension can build
uses: quarto-dev/quarto-actions/render@v2
with:
path: local/quarto/
# TODO-barret-future; Test the output of the render using pyright / py-shiny e2e controls?