-
Notifications
You must be signed in to change notification settings - Fork 10
227 lines (221 loc) · 7.54 KB
/
ci.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
name: CI
on:
push:
branches:
- main
paths-ignore:
- 'AUTHORS.md'
- 'LICENSE.md'
- 'README.md'
pull_request:
paths-ignore:
- 'AUTHORS.md'
- 'LICENSE.md'
- 'README.md'
workflow_dispatch:
inputs:
debug_enabled:
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
env:
# Modify this variable to change the ifort compiler version - do NOT hardcode the version
# anywhere else!
INTEL_ONEAPI_VERSION: 2023.2.1
jobs:
test:
if: "!contains(github.event.head_commit.message, 'skip ci')"
name: ${{ matrix.os_name }} - ${{ matrix.compiler }} - ${{ matrix.test_type }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# Linux
- os: ubuntu-22.04
os_name: linux
compiler: gfortran-9
shell: bash
test_type: regular
coverage: false
- os: ubuntu-22.04
os_name: linux
compiler: gfortran-9
shell: bash
test_type: valgrind
coverage: false
- os: ubuntu-latest
os_name: linux
compiler: gfortran-10
shell: bash
test_type: regular
coverage: true
- os: ubuntu-latest
os_name: linux
compiler: gfortran-10
shell: bash
test_type: valgrind
coverage: false
- os: ubuntu-22.04
os_name: linux
compiler: gfortran-11
shell: bash
test_type: regular
coverage: false
- os: ubuntu-22.04
os_name: linux
compiler: gfortran-11
shell: bash
test_type: valgrind
coverage: false
- os: ubuntu-latest
os_name: linux
compiler: gfortran-12
shell: bash
test_type: regular
coverage: false
- os: ubuntu-latest
os_name: linux
compiler: gfortran-12
shell: bash
test_type: valgrind
coverage: false
- os: ubuntu-24.04
os_name: linux
compiler: gfortran-13
shell: bash
test_type: regular
coverage: false
- os: ubuntu-24.04
os_name: linux
compiler: gfortran-13
shell: bash
test_type: valgrind
coverage: false
- os: ubuntu-24.04
os_name: linux
compiler: gfortran-14
shell: bash
test_type: regular
coverage: false
- os: ubuntu-24.04
os_name: linux
compiler: gfortran-14
shell: bash
test_type: valgrind
coverage: false
- os: ubuntu-latest
os_name: linux
compiler: ifort
shell: bash
test_type: regular
coverage: false
# macOS
- os: macos-latest
os_name: macos
compiler: gfortran-12
shell: bash
test_type: regular
coverage: false
- os: macos-latest
os_name: macos
compiler: gfortran-13
shell: bash
test_type: regular
coverage: false
- os: macos-latest
os_name: macos
compiler: gfortran-14
shell: bash
test_type: regular
coverage: false
# Windows
- os: windows-latest
os_name: windows
compiler: gfortran
shell: 'msys2 {0}'
test_type: regular
coverage: false
# Set default shell as suggested here: https://github.community/t/setting-default-shell-or-other-step-metadata-conditionally-in-workflows/154055
defaults:
run:
shell: ${{ matrix.shell }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
# - name: Add msbuild to PATH
# if: ${{ matrix.os_name == 'windows-latest' }}
# uses: microsoft/[email protected]
- uses: msys2/setup-msys2@v2
if: ${{ matrix.os == 'windows-latest' }}
with:
update: true
install: git base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-gcc-fortran
- uses: actions/cache@v4
id: cache
with:
path: /opt/intel/oneapi
key: ${{ matrix.os }}-${{ matrix.compiler }}-${{ env.INTEL_ONEAPI_VERSION }}
- name: Install Intel oneAPI Fortran compiler
if: matrix.compiler == 'ifort' && steps.cache.outputs.cache-hit != 'true'
run: |
# download the key to system keyring
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
| gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
# add signed entry to apt sources and configure the APT client to use Intel repository:
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
# update package index and install Fortran compiler
sudo apt update
sudo apt-get install intel-oneapi-compiler-fortran-$INTEL_ONEAPI_VERSION
# set environment variables and make them persistent across steps
. /opt/intel/oneapi/setvars.sh
env | grep oneapi >> $GITHUB_ENV
- name: Use existing Intel oneAPI Fortran compiler
if: matrix.compiler == 'ifort' && steps.cache.outputs.cache-hit == 'true'
run: |
# set environment variables and make them persistent across steps
. /opt/intel/oneapi/setvars.sh
env | grep oneapi >> $GITHUB_ENV
- name: Bootstrap
run: |
./Utilities/bootstrap
- name: Show version information
run: |
${{ matrix.compiler }} --version
- name: Build
run: |
make -j 2 FC=${{ matrix.compiler }}
- name: Run regular function tests
if: ${{ matrix.test_type == 'regular' }}
run: |
./HOHQMesh -test
- name: Run memory checks with Valgrind (only Linux)
if: ${{ matrix.os_name == 'linux' && matrix.test_type == 'valgrind' }}
run: |
sudo apt update
sudo apt-get install -y valgrind
valgrind --error-exitcode=1 -s ./HOHQMesh -test
# Enable tmate debugging of manually-triggered workflows if the input option was provided
- name: Setup tmate session for debugging
if: ${{ matrix.os == 'windows-latest' && github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled && always() }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 15
- name: Run tests for coverage
if: ${{ matrix.coverage }}
run: |
sudo apt-get install -y lcov
FC=${{ matrix.compiler }} ./Utilities/createcoverage
- uses: codecov/codecov-action@v4
if: ${{ matrix.coverage }}
with:
files: ./lcov.info
flags: unittests
name: codecov-umbrella
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} # now required for public repos
- name: Coveralls
if: ${{ matrix.coverage }}
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./lcov.info