From b73f02730892bfc642ba3132a7f18fc17c1485d3 Mon Sep 17 00:00:00 2001
From: Yen-Chen Chen <yen-chen.chen@kit.edu>
Date: Thu, 6 Jun 2024 09:43:43 +0000
Subject: [PATCH] Update ci (icon-libraries/libfortran-support!90)

## What is the bug
Running pipelines on images cannot do tests with OpenACC.
## How do you fix it
Change the CI configuration to using the `levante` shared runner. This runner submits jobs on Levante directly with the CI script.
`Check typos` CI is also fixed by specifying the conda channel to search for the package.

Merged-by: Jonas Jucker <jonas.jucker@env.ethz.ch>
Changelog: bugfix
---
 .gitlab-ci.yml | 40 +++++++++++++++++++++++++++++-----------
 1 file changed, 29 insertions(+), 11 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 8531ca1..fa8f6d0 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -9,6 +9,10 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # ---------------------------------------------------------------
 
+include:
+  - project: 'anw_dienste/ci-templates'
+    file: '.slurm-ci.yml'
+
 stages:
   - lint
   - build_and_test
@@ -28,10 +32,16 @@ workflow:
     DEFAULT: '\033[0m'
     RED: '\033[0;31m'
 
+variables: 
+  ACCOUNT: "ka1125"
+  SCHEDULER_PARAMETERS: "--account=$ACCOUNT --partition=shared"
+
 nag:
   stage: build_and_test
+  extends: 
+    - .default
   before_script:
-    - . /sw/etc/profile.levante && module use /sw/spack-levante/spack/modules && module list
+    - module list
   script:
     - module load gcc/11.2.0-gcc-11.2.0 nag/7.1-gcc-11.2.0
     - export NAG_KUSARI_FILE="/etc/nag-license"
@@ -41,13 +51,15 @@ nag:
     - make VERBOSE=1
     - ctest --output-on-failure
   tags:
-    - levante-fake, hpc, dkrz
+    - levante, hpc, dkrz
   needs: ["Check Typo", "Check OpenACC Style", "Check Style", "Check CMake Style", "Check License"]
 
 gcc11:
   stage: build_and_test
+  extends: 
+    - .default
   before_script:
-    - . /sw/etc/profile.levante && module use /sw/spack-levante/spack/modules && module list
+    - module list
   script:
     - module load gcc/11.2.0-gcc-11.2.0
     - mkdir gcc112
@@ -56,13 +68,15 @@ gcc11:
     - make VERBOSE=1
     - ctest --output-on-failure
   tags:
-    - levante-fake, hpc, dkrz
+    - levante, hpc, dkrz
   needs: ["Check Typo", "Check OpenACC Style", "Check Style", "Check CMake Style", "Check License"]
 
 intel22:
   stage: build_and_test
+  extends: 
+    - .default
   before_script:
-    - . /sw/etc/profile.levante && module use /sw/spack-levante/spack/modules && module list
+    - module list
   script:
     - module load gcc/11.2.0-gcc-11.2.0 intel-oneapi-compilers/2022.0.1-gcc-11.2.0
     - mkdir intel22
@@ -71,13 +85,15 @@ intel22:
     - make VERBOSE=1
     - ctest --output-on-failure
   tags:
-    - levante-fake, hpc, dkrz
+    - levante, hpc, dkrz
   needs: ["Check Typo", "Check OpenACC Style", "Check Style", "Check CMake Style", "Check License"]
 
 nvhpc:
   stage: build_and_test
+  extends: 
+    - .default
   before_script:
-    - . /sw/etc/profile.levante && module use /sw/spack-levante/spack/modules && module list
+    - module list
   script:
     - module load gcc/11.2.0-gcc-11.2.0 nvhpc/22.5-gcc-11.2.0
     - mkdir nvhpc
@@ -86,13 +102,15 @@ nvhpc:
     - make VERBOSE=1
     - ctest --output-on-failure
   tags:
-    - levante-fake, hpc, dkrz
+    - levante, hpc, dkrz
   needs: ["Check Typo", "Check OpenACC Style", "Check Style", "Check CMake Style", "Check License"]
 
 OpenACC:
   stage: build_OpenACC
+  extends: 
+    - .default
   before_script:
-    - . /sw/etc/profile.levante && module use /sw/spack-levante/spack/modules && module list
+    - module list
   script:
     - module load gcc/11.2.0-gcc-11.2.0 nvhpc/22.5-gcc-11.2.0
     - mkdir nvhpc
@@ -100,14 +118,14 @@ OpenACC:
     - /sw/spack-levante/cmake-3.23.1-q5kzz6/bin/cmake .. -DFS_ENABLE_OPENACC=ON  -DCMAKE_C_COMPILER=nvc -DCMAKE_Fortran_COMPILER=nvfortran -DCMAKE_CXX_COMPILER=nvc++
     - make VERBOSE=1
   tags:
-    - levante-fake, hpc, dkrz
+    - levante, hpc, dkrz
   needs: ["nvhpc"]
 
 Check Typo:
   stage: lint
   before_script:
     # install typo check package
-    - conda install typos
+    - conda install conda-forge::typos
   script: typos
   tags:
     # choose conda available runner
-- 
GitLab