Skip to content

Updating with data for 6th Feb publication #336

Updating with data for 6th Feb publication

Updating with data for 6th Feb publication #336

Workflow file for this run

on:
push:
branches:
- main
pull_request:
name: tidyCode
jobs:
tidyCode:
runs-on: ubuntu-latest
container:
image: ghcr.io/dfe-analytical-services/dfe-r-base:latest
options: --user root
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- 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: |
source("global.R")
codeChecks <- 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