-
-
Notifications
You must be signed in to change notification settings - Fork 5
120 lines (109 loc) · 3.51 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
name: ci
on:
push:
branches:
- master
- main
paths-ignore:
- 'AUTHORS.md'
- 'LICENSE.md'
- 'README.md'
pull_request:
paths-ignore:
- 'AUTHORS.md'
- 'LICENSE.md'
- 'README.md'
jobs:
test:
if: "!contains(github.event.head_commit.message, 'skip ci')"
name: ${{ matrix.os_name }} - ${{ matrix.compiler }} - ${{ matrix.build_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
build_type: coverage
- os: ubuntu-22.04
os_name: linux
compiler: gfortran-10
shell: bash
build_type: debug
- os: ubuntu-22.04
os_name: linux
compiler: gfortran-11
shell: bash
build_type: debug
- os: ubuntu-22.04
os_name: linux
compiler: gfortran-10
shell: bash
build_type: fpm
defaults:
run:
shell: ${{ matrix.shell }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
# - 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
- name: Show version information
run: |
${{ matrix.compiler }} --version
- name: Build with Cmake
if: ${{ matrix.build_type != 'fpm' }}
run: |
cd build
FC=${{ matrix.compiler }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ../
make VERBOSE=1
- name: fpm tests
if: ${{ matrix.build_type == 'fpm' }}
run: |
wget https://github.com/fortran-lang/fpm/releases/download/v0.9.0/fpm-0.9.0-linux-x86_64
chmod +x ./fpm-0.9.0-linux-x86_64 && mv ./fpm-0.9.0-linux-x86_64 fpm
./fpm install
./fpm test
./fpm run --example "*"
- name: Initialize coverage counters
if: ${{ matrix.build_type == 'coverage' }}
run: |
sudo apt-get update -y && sudo apt-get install lcov
lcov --no-external \
--directory /home/runner/work/feq-parse \
--zerocounters
- name: Run ctests
if: ${{ matrix.build_type != 'fpm' }}
run: |
cd build/test
ctest || ctest --rerun-failed --output-on-failure
- name: Create coverage report
if: ${{ matrix.build_type == 'coverage' }}
run: |
lcov --no-external \
--capture \
--directory /home/runner/work/feq-parse \
--exclude '*/test/*' \
--output-file /home/runner/work/lcov.info
- name: codecov
if: ${{ matrix.build_type == 'coverage' }}
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: /home/runner/work/lcov.info
flags: ctests
- name: Run memory checks with Valgrind (only Linux)
if: ${{ matrix.os_name == 'linux' && matrix.test_type == 'valgrind' }}
run: |
sudo apt-get install -y valgrind
valgrind --error-exitcode=1 -s ./test/testsuite -A