Add test file for fimsfit using pollock #5
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: Run pollock tests | |
on: | |
workflow_dispatch: | |
push: | |
jobs: | |
build-deploy: | |
runs-on: macos-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v2 | |
- name: Set up R (needed for Rmd) | |
uses: r-lib/actions/setup-r@v2 | |
- name: Run pollock tests | |
run: | | |
# Names of required packages | |
packages <- c("dplyr", "tidyr", "ggplot2", "TMB", "reshape2", "here", "devtools", "lubridate") | |
# Install packages not yet installed | |
installed_packages <- packages %in% rownames(installed.packages()) | |
if (any(installed_packages == FALSE)) { | |
install.packages(packages[!installed_packages], repos = "http://cran.us.r-project.org") | |
} | |
# install.packages("FIMS", repos = c("https://noaa-fims.r-universe.dev", "https://cloud.r-project.org")) | |
devtools::install_github("NOAA-FIMS/FIMS") | |
# Load packages | |
invisible(lapply(packages, library, character.only = TRUE)) | |
source(file.path(getwd(), "content", "run_pollock_tests.R")) | |
shell: Rscript {0} |