-
Notifications
You must be signed in to change notification settings - Fork 69
131 lines (128 loc) · 3.59 KB
/
continuous-integration.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
name: Continuous Integration
on:
push:
branches:
- main
- develop
pull_request:
branches-ignore:
- documentation
workflow_dispatch:
defaults:
run:
# Enable Conda environment by using the login shell:
shell: bash -leo pipefail {0}
jobs:
CI:
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-13, macos-latest, windows-2022]
gfortran-version: [12, 13, 14]
gfortran-from: [system, conda]
fpmodel: [DP, SP]
exclude:
- os: ubuntu-24.04
gfortran-from: conda
- os: macos-13
gfortran-from: system
- os: macos-13
gfortran-version: 14
gfortran-from: conda
- os: macos-latest
gfortran-from: system
- os: macos-latest
gfortran-version: 14
gfortran-from: conda
- os: windows-2022
include:
- os: ubuntu-24.04
gfortran-version: 13
gfortran-from: conda
fpmodel: DP
- os: windows-2022
gfortran-version: 13
gfortran-from: conda
fpmodel: DP
- os: windows-2022
gfortran-version: 13
gfortran-from: conda
fpmodel: SP
- os: windows-2022
gfortran-version: 14
gfortran-from: conda
fpmodel: DP
- os: windows-2022
gfortran-version: 14
gfortran-from: conda
fpmodel: SP
env:
FC: gfortran-${{ matrix.gfortran-version }}
FFLAGS: "-m64 -std=f2008 -march=native -fbounds-check -fmodule-private -fimplicit-none -finit-real=nan"
CMAKE_BUILD_PARALLEL_LEVEL: 8
VERBOSE:
CTEST_PARALLEL_LEVEL: 8
CTEST_OUTPUT_ON_FAILURE: 1
runs-on: ${{ matrix.os }}
steps:
#
# Check out repository under $GITHUB_WORKSPACE
#
- name: Check out code
uses: actions/checkout@v4
#
# Cache Conda packages
#
- name: Cache Conda packages
uses: actions/cache@v4
with:
path: ~/conda_pkgs_dir
key: conda-pkgs-${{ matrix.os }}
#
# Set up Conda
#
- name: Set up Conda
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
activate-environment: rte_rrtmgp_test
environment-file: environment-noplots.yml
python-version: 3.11
auto-activate-base: false
# Use the cache properly:
use-only-tar-bz2: false
#
# Install compiler
#
- name: Install compiler
if: matrix.gfortran-from == 'conda'
run: |
conda install -c conda-forge gfortran=${{ matrix.gfortran-version }} -y
echo "FC=gfortran" >> "$GITHUB_ENV"
#
# Install dependencies
#
- name: Install dependencies
run: conda install -c conda-forge netcdf-fortran ninja -y
#
# Adjust toolchain
#
- name: Adjust toolchain
if: matrix.os == 'windows-2022'
run: echo "FC=${FC}.exe" >> "$GITHUB_ENV"
#
# Build libraries, examples, and tests
#
- name: Build libraries and tests
run: |
cmake -S . -B build -G "Ninja" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DRTE_ENABLE_SP="$(test '${{ matrix.fpmodel }}' = SP && echo ON || echo OFF)" \
-DBUILD_TESTING=ON
cmake --build build
#
# Run examples, tests and checks
#
- name: Run examples, tests and checks
working-directory: build
run: ctest