-
Notifications
You must be signed in to change notification settings - Fork 2
141 lines (139 loc) · 4.69 KB
/
ci.yml
File metadata and controls
141 lines (139 loc) · 4.69 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
name: CI
on:
push:
branches:
- main
paths-ignore:
- 'LICENSE.md'
- 'README.md'
pull_request:
paths-ignore:
- '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
jobs:
test:
if: "!contains(github.event.head_commit.message, 'skip ci')"
name: ${{ matrix.os }} - ${{ matrix.test_type }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# Linux
- os: ubuntu-latest
arch: x64
shell: bash
test_type: regular
julia_version: 1.9
- os: ubuntu-latest
arch: x64
shell: bash
test_type: coverage
julia_version: 1.9
# - os: ubuntu-latest
# arch: x64
# shell: bash
# test_type: valgrind
# julia_version: 1.9
# macOS
# - os: macos-latest
# arch: x64
# shell: bash
# test_type: regular
# julia_version: 1.9
# Windows
# - os: windows-latest
# arch: x64
# shell: 'msys2 {0}'
# test_type: regular
# julia_version: 1.9
# 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@v3
- uses: msys2/setup-msys2@v2
if: ${{ matrix.os == 'windows-latest' }}
with:
update: true
install: git base-devel mingw-w64-x86_64-toolchain
- name: Install Julia
uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.julia_version }}
arch: ${{ matrix.arch }}
- name: Show Julia version information
run: julia -e 'using InteractiveUtils; versioninfo(verbose=true)'
- name: Install MPI
run: |
sudo apt-get install -y openmpi-bin libopenmpi-dev
- name: Build (regular)
if: ${{ matrix.test_type == 'regular' }}
run: |
mkdir build
cd build
cmake ..
make -j 2
- name: Build (coverage)
if: ${{ matrix.test_type == 'coverage' }}
run: |
mkdir build
cd build
cmake .. -DCMAKE_C_FLAGS="-cpp --coverage -O0" \
-DCMAKE_Fortran_FLAGS="-cpp --coverage -O0" \
-DCMAKE_EXE_LINKER_FLAGS="--coverage" \
-DCMAKE_SHARED_LINKER_FLAGS="--coverage"
make -j 2
- name: Set up Julia project directory
run: |
mkdir run
cd run
julia --project=. -e 'using Pkg; Pkg.develop(path="../LibTrixi.jl"); Pkg.instantiate()'
cp ../LibTrixi.jl/examples/libelixir_demo.jl .
- name: Install coverage tools
if: ${{ matrix.test_type == 'coverage' }}
run: |
sudo apt-get install -y lcov
- name: Run regular function tests
if: ${{ matrix.test_type == 'regular' }}
run: |
cd run
../build/examples/simple_trixi_controller . libelixir_demo.jl
- name: Run memory checks with Valgrind
if: ${{ matrix.test_type == 'valgrind' }}
run: |
sudo apt-get install -y valgrind
cd run
valgrind --error-exitcode=1 -s ../build/examples/simple_trixi_controller . libelixir_demo.jl
- name: Run coverage tests
if: ${{ matrix.test_type == 'coverage' }}
run: |
cd run
lcov --directory ../build --zerocounters
../build/examples/simple_trixi_controller . libelixir_demo.jl
lcov --directory ../build --capture --output-file lcov.info
- uses: codecov/codecov-action@v3
if: ${{ matrix.test_type == 'coverage' }}
with:
files: ./run/lcov.info
flags: unittests
name: codecov-umbrella
- name: Coveralls
if: ${{ matrix.test_type == 'coverage' }}
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./run/lcov.info
# Enable tmate debugging of manually-triggered workflows if the input option was provided
- name: Setup tmate session for debugging
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled && always() }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 15