-
Notifications
You must be signed in to change notification settings - Fork 7
142 lines (127 loc) · 4.26 KB
/
ci-baseline.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: github-Linux-baseline
on:
pull_request:
types: [ opened, reopened, synchronize ]
paths-ignore:
- 'logos/**'
- 'helper_scripts/**'
- 'docker_scripts/**'
- 'docs/**'
- '**/*.md'
push: # for direct quick fixes
branches:
- 'main'
- 'develop'
paths-ignore:
- 'logos/**'
- 'helper_scripts/**'
- 'docker_scripts/**'
- 'docs/**'
- '**/*.md'
concurrency:
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{github.event_name == 'pull_request'}}
jobs:
CI:
name: baseline
continue-on-error: false
strategy:
fail-fast: false
matrix:
image:
- fedora-clang-17
- fedora-gnu-13
- ubuntu-clang-14
- ubuntu-gnu-11
#- intel-oneapi-latest
build_type:
- Release
- Debug
cmake_extra_args:
- ''
include:
- image: ubuntu-clang-14
build_type: Release
cmake_extra_args: '-D CMAKE_CXX_STANDARD=20 -D PRESSIO_ENABLE_CXX20=ON'
runs-on: ubuntu-latest
container:
image: ghcr.io/pressio/${{ matrix.image }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
env:
eigen_version: 3.4.0
num_cpus: 2 # $(cat /proc/cpuinfo | grep processor -c)
PRESSIO_INSTALL_DIR: ${{ github.workspace }}/pressio_install
steps:
- uses: actions/checkout@v4
- name: Checkout pressio examples
uses: actions/checkout@v4
with:
repository: Pressio/pressio-templates-usage-as-library
path: examples
ref: add-compatibility-with-pressio-ops
- name: Checkout pressio-ops
uses: actions/checkout@v4
with:
repository: Pressio/pressio-ops
path: pressio-ops
ref: develop
- name: Preparing environment
run: |
wget https://gitlab.com/libeigen/eigen/-/archive/${{ env.eigen_version }}/eigen-${{ env.eigen_version }}.tar.gz \
&& mkdir -p /eigen \
&& tar -xf eigen-${{ env.eigen_version }}.tar.gz -C /eigen
- name: Configure
run: |
cmake -B builddir \
-D CMAKE_BUILD_TYPE:STRING=${{ matrix.build_type }} \
-D CMAKE_C_COMPILER=$CC \
-D CMAKE_CXX_COMPILER=$CXX \
-D CMAKE_CXX_FLAGS='-Wall -Werror' \
-D CMAKE_INSTALL_PREFIX:PATH=${PRESSIO_INSTALL_DIR} \
-D CMAKE_VERBOSE_MAKEFILE:BOOL=ON \
${{ matrix.cmake_extra_args }} \
-D PRESSIO_ENABLE_DEBUG_PRINT=ON \
-D PRESSIO_ENABLE_TESTS:BOOL=ON \
-D PRESSIO_ENABLE_TPL_EIGEN:BOOL=ON \
-D EIGEN_INCLUDE_DIR=/eigen/eigen-${{ env.eigen_version }} \
-D PRESSIO_OPS_INCLUDE_DIR=${GITHUB_WORKSPACE}/pressio-ops/include
- name: Build
run: |
cmake --build builddir --target install
- name: Example - include only
working-directory: examples
run: |
$CXX \
--std=c++17 \
-DPRESSIO_ENABLE_TPL_EIGEN \
-I/eigen/eigen-${{ env.eigen_version }} \
-I${GITHUB_WORKSPACE}/pressio-ops/include \
-I${PRESSIO_INSTALL_DIR}/include \
-c main.cpp \
&& $CXX --std=c++17 -o pressio-example main.o \
&& ./pressio-example
- name: Example - include only with embedded definitions
working-directory: examples
run: |
$CXX \
--std=c++17 \
-I/eigen/eigen-${{ env.eigen_version }} \
-I${GITHUB_WORKSPACE}/pressio-ops/include \
-I${PRESSIO_INSTALL_DIR}/include \
-c main_with_defines.cpp \
&& $CXX --std=c++17 -o pressio-example main.o \
&& ./pressio-example
- name: Run small tests
working-directory: builddir/tests/functional_small
run: |
ctest -j $num_cpus --output-on-failure
- name: Run medium tests
working-directory: builddir/tests/functional_medium
run: |
ctest -j $num_cpus --output-on-failure
- name: Run large tests
working-directory: builddir/tests/functional_large
run: |
ctest -j $num_cpus --output-on-failure