Skip to content

Mewu/app build

Mewu/app build #3

Workflow file for this run

name: R Shiny CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-and-test:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
r-version: '4.2'
- name: Install R packages
run: Rscript install_packages.R
- name: Start Shiny App in Background
run: |
$RScript = {R -e "shiny::runApp(port=3838)"}
Start-Job -ScriptBlock $RScript
Start-Sleep -Seconds 10 # Wait a bit to ensure the app has started
shell: pwsh
- name: Check if Shiny App is Up
run: |
$response = (Invoke-WebRequest -Uri http://localhost:3838 -UseBasicParsing).StatusCode
if ($response -eq 200) {
Write-Host "Shiny app is up and running."
} else {
Write-Error "Shiny app is not responding as expected."
exit 1
}
shell: pwsh
- name: Stop Shiny App
run: |
$RScript = {R -e "shiny::stopApp()"}
Start-Job -ScriptBlock $RScript
shell: pwsh
env:
GITHUB_PAT: ${{ secrets.GIT_TOKEN }}