Skip to content

Commit fe2989c

Browse files
Add workflows for testing serial cpu-only builds
1 parent 7b903ba commit fe2989c

File tree

5 files changed

+436
-1
lines changed

5 files changed

+436
-1
lines changed

.github/workflows/fprettify-lint.yml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: fprettify-lint
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
paths-ignore:
9+
- 'AUTHORS.md'
10+
- 'LICENSE.md'
11+
- 'README.md'
12+
pull_request:
13+
paths-ignore:
14+
- 'AUTHORS.md'
15+
- 'LICENSE.md'
16+
- 'README.md'
17+
18+
jobs:
19+
fprettify:
20+
name: fprettify-check
21+
runs-on: ubuntu-22.04
22+
strategy:
23+
fail-fast: false
24+
defaults:
25+
run:
26+
shell: bash
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v3
30+
31+
- name: Install fprettify
32+
run: |
33+
pip3 install fprettify
34+
35+
- name: Check for formatting differences (src/)
36+
run: |
37+
if [[ $(fprettify './src/' --config-file ./fprettify.config -d --recursive --case 1 1 1 1) ]]; then
38+
fprettify './src/' --config-file ./fprettify.config -d --recursive --case 1 1 1 1
39+
exit 1
40+
else
41+
echo "src/ linting passed!"
42+
fi
43+
44+
- name: Check for formatting differences (test/)
45+
run: |
46+
if [[ $(fprettify './test/' --config-file ./fprettify.config -d --recursive --case 1 1 1 1) ]]; then
47+
fprettify './test/' --config-file ./fprettify.config -d --recursive --case 1 1 1 1
48+
exit 1
49+
else
50+
echo "test/ linting passed!"
51+
fi
52+
53+
- name: Check for formatting differences (example/)
54+
run: |
55+
if [[ $(fprettify './example/' --config-file ./fprettify.config -d --recursive --case 1 1 1 1) ]]; then
56+
fprettify './example/' --config-file ./fprettify.config -d --recursive --case 1 1 1 1
57+
exit 1
58+
else
59+
echo "example/ linting passed!"
60+
fi
61+

.github/workflows/linux-gnu-cmake.yml

