-
Notifications
You must be signed in to change notification settings - Fork 24
131 lines (123 loc) · 4.42 KB
/
extbuild.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# This is a workflow to compile the share source without cime
name: extbuild
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build-share:
runs-on: ubuntu-latest
env:
CC: mpicc
FC: mpifort
CXX: mpicxx
CPPFLAGS: "-I/usr/include -I/usr/local/include "
LDFLAGS: "-L/usr/lib/x86_64-linux-gnu "
# Versions of all dependencies can be updated here - these match tag names in the github repo
ESMF_VERSION: v8.6.1
ParallelIO_VERSION: pio2_6_2
PFUNIT_VERSION: v4.9.0
steps:
- id: checkout-share
uses: actions/checkout@v4
- id: load-env
run: |
sudo apt-get update
sudo apt-get install gfortran
sudo apt-get install openmpi-bin libopenmpi-dev
sudo apt-get install libxml2-utils
sudo apt-get install netcdf-bin libnetcdf-dev libnetcdff-dev
sudo apt-get install pnetcdf-bin libpnetcdf-dev
- name: Cache PARALLELIO
id: cache-PARALLELIO
uses: actions/cache@v4
with:
path: pio
key: ${{ runner.os }}-${{ env.ParallelIO_VERSION }}
- name: Build ParallelIO
if: steps.cache-PARALLELIO.outputs.cache-hit != 'true'
uses: NCAR/ParallelIO/.github/actions/parallelio_cmake@9390e30e29d4ebbfbef0fc72162cacd9e8f25e4e
with:
parallelio_version: ${{ env.ParallelIO_VERSION }}
enable_fortran: True
install_prefix: ${GITHUB_WORKSPACE}/pio
- name: Install ESMF
uses: esmf-org/install-esmf-action@v1
env:
ESMF_COMPILER: gfortran
ESMF_BOPT: g
ESMF_COMM: openmpi
ESMF_NETCDF: nc-config
ESMF_PNETCDF: pnetcdf-config
ESMF_INSTALL_PREFIX: ${GITHUB_WORKSPACE}/ESMF
ESMF_PIO: external
ESMF_PIO_INCLUDE: ${GITHUB_WORKSPACE}/pio/include
ESMF_PIO_LIBPATH: ${GITHUB_WORKSPACE}/pio/lib
with:
version: ${{ env.ESMF_VERSION }}
esmpy: false
cache: true
- name: Build SHARE
uses: ./.github/actions/buildshare
with:
esmfmkfile: $ESMFMKFILE
pio_path: ${GITHUB_WORKSPACE}/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\" \
-DCMAKE_MODULE_PATH=$ESMF_ROOT/cmake"
- name: Test CDEPS
run: |
cd build-share
make VERBOSE=1
- name: Cache PFUNIT
id: cache-pfunit
uses: actions/cache@v4
with:
path: pfunit
key: ${{ runner.os }}-${{ env.PFUNIT_VERSION }}
- name: Checkout PFUNIT
if: steps.cache-pfunit.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
path: pfunit
ref: ${{ env.PFUNIT_VERSION }}
repository: Goddard-Fortran-Ecosystem/pFUnit
- name: build PFUNIT
if: steps.cache-pfunit.outputs.cache-hit != 'true'
run: |
pushd pfunit
cmake -DSKIP_MPI=YES -DSKIP_OPENMP=YES -B build
cmake --build build
popd
- name: Checkout cime
uses: actions/checkout@v4
with:
path: cime
ref: master
repository: ESMCI/cime
- name: Checkout ccs_config
uses: actions/checkout@v4
with:
path: ccs_config
ref: main
repository: ESMCI/ccs_config_cesm
- name: run unit testing
run: |
# this line is to satisfy the config_files.xml path structure
ln -fs ../../ share
pushd cime
export CIME_MODEL=cesm
export NetCDF_ROOT=/usr
mkdir ftest
cat ../ccs_config/machines/cmake_macros/ubuntu-latest.cmake
python ./scripts/fortran_unit_testing/run_tests.py --build-dir `pwd`/ftest --machine ubuntu-latest
# 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
- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3