Skip to content

workflows testing

workflows testing #36

name: travis_suite_linux
# This workflow is triggered on pushes, pull-requeust, and releases
# ghactions* branch names will trigger this to support development testing
# To Do: get it working with bash and ubuntu
on:
push:
branches:
- main
- 'CICE*'
- 'ghactions*'
pull_request:
release:
types:
- created
defaults:
run:
shell: /bin/bash -el {0}
jobs:
build:
name: "CICETesting"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
include:
- os: ubuntu-latest
envdef: linux
steps:
- name: install csh
uses: ConorMacBride/install-package@v1
with:
apt: csh
- name: system info
run: |
type wget
type curl
type csh
echo "readlink \$(which csh): $(python -c 'import os, sys; print(os.path.realpath(sys.argv[1]))' $(which csh))"
echo "csh --version: $(csh --version)"
echo "uname -a: $(uname -a)"
echo "sw_vers: $(sw_vers)"
echo "HOME: $HOME"
echo "GITHUB_WORKSPACE: $GITHUB_WORKSPACE"
echo "OS: ${{ matrix.os }}"
echo "ENVDEF: ${{ matrix.envdef }}"
# echo "MINICOND: ${{ matrix.minicond }}"
- name: clone CICE
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: make test directories
run: |
ln -s ${GITHUB_WORKSPACE}/../CICE ${HOME}/cice
mkdir -p "$HOME/cice-dirs/runs" "$HOME/cice-dirs/baseline" "$HOME/cice-dirs/input"
# ls -al ${HOME}/
# ls -al ${GITHUB_WORKSPACE}/
- name: check for tabs
shell: /bin/csh -e {0}
run: |
cd ${HOME}/cice/cicecore
set cnt = 0
set ffiles = `find -P . -iname "*.f*"`
set cfiles = `find -P . -iname "*.c*"`
foreach file ($ffiles $cfiles)
set fcnt = `sed -n '/\t/p' $file | wc -l`
@ cnt = $cnt + $fcnt
if ($fcnt > 0) then
echo "TAB found: $fcnt $file"
endif
end
exit $cnt
- name: install conda environment
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: cice
environment-file: configuration/scripts/machines/environment.yml
auto-activate-base: false
mamba-version: "*"
- name: check conda env
run: |
conda activate cice && which clang && which gfortran && which mpicc && which mpifort && which make
clang --version
gfortran --version
mpifort --version
mpicc --version
make --version
# echo "mpifort -v:"
# mpifort -v
# echo "mpifort --showme:compile:"
# mpifort --showme:compile
# echo "mpifort --showme:link:"
# mpifort --showme:link
# echo "mpifort --showme:command:"
# mpifort --showme:command
# echo "mpifort --showme:libdirs:"
# mpifort --showme:libdirs
# echo "mpifort --showme:libs:"
# mpifort --showme:libs
# echo "mpifort --showme:incdirs:"
# mpifort --showme:incdirs
- name: check setup case
shell: csh
run: |
cd $HOME/cice
source /usr/share/miniconda/etc/profile.d/conda.csh
./cice.setup -m conda -e ${{ matrix.envdef }} -c case0 --pes 1x1 -s diag1
- name: check setup test
run: |
cd $HOME/cice
./cice.setup -m conda -e ${{ matrix.envdef }} --test smoke --testid c0
- name: run hello world unit test
run: |
cd $HOME/cice
./cice.setup -m conda -e ${{ matrix.envdef }} --test unittest --pes 2x1 -s helloworld --testid hw01
cd *helloworld*hw01
./cice.build
./cice.run
- name: check cice compile
run: |
cd (${GITHUB_WORKSPACE})/cice
./cice.setup -m conda -e ${{ matrix.envdef }} -c case1 --pes 2x2 -s diag1
cd case1
./cice.build
- name: download input data
run: |
cd $HOME/cice-dirs/input
wget --progress=dot:giga https://zenodo.org/record/3728358/files/CICE_data_gx3_grid_ic-20200320.tar.gz && tar xvfz CICE_data_gx3_grid_ic-20200320.tar.gz
wget --progress=dot:giga https://zenodo.org/records/10419929/files/CICE_data_gx3_forcing_JRA55_200501_20231220.tar.gz && tar xvfz CICE_data_gx3_forcing_JRA55_200501_20231220.tar.gz
pwd
cd CICE_data/forcing/gx3/JRA55/8XDAILY
ln -s JRA55_gx3_03hr_forcing_200501.nc JRA55_gx3_03hr_forcing_2005.nc
cd $HOME/cice-dirs/input
ls -alR
- name: run suite
run: |
cd $HOME/cice
./cice.setup -m conda -e ${{ matrix.envdef }} --suite travis_suite --testid ${{ matrix.os }}
- name: write output
run: |
cd $HOME/cice
./.github/workflows/write_logfiles.csh
cd testsuite.${{ matrix.os }}
./results.csh
- name: successful run
if: ${{ success() }}
run: |
echo "${{ job.name }} PASSED"
- name: trap failure
if: ${{ failure() }}
run: |
echo "${{ job.name }} FAILED"
exit 99