Skip to content

CHG: Dropping r4Casal2 as it's never been working looking at history #151

CHG: Dropping r4Casal2 as it's never been working looking at history

CHG: Dropping r4Casal2 as it's never been working looking at history #151

name: Casal2 validate test suite
on:
push:
branches:
- master # age_length_redesign_202109
pull_request:
branches:
- master ## this will run actions on current branch, to change to main, needed for testing. all branches '*'
## taken from https://keithweaverca.medium.com/only-run-github-actions-on-specific-branches-694782fcc07
## for a release idea linux is fairly easy
## for windows look at this example https://github.com/freenet/wininstaller-innosetup/actions/runs/768471071/workflow
jobs:
Compile-Casal2-Linux:
# should run on linux based operating system
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
runs-on: ubuntu-latest
timeout-minutes: 180
env:
CC: gcc-12
CXX: g++-12
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2.2.2
with:
python-version: '3.8'
- name: Install python dependencies
run: pip install pytz python-dateutil --user --upgrade pip
- name: Install gcc
uses: egor-tensin/setup-gcc@v1
with:
version: 10
platform: x86
- name: Build third-party library - release
run: |
cd BuildSystem
./doBuild.sh thirdparty
- name: Build third-party library - adolc
run: |
cd BuildSystem
./doBuild.sh thirdparty adolc
- name: Build third-party library - betadiff
run: |
cd BuildSystem
./doBuild.sh thirdparty betadiff
- name: Build third-party libraries - boost
run: |
cd BuildSystem
./doBuild.sh thirdparty boost
- name: Build third-party libraries - google test and mock
run: |
cd BuildSystem
./doBuild.sh thirdparty googletest_googlemock
- name: Build third-party libraries - parser
run: |
cd BuildSystem
./doBuild.sh thirdparty parser
- name: Build release library
run: |
cd BuildSystem
export CASAL2_BUILD_THREADS=16
./doBuild.sh library release
- name: Build "Betadiff" library
run: |
cd BuildSystem
export CASAL2_BUILD_THREADS=16
./doBuild.sh library betadiff
- name: Build "ADOL-C" library
run: |
cd BuildSystem
export CASAL2_BUILD_THREADS=16
./doBuild.sh library adolc
- name: Build "Unit Test" library
run: |
cd BuildSystem
export CASAL2_BUILD_THREADS=16
./doBuild.sh library test
- name: Build Frontend
run: |
cd BuildSystem
export CASAL2_BUILD_THREADS=16
./doBuild.sh frontend
shell: bash
- name: Build Linux Archive
continue-on-error: true
run: |
cd BuildSystem
export CASAL2_BUILD_THREADS=16
./doBuild.sh archive true
shell: bash
- name: Archive Linux build
continue-on-error: true
uses: actions/upload-artifact@v2.2.4
with:
name: Casal2-Linux-build
path: BuildSystem/Casal2
- name: Run Linux model runner
continue-on-error: true
run: |
cd BuildSystem
./doBuild.sh modelrunner
- name: Archive modelrunner
continue-on-error: true
uses: actions/upload-artifact@v2.2.4
with:
name: Casal2-Linux-modelrunner
path: TestModels/
- name: Run Unit Tests from frontend build
run: |
cd BuildSystem/Casal2
./casal2 --unittest > unittests.log
- name: Archive unittest output
continue-on-error: true
uses: actions/upload-artifact@v2.2.4
with:
name: Casal2-Linux-unittest
path: BuildSystem/Casal2/unittests.log
Base-R-Ubuntu:
needs: Compile-Casal2-Linux
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
working-directory: R-libraries/casal2
extra-packages: |
any::devtools
any::bayesplot
any::purrr
any::DHARMa
any::mvtnorm
dependencies: '"hard"'
- name: Install Casal2 base
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/settings/tokens
run: Rscript -e 'devtools::install_github("https://github.com/NIWAFisheriesModelling/CASAL2", subdir="R-libraries/casal2", ref = "HEAD")'
## download model runs
- name: Download TestModels artifact
uses: actions/download-artifact@v1.0.0
with:
# Artifact name
name: Casal2-Linux-modelrunner # optional
# Destination path
path: CheckTestModels # optional
## now run an R script that will check R-library compatible with exe output
- name: Run Casal2 R test suite
run: Rscript -e 'source(file.path("R-libraries","run_rlibrary_tests.R"))'
Compile-Casal2-Windows:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
# https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md
runs-on: windows-2019
timeout-minutes: 180
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2.2.2
with:
python-version: '3.8'
- name: Install python dependencies
run: python.exe -m pip install pytz python-dateutil --user --upgrade pip
- name: Install gcc
uses: bwoodsend/setup-winlibs-action@v1
with:
# see https://github.com/marketplace/actions/setup-winlibs
# and https://github.com/brechtsanders/winlibs_mingw/tags
#tag: '10.3.0-12.0.0-9.0.0-r2'
tag: '10.3.1-snapshot20211112-9.0.0-ucrt-r1' # previous tag as of 2022-03-31
#tag: '11.1.0-12.0.0-9.0.0-r1' # reference tag in documentation
#tag: '11.2.1-snapshot20220219-9.0.0-ucrt-r1' # caused issues with Casal2 unit tests
#tag: '12.0.1-snapshot20220123-9.0.0-msvcrt-r1'
- name: Build third-party library - adolc
run: |
cd BuildSystem
./doBuild.bat thirdparty adolc
- name: Build third-party library - betadiff
run: |
cd BuildSystem
./doBuild.bat thirdparty betadiff
- name: Build third-party library - boost
run: |
cd BuildSystem
./doBuild.bat thirdparty boost
- name: Build third-party libraries - google test and mock
run: |
cd BuildSystem
./doBuild.bat thirdparty googletest_googlemock
- name: Build third-party libraries - parser
run: |
cd BuildSystem
./doBuild.bat thirdparty parser
- name: Build release library
run: |
cd BuildSystem
./doBuild.bat library release
- name: Build "Betadiff" library
run: |
cd BuildSystem
./doBuild.bat library betadiff
- name: Build "ADOL-C" library
run: |
cd BuildSystem
./doBuild.bat library adolc
- name: Build "Unit Test" library
run: |
cd BuildSystem
./doBuild.bat library test
- name: Build Frontend
run: |
cd BuildSystem
./doBuild.bat frontend
shell: bash
- name: Build Windows Archive
continue-on-error: true
run: |
cd BuildSystem
./doBuild.bat archive true
shell: bash
- name: Archive Windows build
continue-on-error: true
uses: actions/upload-artifact@v2.2.4
with:
name: Casal2-Windows-build
path: BuildSystem/Casal2
- name: Run Windows model runner
continue-on-error: true
run: |
cd BuildSystem
./doBuild.bat modelrunner
- name: Archive Windows modelrunner
continue-on-error: true
uses: actions/upload-artifact@v2.2.4
with:
name: Casal2-Windows-modelrunner
path: TestModels/
- name: Run Unit Tests from frontend application
continue-on-error: false
run: |
cd BuildSystem/Casal2
./casal2 --unittest > unittests.log
- name: Archive unittest output
continue-on-error: true
uses: actions/upload-artifact@v2.2.4
with:
name: Casal2-Windows-unittest
path: BuildSystem/Casal2/unittests.log