Skip to content

Commit

Permalink
add shinytest2 for testing run example and draft yaml for deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
cjrace committed Dec 11, 2024
1 parent 3ddc104 commit ffa5d7a
Show file tree
Hide file tree
Showing 6 changed files with 428 additions and 383 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
^pkgdown$
^\.github$
^LICENSE\.md$
_\.new\.png$
38 changes: 38 additions & 0 deletions .github/workflows/showcase-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
on:
push:
branches:
- main

name: Showcase app deploy

jobs:
deployShiny:
runs-on: ubuntu-latest

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- name: Load package
shell: Rscript {0}
run: |
devtools::load_all()
- name: Install rsconnect
shell: Rscript {0}
run: |
if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv")
renv::install("rsconnect")
- name: Push to shinyapps.io
run: >
Rscript
-e "rsconnect::setAccountInfo(name = 'department-for-education', token = '${{secrets.SHINYAPPS_TOKEN}}', secret = '${{secrets.SHINYAPPS_SECRET}}')"
-e "shiny_app <- run_example()"
-e "rsconnect::deployApp(shiny_app, forceUpdate = TRUE)"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
.RData
.DS_Store
docs/
# {shinytest2}: Ignore new debug snapshots for `$expect_values()`
*_.new.png
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Imports:
shinyjs,
stringr
Suggests:
testthat
testthat,
shinytest2
Encoding: UTF-8
RoxygenNote: 7.3.2
Loading

0 comments on commit ffa5d7a

Please sign in to comment.