-
Notifications
You must be signed in to change notification settings - Fork 15
135 lines (116 loc) · 4.78 KB
/
c-cpp.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
name: Ubuntu Basic CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
ISSM_DIR: ${{ github.workspace }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- name: Cache externalpackages
uses: actions/cache@v3
id: cache-externalpackages
env:
cache-name: cache-triangle-m1qn3-petsc
with:
path: ${{ env.ISSM_DIR }}/externalpackages/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- name: Install External packages
if: steps.cache-externalpackages.outputs.cache-hit != 'true'
run: |
cd $ISSM_DIR/externalpackages/triangle && ./install-linux.sh
cd $ISSM_DIR/externalpackages/m1qn3 && ./install-linux.sh
cd $ISSM_DIR/externalpackages/petsc && ./install-3.21-linux.sh
- name: Get MATLAB
id: setup-matlab
uses: matlab-actions/setup-matlab@v2
with:
release: R2023b
cache: true
- name: Reconfigure ISSM
run: |
source $ISSM_DIR/etc/environment.sh
autoreconf -ivf
./configure --prefix=${ISSM_DIR} \
--disable-static \
--enable-development \
--enable-debugging \
--with-numthreads=4 \
--with-matlab-dir=${{ steps.setup-matlab.outputs.matlabroot }} \
--with-fortran-lib="-L/usr/lib/x86_64-linux-gnu -lgfortran" \
--with-mpi-include="${ISSM_DIR}/externalpackages/petsc/install/include" \
--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
--with-petsc-dir="${ISSM_DIR}/externalpackages/petsc/install" \
--with-blas-lapack-dir="${ISSM_DIR}/externalpackages/petsc/install" \
--with-metis-dir="${ISSM_DIR}/externalpackages/petsc/install" \
--with-parmetis-dir="${ISSM_DIR}/externalpackages/petsc/install" \
--with-scalapack-dir="${ISSM_DIR}/externalpackages/petsc/install" \
--with-mumps-dir="${ISSM_DIR}/externalpackages/petsc/install" \
--with-triangle-dir="${ISSM_DIR}/externalpackages/triangle/install" \
--with-m1qn3-dir="${ISSM_DIR}/externalpackages/m1qn3/install"
- name: Compile ISSM
run: make -j16 install
- name: Compress ISSM artifact
run: tar -cvf ISSM_artifact.tar -C ${{ env.ISSM_DIR }}/ .
- name: Upload ISSM artifact
uses: actions/upload-artifact@v4
with:
name: ISSM-${{ runner.os }}
path: ISSM_artifact.tar
compression-level: 1
test:
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
test-cases: [101:110, 201:210, 301:310]
steps:
- name: Download ISSM artifact
uses: actions/download-artifact@v4
with:
name: ISSM-${{ runner.os }}
path: ${{ env.ISSM_DIR }}
- name: uncompress ISSM artifact
run: |
tar -xvf ISSM_artifact.tar
rm ISSM_artifact.tar
source $ISSM_DIR/etc/environment.sh
working-directory: ${{ env.ISSM_DIR }}
shell: 'bash'
- name: Get MATLAB
id: setup-matlab
uses: matlab-actions/setup-matlab@v2
with:
release: R2023b
cache: true
- name: Creating matlab_ci.m
run: |
cat > ${ISSM_DIR}/matlab_ci.m << EOF
% Go to the test directory
cd $ISSM_DIR/test/NightlyRun/
% Add ISSM tools to path
addpath('${ISSM_DIR}/src/m/dev');
devpath;
% Run tests
runme('exclude',[IdFromString('Dakota')],'id',${{matrix.test-cases}},'quitonerror',1);
quit(0);
EOF
cat ${ISSM_DIR}/matlab_ci.m
- name: Get run-matlab-command
run: |
wget -O /usr/local/bin/run-matlab-command https://ssd.mathworks.com/supportfiles/ci/run-matlab-command/v2/glnxa64/run-matlab-command
chmod +x /usr/local/bin/run-matlab-command
- name: Run MATLAB tests
run: |
source $ISSM_DIR/etc/environment.sh
LD_PRELOAD=/lib/x86_64-linux-gnu/libstdc++.so.6:$ISSM_DIR/externalpackages/petsc/install/lib/libmpi.so:$ISSM_DIR/externalpackages/petsc/install/lib/libmpifort.so run-matlab-command "matlab_ci"
- run: echo "This job's status is ${{ job.status }}."