Skip to content

Commit

Permalink
enable CI.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
kongdd committed Feb 15, 2024
1 parent 769ce84 commit 52a0898
Showing 1 changed file with 25 additions and 61 deletions.
86 changes: 25 additions & 61 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ name: CI
# events but only for the master branch
on:
push:
branches: [ main ]
branches: [ main, master]
pull_request:
branches: [ main ]
branches: [ main, master]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand All @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, 3.11]
python-version: [3.10]
env:
CC: mpicc
FC: mpifort
Expand All @@ -37,36 +37,7 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it

- name: cime checkout
uses: actions/checkout@v3
with:
repository: ESMCI/cime
submodules: True
# - name: genf90 checkout
# uses: actions/checkout@v2
# with:
# repository: PARALLELIO/genf90
# path: CIME/non_py/externals/genf90

- name: ccs_config checkout
uses: actions/checkout@v3
with:
repository: ESMCI/ccs_config_cesm
path: ccs_config

- name: share checkout
uses: actions/checkout@v3
with:
repository: ESCOMP/CESM_share
path: share

- name: cpl7 checkout
uses: actions/checkout@v3
with:
repository: ESCOMP/CESM_CPL7andDataComps
path: components/cpl7


- id: load-env
run: |
sudo apt-get update
Expand All @@ -81,16 +52,6 @@ jobs:
- name: pip install
run: pip install PyYAML

- name: mct install
run: |
git clone -b ${{ env.MCT_VERSION }} https://github.com/MCSclimate/MCT libraries/mct
ls -l libraries/mct
- name: parallelio install
run: |
git clone -b ${{ env.PARALLELIO_VERSION }} https://github.com/NCAR/ParallelIO libraries/parallelio
ls -l libraries/parallelio
- name: cache pnetcdf
id: cache-pnetcdf
uses: actions/cache@v3
Expand Down Expand Up @@ -138,29 +99,32 @@ jobs:
clibdir=`nc-config --libdir`
ln -fs $clibdir/lib* .
- name: Cache inputdata
if: ${{ ! env.ACT }}
uses: actions/cache@v3
with:
path: $HOME/cesm/inputdata
key: inputdata
#
# The following can be used to ssh to the testnode for debugging
# see https://github.com/mxschmitt/action-tmate for details
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3

- name: scripts regression tests
- name: build eCLM
run: |
mkdir -p $HOME/cesm/scratch
mkdir -p $HOME/cesm/inputdata
cd $HOME/work/CESM_share/CESM_share
ls -l $HOME/work/CESM_share/CESM_share
export NETCDF=$HOME/netcdf-fortran
export PATH=$NETCDF/bin:$PATH
export LD_LIBRARY_PATH=$NETCDF/lib:$HOME/pnetcdf/lib:$LD_LIBRARY_PATH
python -m pip install pytest pytest-cov
pytest -vvv --no-fortran-run --compiler gnu --mpilib openmpi --machine ubuntu-latest
# User-specific variables
BUILD_DIR="bld"
INSTALL_DIR="eclm"
# Run cmake
cmake -S src -B "$BUILD_DIR" \
-DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \
-DCMAKE_C_COMPILER=mpicc \
-DCMAKE_Fortran_FLAGS="-fallow-argument-mismatch -fallow-invalid-boz" \
-DCMAKE_Fortran_COMPILER=mpifort
cd bld
make -j8
# - name: Cache inputdata
# if: ${{ ! env.ACT }}
# uses: actions/cache@v3
# with:
# path: $HOME/cesm/inputdata
# key: inputdata

# the following can be used by developers to login to the github server in case of errors
# see https://github.com/marketplace/actions/debugging-with-tmate for further details
Expand Down

0 comments on commit 52a0898

Please sign in to comment.