Skip to content

Commit

Permalink
Merge pull request #16 from dfe-analytical-services/development
Browse files Browse the repository at this point in the history
Updating the dashboard with the provisional 2024 data
  • Loading branch information
rmbielby authored Dec 5, 2024
2 parents 18f8503 + 7cbee42 commit f32f20d
Show file tree
Hide file tree
Showing 52 changed files with 4,512 additions and 1,225 deletions.
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()
43 changes: 10 additions & 33 deletions .github/workflows/deploy-shiny.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,60 +3,37 @@ on:
branches:
- main
- development
pull_request:

name: deploy-shiny

jobs:
deployShiny:
runs-on: ${{ matrix.config.os }}

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

strategy:
fail-fast: false
matrix:
config:
# Running on mac as it's quicker to build
- {os: macOS-latest, r: 'release'}
runs-on: ubuntu-latest

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
RENV_PATHS_ROOT: ~/.local/share/renv
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

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)
if: endsWith(github.ref, '/development')
run: |
echo "SHINYAPP_NAME='dev-KS4-ready-reckoners'" >> $GITHUB_ENV
echo "SHINYAPP_NAME='dev-ks4-transition-matrices'" >> $GITHUB_ENV
- name: Set env vars (prod)
if: endsWith(github.ref, '/main')
run: |
echo "SHINYAPP_NAME='KS4-transition-matrices'">> $GITHUB_ENV
echo "SHINYAPP_NAME='ks4-transition-matrices'">> $GITHUB_ENV
- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v1
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: Install git2r dependencies
run: sudo apt-get install -y libgit2-dev

- 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 @@ -74,8 +51,8 @@ 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}}')"
-e "rsconnect::deployApp(appName=${{env.SHINYAPP_NAME}}, forceUpdate = TRUE)"
64 changes: 0 additions & 64 deletions .github/workflows/shiny-tests.yaml

This file was deleted.

37 changes: 6 additions & 31 deletions .github/workflows/tidyCode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,45 +8,22 @@ name: tidyCode

jobs:
tidyCode:
runs-on: ${{ matrix.config.os }}

name: tidycode

strategy:
fail-fast: false
matrix:
config:
# Running on mac as it's quicker to build
- {os: macOS-latest, r: 'release'}
runs-on: ubuntu-latest

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
RENV_PATHS_ROOT: ~/.local/share/renv
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

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

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

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v1
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: Install git2r dependencies
run: sudo apt-get install -y libgit2-dev

- 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 @@ -56,8 +33,6 @@ jobs:
- name: Tidy code
shell: Rscript {0}
run: |
source("global.R")
codeChecks <- dfeshiny::tidy_code()
if(any(is.na(codeChecks))) {
Expand Down
Loading

0 comments on commit f32f20d

Please sign in to comment.