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

Eesp/workflows maintenance Nov 24 #18

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
b05d0d3
Merge pull request #4 from dfe-analytical-services/dev-ks5-timeseries…
rmbielby Nov 14, 2023
73bde98
Update deploy-shiny.yaml with forceupdate on deploy
rmbielby Nov 14, 2023
36123e2
Update deploy-shiny.yaml with proper capitalisation this time!
rmbielby Nov 14, 2023
5a94709
Merge pull request #8 from dfe-analytical-services/main
rmbielby Nov 17, 2023
418280a
Merge pull request #9 from dfe-analytical-services/dev-ks5-timeseries…
patithomas Jan 30, 2024
9103571
Merge pull request #10 from dfe-analytical-services/dev-ks5-timeserie…
patithomas Jan 30, 2024
a06511b
Merge pull request #12 from dfe-analytical-services/dev-ks5-timeserie…
patithomas Jan 31, 2024
615fed2
Merge pull request #13 from dfe-analytical-services/dev-ks5-timeserie…
patithomas Feb 1, 2024
94c57d2
Merge pull request #14 from dfe-analytical-services/dev-ks5-timeserie…
patithomas Feb 1, 2024
5eaa00b
Merge pull request #17 from dfe-analytical-services/dev-ks5-timeserie…
patithomas Nov 27, 2024
93fe79e
Updating deploy script with latest mods
rmbielby Nov 27, 2024
62800bc
Updated tidy code and shiny tests workflow scripts
rmbielby Nov 27, 2024
eda361a
Updating UI tests to shinytest2
rmbielby Nov 27, 2024
fbf10eb
Added dfeshiny custom disconnect
rmbielby Nov 27, 2024
9bb4eed
Removed references to shinytest from .Rprofile
rmbielby Nov 27, 2024
e9f50af
Removing old disconnect script
rmbielby Nov 27, 2024
c6f806a
Merge branch 'dev-ks5-timeseries-attainment-and-single-year-entries' …
rmbielby Nov 27, 2024
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
18 changes: 0 additions & 18 deletions .Rprofile
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,5 @@ cat("Sourcing .Rprofile.", fill = TRUE)

source("renv/activate.R")

# Function to run tests
run_tests_locally <- function() {
Sys.unsetenv("http_proxy")
Sys.unsetenv("https_proxy")
source("global.r")
# message("================================================================================")
# message("== testthat ====================================================================")
# message("")
# testthat::test_dir("tests/testthat")
# message("")
message("================================================================================")
message("== shinytest ===================================================================")
message("")
shinytest::testApp()
message("")
message("================================================================================")
}

# Install commit-hooks locally
statusWriteCommit <- file.copy(".hooks/pre-commit.R", ".git/hooks/pre-commit", overwrite = TRUE)
42 changes: 42 additions & 0 deletions .github/workflows/automated-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
on:
push:
branches:
- main

pull_request:

name: Automated tests

jobs:
automatedTests:
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: Install git2r dependencies
run: sudo apt-get install -y libgit2-dev

- name: Cache renv packages
id: cache-renv
uses: actions/cache@v4
with:
path: cache-renv
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
restore-keys: |
${{ runner.os }}-renv-

- uses: r-lib/actions/setup-renv@v2

- name: Run tests
shell: Rscript {0}
run: |
shinytest2::test_app()

13 changes: 9 additions & 4 deletions .github/workflows/deploy-shiny.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ on:
branches:
- main
- development
pull_request:
branches:
- main
- development

name: deploy-shiny

Expand All @@ -25,11 +29,11 @@ jobs:
RENV_PATHS_ROOT: ~/.local/share/renv

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

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

- name: Set env vars (dev)
Expand All @@ -45,14 +49,14 @@ jobs:

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Cache renv packages
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ${{ env.RENV_PATHS_ROOT }}
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
Expand All @@ -75,6 +79,7 @@ jobs:
# Get in touch with the Stats Development 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
81 changes: 0 additions & 81 deletions .github/workflows/shiny-tests.yaml

This file was deleted.

17 changes: 3 additions & 14 deletions .github/workflows/tidyCode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
tidyCode:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})
name: tidyCode

strategy:
fail-fast: false
Expand All @@ -26,29 +26,20 @@ jobs:
RENV_PATHS_ROOT: ~/.local/share/renv

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

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

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Cache renv 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 renv snapshot
shell: Rscript {0}
run: |
Expand All @@ -58,8 +49,6 @@ jobs:
- name: Tidy code
shell: Rscript {0}
run: |
source("global.R")

codeChecks <- dfeshiny::tidy_code()

if(any(is.na(codeChecks))) {
Expand Down
74 changes: 0 additions & 74 deletions R/utils.R

This file was deleted.

3 changes: 2 additions & 1 deletion global.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ shhh(library(shiny))
shhh(library(shinyjs))
# shhh(library(tools))
shhh(library(testthat))
shhh(library(shinytest))
shhh(library(shinytest2))
shhh(library(shinydashboard))
shhh(library(shinytitle))
shhh(library(shinyWidgets))
Expand Down Expand Up @@ -102,6 +102,7 @@ appLoadingCSS <- "
}
"

site_title <- "16 to 18 time series attainment and single year entry"
site_primary <- "https://department-for-education.shinyapps.io/ks5-timeseries-attainment-and-single-year-entries/"
site_overflow <- "https://department-for-education.shinyapps.io/ks5-timeseries-attainment-and-single-year-entries-overflow/"
sites_list <- c(site_primary, site_overflow) # We can add further mirrors where necessary. Each one can generally handle about 2,500 users simultaneously
Expand Down
Loading
Loading