-
Notifications
You must be signed in to change notification settings - Fork 79
147 lines (123 loc) · 4.58 KB
/
build_netcdf_no_hdf5.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# This is a basic workflow to help you get started with Actions
name: SEACAS no-hdf5-netcdf builds
# Controls when the action will run. Triggers the workflow on push
on:
push:
branches:
- master
pull_request:
branches:
- master
concurrency:
group: ${{ github.workflow}}-${{ github.head_ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build-deps:
runs-on: ubuntu-latest
strategy:
matrix:
compiler: [ gnu, clang, mpi ]
netcdf: [ 4.9.2 ]
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Install System dependencies
shell: bash -l {0}
run: sudo apt update && sudo apt install -y libaec-dev zlib1g-dev automake autoconf libcurl4-openssl-dev libjpeg-dev wget curl bzip2 m4 flex bison cmake libzip-dev openmpi-bin libopenmpi-dev
###
# Installing TPL
###
- name: Cache TPL-${{ matrix.compiler }}-${{ matrix.netcdf }}
id: cache-TPL-mpi
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/environments/${{ matrix.compiler }}-${{ matrix.netcdf }}
key: TPL-v5-${{ runner.os }}-${{ matrix.compiler }}-${{ matrix.netcdf }}
- name: Build TPL-${{ matrix.compiler }}-${{ matrix.netcdf }}
if: steps.cache-TPL.outputs.cache-hit != 'true'
run: |
set -x
COMPILER=${{ matrix.compiler }} HDF5=NO GNU_PARALLEL=OFF INSTALL_PATH=${HOME}/environments/${{ matrix.compiler }}-${{ matrix.netcdf }} ./install-tpl.sh
ls ${HOME} && ls ${HOME}/environments && ls ${HOME}/environments/${{ matrix.compiler }}-${{ matrix.netcdf }} && ls ${HOME}/environments/${{ matrix.compiler }}-${{ matrix.netcdf }}/lib
build:
needs: build-deps
# The type of runner that the job will run on
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
netcdf: [ 4.9.2 ]
config:
- {
name: "Debug serial build",
os: ubuntu-latest,
compiler: "gnu",
debug: "YES",
extra: "",
}
- {
name: "Debug parallel build",
os: ubuntu-latest,
compiler: "mpi",
debug: "YES",
extra: "",
}
- {
name: "Use modern CMake configure of netCDF package",
os: ubuntu-latest,
compiler: "mpi",
debug: "NO",
extra: "MODERN=YES",
}
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Install System dependencies
shell: bash -l {0}
run: sudo apt update && sudo apt install -y libaec-dev zlib1g-dev automake autoconf libcurl4-openssl-dev libjpeg-dev wget curl bzip2 m4 flex bison cmake libzip-dev openmpi-bin libopenmpi-dev
- name: Fetch TPL Cache
id: cache-TPL
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/environments/${{ matrix.config.compiler }}-${{ matrix.netcdf }}
key: TPL-v5-${{ runner.os }}-${{ matrix.config.compiler }}-${{ matrix.netcdf }}
- name: Check Cache
shell: bash -l {0}
run: ls ${HOME} && ls ${HOME}/environments && ls ${HOME}/environments/${{ matrix.config.compiler }}-${{ matrix.netcdf }} && ls ${HOME}/environments/${{ matrix.config.compiler }}-${{ matrix.netcdf }}/lib
###
# Configure and build
###
- name: Run cmake
shell: bash -l {0}
run: |
echo $HOME
mkdir build
cd build
NUMPROCS=2 ${{ matrix.config.extra }} DEBUG=${{ matrix.config.debug }} COMPILER=${{ matrix.config.compiler }} INSTALL_PATH=${HOME}/environments/${{ matrix.config.compiler }}-${{ matrix.netcdf }} bash ../cmake-config
- name: Build
shell: bash -l {0}
run: |
cd build
make -j 4
if: ${{ success() }}
- name: Install
shell: bash -l {0}
run: |
cd build
make -j 4 install
if: ${{ success() }}
- name: Run Tests
shell: bash -l {0}
run: |
cd build
ctest -j 4 --output-on-failure
if: ${{ success() }}