attempt pull request CU retrospective forecasts #128
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Hub Submission Validation (R) | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: main | |
paths: | |
- 'model-output/**' | |
- 'model-metadata/*' | |
jobs: | |
validate-submission: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 2 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
install-r: false | |
use-public-rspm: true | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install libcurl4-openssl-dev libv8-dev | |
- name: Cache R packages | |
uses: actions/cache@v2 | |
with: | |
path: ${{ env.R_LIBS_USER }} | |
key: ${{ runner.os }}-r-${{ hashFiles('DESCRIPTION') }} | |
restore-keys: ${{ runner.os }}-r- | |
- name: Install hubUtils from specific branch | |
run: | | |
Rscript -e 'install.packages("remotes")' | |
Rscript -e 'remotes::install_github("kjsato/hubUtils@enhancement/v3-utils", upgrade = "never")' | |
- name: Install hubData from specific branch | |
run: | | |
Rscript -e 'remotes::install_github("kjsato/hubData@feature/handle-samples", upgrade = "never")' | |
- name: Install hubAdmin from specific branch | |
run: | | |
Rscript -e 'remotes::install_github("kjsato/hubAdmin@feature/sample-support", upgrade = "never")' | |
- name: Install HubValidations | |
run: | | |
Rscript -e 'remotes::install_github("kjsato/hubValidations@patch4conversion_origin_date", upgrade = "never")' | |
- name: Run validations | |
env: | |
PR_NUMBER: ${{ github.event.number }} | |
run: | | |
library("hubValidations") | |
v <- hubValidations::validate_pr( | |
gh_repo = Sys.getenv("GITHUB_REPOSITORY"), | |
pr_number = Sys.getenv("PR_NUMBER"), | |
skip_submit_window_check = FALSE | |
) | |
hubValidations::check_for_errors(v) | |
shell: Rscript {0} | |