Change file to Rmd #134
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
# Download the stock synthesis executable, then Run r cmd check | |
# Name of the workflow, which will be what it is called under the "actions" tab | |
name: r-cmd-check | |
# on specifies the build triggers. Learn more at https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows | |
on: | |
# The schedule build trigger runs the workflow at a scheduled time. | |
schedule: | |
# This should run the default branch (typically main) weekly on sunday at 2:45am UTC | |
- cron: '01 3 * * 2' | |
# The workflow_dispatch build trigger adds a button so that you can start workflows manually. | |
workflow_dispatch: | |
# The push build trigger runs jobs when new commits are pushed up to github. | |
push: | |
# specifying branches means the workflow will only run on pushes to the branches listed, in this case, only main | |
branches: | |
- main | |
- r4ss_1.50.0 | |
# The pull_request build trigger runs jobs when a pull request is made or commits are pushed to the pull request. | |
pull_request: | |
# specifying branches means the workflow will only run when the pull request is to the merge into the branch listed, in this case, main. | |
branches: | |
- main | |
# jobs specifies the jobs to run. you can have multiple jobs per github actions workflow, but in this case we have only one, which is | |
# named run-R-CMD-check. | |
jobs: | |
run-R-CMD-check: | |
# the operating system to run on | |
runs-on: 'ubuntu-latest' | |
strategy: | |
fail-fast: false | |
# environment settings, needed for running r (first 2 settings) and downloading from github (GITHUB_PAT) | |
env: | |
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout github repository, in this case nwfscDiags | |
uses: actions/checkout@v3 | |
- name: Set up R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: 'release' | |
- name: Setup pandoc, in case of vignettes in the R package | |
uses: r-lib/actions/setup-pandoc@v2 | |
- name: Setup R packages | |
uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
extra-packages: any::rcmdcheck | |
needs: check | |
- name: Get the latest SS3 executable and move to expected location | |
run: | | |
wget -O ss3 https://github.com/nmfs-ost/ss3-source-code/releases/latest/download/ss3_linux | |
sudo chmod a+x ss3 | |
cp ss3 inst/extdata/simple_small/ss3 | |
rm ss3 | |
- name: run r-cmd-check using R | |
env: | |
_R_CHECK_CRAN_INCOMING_REMOTE_: false | |
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "error", check_dir = "check") | |
shell: Rscript {0} | |
- name: Show testthat output | |
if: always() | |
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true | |
shell: bash | |
- name: Upload check results | |
if: failure() | |
uses: actions/upload-artifact@main | |
with: | |
name: 'linux-release-results' | |
path: check |