-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (73 loc) · 2.59 KB
/
build.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
on:
push:
pull_request:
workflow_dispatch:
jobs:
build:
name: Build ESMF ${{ matrix.esmf_version }} with GCC ${{ matrix.gcc_major_version }} (mpiuni)
runs-on: ubuntu-22.04
strategy:
matrix:
gcc_major_version: ["12", "13"]
esmf_version: ["8.3.1", "8.4.2", "8.5.0", "8.6.1"]
steps:
- name: Check out
uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get install -y libnetcdf-dev libnetcdff-dev
liblapack-dev libopenblas-dev
- name: Build ESMF
run: |
v="${{ matrix.esmf_version }}" # ESMF
gcc="${{ matrix.gcc_major_version }}"
esmf_base=$HOME/esmf
export ESMF_DIR=${esmf_base}/${v}-gcc-${gcc}-mpiuni
mkdir -p $ESMF_DIR
cd $esmf_base
wget https://github.com/esmf-org/esmf/archive/refs/tags/v${v}.tar.gz
tar xzvf v${v}.tar.gz --directory=/tmp && mv /tmp/esmf-${v}/* $ESMF_DIR
export ESMF_COMPILER=gfortran
export ESMF_LAPACK=netlib
export ESMF_COMM=mpiuni
export ESMF_NETCDF=nc-config
export ESMF_F90COMPILER=gfortran-${gcc}
export ESMF_CCOMPILER=gcc-${gcc}
export ESMF_CXXCOMPILER=g++-${gcc}
export ESMF_F90LINKER=/usr/bin/ld
export ESMF_CLINKER=/usr/bin/ld
export ESMF_CXXLINKER=/usr/bin/ld
cd $ESMF_DIR
make -j lib
echo "ESMFMKFILE=${ESMF_DIR}/lib/libO/Linux.gfortran.64.mpiuni.default/esmf.mk" >> "$GITHUB_ENV"
echo "ESMF_DIR=${ESMF_DIR}" >> "$GITHUB_ENV"
- name: Compress ESMF dir
run: |
du -sh ${{ env.ESMF_DIR }}
tar czvf ${{ env.ESMF_DIR }}.tar.gz --directory=${{ env.ESMF_DIR }} .
du -sh ${{ env.ESMF_DIR }}.tar.gz
- name: Upload ESMF dir as artifact
uses: actions/upload-artifact@v4
with:
name: esmf-${{ matrix.esmf_version }}-gcc-${{ matrix.gcc_major_version }}-mpiuni
path: ${{ env.ESMF_DIR }}.tar.gz
retention-days: 1
release:
name: Release
runs-on: ubuntu-22.04
needs: build
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Download ESMF dir artifacts
uses: actions/download-artifact@v4
with:
name:
- name: List downloaded artifacts
run: ls -Al esmf-*
- name: Upload ESMFs to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./esmf-*/*.tar.gz
tag: ${{ github.ref }}
overwrite: true
file_glob: true