Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dfeshiny 0.5.2 update #103

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/automated-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ jobs:
- name: Install git2r dependencies
run: sudo apt-get install -y libgit2-dev

- name: Install proj library (terra depdencies)
run: sudo apt-get install libproj-dev

- name: Install gdal library (terra dependencies)
run: sudo apt-get install libgdal-dev

- name: Install udunits library (units dependencies)
run: sudo apt-get install libudunits2-dev

- name: Cache renv packages
id: cache-renv
uses: actions/cache@v4
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/deploy-shiny.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@ on:
branches:
- main
- development
pull_request:
branches:
- main
- development

name: shinyapps.io deploy

jobs:
deployShiny:
runs-on: ubuntu-latest

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

Expand All @@ -18,6 +22,7 @@ jobs:

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

- name: Set env vars (dev)
Expand All @@ -30,7 +35,7 @@ jobs:
run: |
echo "SHINYAPP_NAME='dfe-shiny-template'">> $GITHUB_ENV
echo "SHINYAPP_OVERFLOW_NAME='dfe-shiny-template-overflow'">> $GITHUB_ENV

- name: Restore renv snapshot
shell: Rscript {0}
run: |
Expand All @@ -48,6 +53,7 @@ jobs:
# Get in touch with the Explore education statistics platforms team if you need to add the below secrets to publish to shinyapps.io

- name: Push to shiny.io
if: github.event_name != 'pull_request'
run: >
Rscript
-e "rsconnect::setAccountInfo(name = 'department-for-education', token = '${{secrets.SHINYAPPS_TOKEN}}', secret = '${{secrets.SHINYAPPS_SECRET}}')"
Expand Down
64 changes: 64 additions & 0 deletions .github/workflows/tidyCode.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
on:
push:
branches:
- main
pull_request:

name: tidyCode

jobs:
tidyCode:
runs-on: ubuntu-latest

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

steps:
- uses: actions/checkout@v4

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

- name: Install git2r dependencies
run: sudo apt-get install -y libgit2-dev

- name: Install proj library (terra depdencies)
run: sudo apt-get install libproj-dev

- name: Install gdal library (terra dependencies)
run: sudo apt-get install libgdal-dev

- name: Install udunits library (units dependencies)
run: sudo apt-get install libudunits2-dev

- name: Restore renv snapshot
shell: Rscript {0}
run: |
if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv")
renv::restore()

- name: Tidy code
shell: Rscript {0}
run: |
codeChecks <- dfeshiny::tidy_code()

if(any(is.na(codeChecks))) {
stop("There is a breaking error in the code.")
} else {
if(TRUE %in% codeChecks) {
stop("The code is not styled correctly. Open the project in RStudio and use tidy_code() to restyle the code.")
} else {
message("----------------------------------------")
message("The code is beautiful, go you!")
message("----------------------------------------")
}
}

- name: Upload test results
if: failure()
uses: actions/upload-artifact@master
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-tests
path: tests
Loading
Loading