-
Notifications
You must be signed in to change notification settings - Fork 1
92 lines (90 loc) · 2.76 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
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:
jobs:
test:
if: "!contains(github.event.head_commit.message, 'skip ci')"
name: ${{ matrix.os }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
compiler: gfortran-10
cmake_generator: Unix Makefiles
shell: bash
- os: macos-latest
compiler: gfortran-11
cmake_generator: Unix Makefiles
shell: bash
- os: windows-latest
compiler: gfortran
cmake_generator: MinGW Makefiles
shell: 'msys2 {0}'
# Set default shell as suggested here: https://gh.neting.ccmunity/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 == '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
- 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
run: |
cd TestSuiteBuild
./runSuite
- name: Run tests for coverage
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt-get install -y lcov
cd TestSuiteBuild
FC=${{ matrix.compiler }} ./createcoverage
- uses: codecov/codecov-action@v4
if: ${{ matrix.os == 'ubuntu-latest' }}
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.os == 'ubuntu-latest' }}
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./TestSuiteBuild/lcov.info