Skip to content

Commit

Permalink
Merge pull request #19 from dfe-analytical-services/dev-ks5-timeserie…
Browse files Browse the repository at this point in the history
…s-attainment-and-single-year-entries

Data update 2024
  • Loading branch information
rmbielby authored Nov 28, 2024
2 parents ff8df26 + 5732fe6 commit 89d6101
Show file tree
Hide file tree
Showing 39 changed files with 3,983 additions and 2,820 deletions.
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:
- {os: macOS-latest, r: 'release'}

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
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@
.Rhistory
.RData
.Ruserdata


Loading

0 comments on commit 89d6101

Please sign in to comment.