try again with renv lock and caching #8
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Shiny App Startup | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
RENV_PATHS_ROOT: ~/.cache/R/renv | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: r-lib/actions/setup-r@v2 | |
- uses: r-lib/actions/setup-renv@v2 | |
- name: Cache packages | |
uses: actions/cache@v1 | |
with: | |
path: ${{ env.RENV_PATHS_ROOT }} | |
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }} | |
restore-keys: | | |
${{ runner.os }}-renv- | |
- name: Restore packages | |
shell: Rscript {0} | |
run: | | |
if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv") | |
renv::restore() | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v2 | |
- name: Test if Shiny app starts | |
run: | | |
Rscript -e "shiny::runApp('program/shinyApp', launch.browser = FALSE, port = 3838)" | |
sleep 10 # Sleep for 10 seconds to ensure the app has time to start | |
curl http://localhost:3838 |