-
Notifications
You must be signed in to change notification settings - Fork 2
195 lines (189 loc) · 6.54 KB
/
Copy pathci.yml
File metadata and controls
195 lines (189 loc) · 6.54 KB
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
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:
env:
# Modify this variable to change the ifx compiler version - do NOT hardcode the version
# anywhere else!
INTEL_ONEAPI_VERSION: 2025.2
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-10
cmake_generator: Unix Makefiles
shell: bash
test_type: regular
coverage: true
- os: ubuntu-22.04
os_name: linux
compiler: gfortran-10
cmake_generator: Unix Makefiles
shell: bash
test_type: valgrind
coverage: false
- os: ubuntu-24.04
os_name: linux
compiler: gfortran-13
cmake_generator: Unix Makefiles
shell: bash
test_type: regular
coverage: false
- os: ubuntu-24.04
os_name: linux
compiler: gfortran-13
cmake_generator: Unix Makefiles
shell: bash
test_type: valgrind
coverage: false
- os: ubuntu-26.04
os_name: linux
compiler: gfortran-15
cmake_generator: Unix Makefiles
shell: bash
test_type: regular
coverage: false
- os: ubuntu-26.04
os_name: linux
compiler: gfortran-15
cmake_generator: Unix Makefiles
shell: bash
test_type: valgrind
coverage: false
- os: ubuntu-latest
os_name: linux
compiler: ifx
cmake_generator: Unix Makefiles
shell: bash
test_type: regular
coverage: false
# macOS
- os: macos-latest
os_name: macos
compiler: gfortran-13
cmake_generator: Unix Makefiles
shell: bash
test_type: regular
coverage: false
- os: macos-latest
os_name: macos
compiler: gfortran-15
cmake_generator: Unix Makefiles
shell: bash
test_type: regular
coverage: false
# Windows
- os: windows-latest
os_name: windows
compiler: gfortran
cmake_generator: MinGW Makefiles
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@v7
# - name: Add msbuild to PATH
# if: ${{ matrix.os == 'windows-latest' }}
# uses: microsoft/setup-msbuild@v1.0.2
- 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 mingw-w64-x86_64-cmake
- uses: actions/cache@v6
if: matrix.compiler == 'ifx'
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 == 'ifx' && 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 == 'ifx' && 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: Verify CMake build
run: |
mkdir build && cd build
cmake -G "${{ matrix.cmake_generator }}" ../
make
env:
FC: ${{ matrix.compiler }}
- name: Verify regular build
run: |
cd makeLibrary
make -j 2 FC=${{ matrix.compiler }}
- name: Build test suite
run: |
cd TestSuiteBuild
make -j 2 FC=${{ matrix.compiler }}
- name: Run tests
if: ${{ matrix.test_type == 'regular' }}
run: |
cd TestSuiteBuild
./runSuite
- 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
cd TestSuiteBuild
valgrind --error-exitcode=1 -s ./runSuite
- name: Run tests for coverage
if: ${{ matrix.coverage }}
run: |
sudo apt-get install -y lcov
cd TestSuiteBuild
FC=${{ matrix.compiler }} ./createcoverage
- uses: codecov/codecov-action@v7
if: ${{ matrix.coverage }}
with:
files: ./TestSuiteBuild/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: ./TestSuiteBuild/lcov.info