diff --git a/.github/actions/buildcdeps/action.yaml b/.github/actions/buildcdeps/action.yaml new file mode 100644 index 000000000..9d775dd12 --- /dev/null +++ b/.github/actions/buildcdeps/action.yaml @@ -0,0 +1,46 @@ +name: CDEPS build and cache +description: 'Build the CDEPS library' +inputs: + cdeps_version: + description: 'Tag in the CDEPS repository to use' + default: main + required: False + type: string + pio_path: + description: 'Path to the installed parallelio code root' + default: $HOME/pio + required: False + type: string + esmfmkfile: + description: 'Path to the installed ESMF library mkfile' + default: $HOME/ESMF/lib/libg/Linux.gfortran.64.openmpi.default/esmf.mk + required: False + type: string + src_root: + description: 'Path to cdeps source' + default: $GITHUB_WORKSPACE + required: False + type: string + cmake_flags: + description: 'Extra flags for cmake command' + default: -Wno-dev + required: False + type: string + install_prefix: + description: 'Install path of cdeps' + default: $HOME/cdeps + required: False + type: string +runs: + using: composite + steps: + - id : Build-CDEPS + shell: bash + run: | + mkdir build-cdeps + pushd build-cdeps + export ESMFMKFILE=${{ inputs.esmfmkfile }} + export PIO=${{ inputs.pio_path }} + cmake ${{ inputs.cmake_flags }} ${{ inputs.src_root }} + make VERBOSE=1 + popd diff --git a/.github/workflows/extbuild.yml b/.github/workflows/extbuild.yml index c3a54360e..b2127bdc5 100644 --- a/.github/workflows/extbuild.yml +++ b/.github/workflows/extbuild.yml @@ -93,12 +93,14 @@ jobs: pnetcdf_path: /usr parallelio_path: $HOME/pio - name: Build CDEPS + uses: ./.github/actions/buildcdeps + with: + esmfmkfile: $HOME/ESMF/lib/libg/Linux.gfortran.64.openmpi.default/esmf.mk + pio_path: $HOME/pio + src_root: $GITHUB_WORKSPACE + cmake_flags: " -Wno-dev -DCMAKE_BUILD_TYPE=DEBUG -DWERROR=ON -DCMAKE_Fortran_FLAGS=\"-DCPRGNU -g -Wall \ + -ffree-form -ffree-line-length-none -fallow-argument-mismatch \"" + - name: Test CDEPS run: | - export ESMFMKFILE=$HOME/ESMF/lib/libg/Linux.gfortran.64.openmpi.default/esmf.mk - export PIO=$HOME/pio - export SRC_ROOT= - mkdir build-cdeps - pushd build-cdeps - cmake -Wno-dev -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_Fortran_FLAGS="-DCPRGNU -g -Wall -ffree-form -ffree-line-length-none -fallow-argument-mismatch " -DWERROR=ON ../ + cd build-cdeps make VERBOSE=1 - popd