Relative paths #16
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] | |
esmf_version: ["8.3.1", "8.4.2"] | |
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 | |
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 |