+127
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
name: linux-gnu-cmake
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
paths-ignore:
9+
- 'AUTHORS.md'
10+
- 'LICENSE.md'
11+
- 'README.md'
12+
pull_request:
13+
paths-ignore:
14+
- 'AUTHORS.md'
15+
- 'LICENSE.md'
16+
- 'README.md'
17+
18+
jobs:
19+
linux-tests:
20+
timeout-minutes: 15
21+
if: "!contains(github.event.head_commit.message, 'skip ci')"
22+
name: ${{ matrix.os }} - ${{ matrix.fcompiler }} - ${{ matrix.build_type }}
23+
runs-on: ${{ matrix.os }}
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
include:
28+
# Linux
29+
- os: ubuntu-22.04
30+
fcompiler: gfortran-9
31+
ccompiler: gcc-9
32+
shell: bash
33+
build_type: coverage
34+
memcheck: true
35+
36+
- os: ubuntu-22.04
37+
fcompiler: gfortran-9
38+
ccompiler: gcc-9
39+
shell: bash
40+
build_type: debug
41+
memcheck: false
42+
43+
- os: ubuntu-22.04
44+
fcompiler: gfortran-10
45+
ccompiler: gcc-10
46+
shell: bash
47+
build_type: debug
48+
memcheck: false
49+
50+
- os: ubuntu-22.04
51+
fcompiler: gfortran-11
52+
ccompiler: gcc-11
53+
shell: bash
54+
build_type: debug
55+
memcheck: false
56+
57+
- os: ubuntu-22.04
58+
fcompiler: gfortran-12
59+
ccompiler: gcc-12
60+
shell: bash
61+
build_type: debug
62+
memcheck: false
63+
64+
65+
defaults:
66+
run:
67+
shell: ${{ matrix.shell }}
68+
steps:
69+
- name: Checkout repository
70+
uses: actions/checkout@v3
71+
72+
73+
- name: Show version information
74+
run: |
75+
${{ matrix.fcompiler }} --version
76+
${{ matrix.ccompiler }} --version
77+
78+
- name: Build with Cmake
79+
run: |
80+
mkdir build
81+
cd build
82+
FC=${{ matrix.fcompiler }} CC=${{ matrix.ccompiler }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ../
83+
make VERBOSE=1
84+
85+
- name: Initialize coverage counters
86+
if: ${{ matrix.build_type == 'coverage' }}
87+
run: |
88+
sudo apt-get update -y && sudo apt-get install lcov
89+
lcov --no-external \
90+
--directory /home/runner/work/self \
91+
--zerocounters
92+
93+
- name: Run ctests
94+
run: |
95+
cd build/test
96+
ctest || ctest --rerun-failed --output-on-failure
97+
98+
- name: Create coverage report
99+
if: ${{ matrix.build_type == 'coverage' }}
100+
run: |
101+
102+
lcov --no-external \
103+
--capture \
104+
--directory /home/runner/work/self \
105+
--exclude '*/test/*' \
106+
--output-file /home/runner/work/lcov.info
107+
108+
- name: codecov
109+
if: ${{ matrix.build_type == 'coverage' }}
110+
uses: codecov/codecov-action@v3
111+
env:
112+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
113+
with:
114+
files: /home/runner/work/lcov.info
115+
flags: ctests
116+
117+
- name: Run memory checks with Valgrind (only Linux and GNU compilers)
118+
if: ${{ matrix.memcheck }}
119+
run: |
120+
sudo apt-get install -y valgrind
121+
for f in $(find ./build/test/ -executable -type f)
122+
do
123+
echo $f
124+
valgrind --undef-value-errors=no --error-exitcode=1 -s $f -A
125+
done
126+
127+
+132
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
name: linux-intel-cmake
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
paths-ignore:
9+
- 'AUTHORS.md'
10+
- 'LICENSE.md'
11+
- 'README.md'
12+
pull_request:
13+
paths-ignore:
14+
- 'AUTHORS.md'
15+
- 'LICENSE.md'
16+
- 'README.md'
17+
18+
env:
19+
# Modify this variable to change the ifort compiler version - do NOT hardcode the version
20+
# anywhere else!
21+
INTEL_ONEAPI_VERSION: 2023.2.1
22+
23+
jobs:
24+
linux-tests:
25+
timeout-minutes: 8
26+
if: "!contains(github.event.head_commit.message, 'skip ci')"
27+
name: ${{ matrix.os }} - ${{ matrix.fcompiler }} - ${{ matrix.build_type }}
28+
runs-on: ${{ matrix.os }}
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
include:
33+
- os: ubuntu-22.04
34+
fcompiler: ifx
35+
ccompiler: icx-cc
36+
shell: bash
37+
build_type: debug
38+
memcheck: false
39+
40+
- os: ubuntu-22.04
41+
fcompiler: ifort
42+
ccompiler: icx-cc
43+
shell: bash
44+
build_type: debug
45+
memcheck: false
46+
47+
48+
defaults:
49+
run:
50+
shell: ${{ matrix.shell }}
51+
steps:
52+
- name: Checkout repository
53+
uses: actions/checkout@v3
54+
55+
- name: Install Intel oneAPI Fortran compiler
56+
run: |
57+
# download the key to system keyring
58+
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
59+
| gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
60+
61+
# add signed entry to apt sources and configure the APT client to use Intel repository:
62+
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
63+
64+
# update package index and install Fortran compiler
65+
sudo apt update -y
66+
sudo apt-get -y install intel-oneapi-compiler-fortran-$INTEL_ONEAPI_VERSION intel-oneapi-dpcpp-cpp-$INTEL_ONEAPI_VERSION
67+
68+
# set environment variables and make them persistent across steps
69+
. /opt/intel/oneapi/setvars.sh
70+
env | grep oneapi >> $GITHUB_ENV
71+
72+
- name: Use existing Intel oneAPI Fortran compiler
73+
run: |
74+
# set environment variables and make them persistent across steps
75+
. /opt/intel/oneapi/setvars.sh
76+
env | grep oneapi >> $GITHUB_ENV
77+
78+
- name: Show version information
79+
run: |
80+
${{ matrix.fcompiler }} --version
81+
${{ matrix.ccompiler }} --version
82+
83+
- name: Build with Cmake
84+
run: |
85+
mkdir build
86+
cd build
87+
FC=${{ matrix.fcompiler }} CC=${{ matrix.ccompiler }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ../
88+
make VERBOSE=1
89+
90+
- name: Initialize coverage counters
91+
if: ${{ matrix.build_type == 'coverage' }}
92+
run: |
93+
sudo apt-get update -y && sudo apt-get install lcov
94+
lcov --no-external \
95+
--directory /home/runner/work/feq-parse \
96+
--zerocounters
97+
98+
- name: Run ctests
99+
run: |
100+
cd build/test
101+
ctest || ctest --rerun-failed --output-on-failure
102+
103+
- name: Create coverage report
104+
if: ${{ matrix.build_type == 'coverage' }}
105+
run: |
106+
107+
lcov --no-external \
108+
--capture \
109+
--directory /home/runner/work/feq-parse \
110+
--exclude '*/test/*' \
111+
--output-file /home/runner/work/lcov.info
112+
113+
- name: codecov
114+
if: ${{ matrix.build_type == 'coverage' }}
115+
uses: codecov/codecov-action@v3
116+
env:
117+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
118+
with:
119+
files: /home/runner/work/lcov.info
120+
flags: ctests
121+
122+
- name: Run memory checks with Valgrind (only Linux and GNU compilers)
123+
if: ${{ matrix.memcheck }}
124+
run: |
125+
sudo apt-get install -y valgrind
126+
for f in $(find ./build/test/ -executable -type f)
127+
do
128+
echo $f
129+
valgrind --undef-value-errors=no --error-exitcode=1 -s $f -A
130+
done
131+
132+
+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: windows-gnu-cmake
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
paths-ignore:
9+
- 'AUTHORS.md'
10+
- 'LICENSE.md'
11+
- 'README.md'
12+
pull_request:
13+
paths-ignore:
14+
- 'AUTHORS.md'
15+
- 'LICENSE.md'
16+
- 'README.md'
17+
18+
env:
19+
# Modify this variable to change the ifort compiler version - do NOT hardcode the version
20+
# anywhere else!
21+
INTEL_ONEAPI_VERSION: 2023.2.1
22+
23+
jobs:
24+
windows-tests:
25+
timeout-minutes: 8
26+
if: "!contains(github.event.head_commit.message, 'skip ci')"
27+
name: ${{ matrix.os }} - ${{ matrix.fcompiler }} - ${{ matrix.build_type }}
28+
runs-on: ${{ matrix.os }}
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
include:
33+
34+
# Windows
35+
- os: windows-latest
36+
fcompiler: gfortran
37+
ccompiler: gcc
38+
shell: 'msys2 {0}'
39+
build_type: debug
40+
41+
42+
defaults:
43+
run:
44+
shell: ${{ matrix.shell }}
45+
steps:
46+
- name: Checkout repository
47+
uses: actions/checkout@v3
48+
49+
- name: Install packages
50+
uses: msys2/setup-msys2@v2
51+
if: ${{ matrix.os == 'windows-latest' }}
52+
with:
53+
update: true
54+
install: git base-devel mingw-w64-x86_64-toolchain cmake mingw-w64-x86_64-gcc-fortran mingw-w64-x86_64-fpm
55+
56+
- name: Show version information
57+
run: |
58+
${{ matrix.fcompiler }} --version
59+
${{ matrix.ccompiler }} --version
60+
61+
- name: Build with Cmake
62+
run: |
63+
mkdir build
64+
cd build
65+
FC=${{ matrix.fcompiler }} CC=${{ matrix.ccompiler }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ../
66+
make VERBOSE=1
67+
68+
- name: Run ctests
69+
run: |
70+
cd build/test
71+
ctest || ctest --rerun-failed --output-on-failure
72+

0 commit comments

Comments
 (0)