Skip to content

Commit

Permalink
Update GH CI (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
RussTreadon-NOAA authored Jan 6, 2025
1 parent e6ce414 commit dd37ccc
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 26 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/gcc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ defaults:

env:
cache_key: gcc
CC: gcc-10
FC: gfortran-10
CXX: g++-10
CC: gcc-13
FC: gfortran-13
CXX: g++-13

# A note on flushing Action cache and relevance to "cache_key" above.
# There is no way to flush the Action cache, and hence a number (#) is appended
Expand Down Expand Up @@ -44,10 +44,11 @@ jobs:
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo apt clean
docker rmi $(docker image ls -aq)
DOCKER_IMGS=$(docker image ls -aq)
if [[ ! -z "${DOCKER_IMGS}" ]]; then docker rmi ${DOCKER_IMGS}; fi
df -h
- name: checkout # This is for getting spack.yaml
- name: checkout # This is for getting spack.yml
if: steps.cache-env.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
Expand All @@ -56,28 +57,27 @@ jobs:
# Cache spack, compiler and dependencies
- name: cache-env
id: cache-env
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
spack
~/.spack
key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('gsi-utils/ci/spack.yaml') }}
key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('gsi-utils/ci/spack_gcc.yaml') }}

# Install dependencies using Spack
- name: install-dependencies-with-spack
if: steps.cache-env.outputs.cache-hit != 'true'
run: |
rm -rf spack
git clone -c feature.manyFiles=true https://github.com/JCSDA/spack.git
source spack/share/spack/setup-env.sh
spack env create gsiutils-env gsi-utils/ci/spack.yaml
spack env create gsiutils-env gsi-utils/ci/spack_gcc.yaml
spack env activate gsiutils-env
spack compiler find
sudo apt install cmake
spack external find
spack add mpich@3.4.2
spack concretize
spack install -v --fail-fast --dirty
spack clean --all
spack install --fail-fast --dirty
spack clean -a
gsi-utils:
needs: setup
Expand All @@ -91,12 +91,12 @@ jobs:

- name: cache-env
id: cache-env
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
spack
~/.spack
key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('gsi-utils/ci/spack.yaml') }}
key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('gsi-utils/ci/spack_gcc.yaml') }}

- name: build
run: |
Expand Down
21 changes: 12 additions & 9 deletions .github/workflows/intel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ jobs:
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo apt clean
docker rmi $(docker image ls -aq)
DOCKER_IMGS=$(docker image ls -aq)
if [[ ! -z "${DOCKER_IMGS}" ]]; then docker rmi ${DOCKER_IMGS}; fi
df -h
- name: checkout # This is for getting spack.yaml
- name: checkout # This is for getting spack.yml
if: steps.cache-env.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
Expand All @@ -66,9 +67,10 @@ jobs:
spack
~/.spack
/opt/intel
key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('gsi-utils/ci/spack.yaml') }}
key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('gsi-utils/ci/spack_intel.yaml') }}-1

- name: install-intel-compilers
if: steps.cache-env.outputs.cache-hit != 'true'
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
Expand All @@ -84,17 +86,16 @@ jobs:
run: |
sudo mv /usr/local/ /usr_local_mv
sudo apt-get install cmake
rm -rf spack
git clone -c feature.manyFiles=true https://github.com/JCSDA/spack.git
source spack/share/spack/setup-env.sh
spack env create gsiutils-env gsi-utils/ci/spack.yaml
spack env create gsiutils-env gsi-utils/ci/spack_intel.yaml
spack env activate gsiutils-env
spack compiler find
sudo apt install cmake
spack external find
spack add intel-oneapi-mpi
spack concretize
spack install --dirty --fail-fast -v
spack clean --all
spack install --fail-fast --dirty
spack clean -a
gsi-utils:
needs: setup
Expand All @@ -118,10 +119,12 @@ jobs:
spack
~/.spack
/opt/intel
key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('gsi-utils/ci/spack.yaml') }}
key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('gsi-utils/ci/spack_intel.yaml') }}

- name: build
run: |
sudo mv /usr/local/ /usr_local_mv
sudo apt-get install cmake libblas-dev liblapack-dev
source spack/share/spack/setup-env.sh
spack env activate gsiutils-env
cd gsi-utils
Expand Down
30 changes: 30 additions & 0 deletions ci/spack_gcc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Spack environment file to build GSI-utils dependencies
spack:
packages:
all:
providers:
blas: [openblas]
lapack: [openblas]
mpi: [mpich]
compiler:
- gcc@13
specs:
- netcdf-c@4.9.2
- netcdf-fortran@4.6.1
- bufr@11.7.0
- bacio@2.4.1
- w3emc@2.10.0
- sp@2.5.0
- ip@4.3.0
- sigio@2.3.2
- sfcio@1.4.1
- nemsio@2.5.4
- wrf-io@1.2.0
- ncio@1.1.2
- crtm@2.4.0.1
- gsi-ncdiag@1.1.2
- mpich@3.4.2
- openblas@0.3.28
view: true
concretizer:
unify: true
10 changes: 7 additions & 3 deletions ci/spack.yaml → ci/spack_intel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
spack:
packages:
all:
compiler: [intel, gcc@10:10]
providers:
mpi: [intel-oneapi-mpi]
compiler:
- intel
specs:
- netcdf-c@4.9.2
- netcdf-c@4.9.2 ~blosc build_system=cmake
- netcdf-fortran@4.6.1
- bufr@11.7.0
- bacio@2.4.1
Expand All @@ -21,6 +24,7 @@ spack:
- crtm@2.4.0.1
- ncio@1.1.2
- gsi-ncdiag@1.1.2
- intel-oneapi-mpi@2021.10.0
view: true
concretizer:
unify: when_possible
unify: true

0 comments on commit dd37ccc

Please sign in to comment.