-
Notifications
You must be signed in to change notification settings - Fork 40
140 lines (117 loc) · 3.98 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: CI
on:
push:
pull_request:
release:
types: [published]
jobs:
ci:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
name:
[ubuntu-gcc-11, ubuntu-clang-13, macos-apple-clang, windows-msvc-19]
include:
- name: ubuntu-gcc-11
os: ubuntu-22.04
compiler: g++
compiler-version: 11
compiler-name-conan: gcc
- name: ubuntu-clang-13
os: ubuntu-22.04
compiler: clang++
compiler-version: "13"
compiler-name-conan: clang
- name: macos-apple-clang
os: macos-latest
compiler-cppstd: "gnu17"
- name: windows-msvc-19
os: windows-2019
configure-preset: "ci-windows-msvc2019"
build-preset: "ci-msvc2019-debug"
steps:
- uses: actions/checkout@v4
- name: dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt install shunit2 ninja-build python3-setuptools python3-pip -y
sudo pip3 install conan
- name: dependencies (macos)
if: runner.os == 'macOS'
run: |
brew install shunit2 ninja conan coreutils
- name: dependencies (windows)
if: runner.os == 'Windows'
run: |
pip install conan
curl -L0 https://github.com/kward/shunit2/archive/v2.1.7.zip --output shunit2.zip
unzip -j -n shunit2.zip
- name: set-compiler-env
run: |
if [ "${{ matrix.compiler }}" != "" ]; then
echo "CXX=${{ matrix.compiler }}-${{ matrix.compiler-version }}" >> $GITHUB_ENV
fi
shell: bash
- name: conan-profile
run: |
conan --version
conan profile detect --force
if [ "${{ matrix.compiler-name-conan }}" != "" ]; then
sed -i.bak -e 's/compiler=.*/compiler=${{ matrix.compiler-name-conan }}/g' ~/.conan2/profiles/default
fi
if [ "${{ matrix.compiler-version }}" != "" ]; then
sed -i.bak -e 's/compiler.version=[0-9]\+/compiler.version=${{ matrix.compiler-version }}/g' ~/.conan2/profiles/default
fi
if [ "${{ matrix.compiler-cppstd }}" != "" ]; then
sed -i.bak -e 's/compiler.cppstd=gnu[0-9]\+/compiler.cppstd=${{ matrix.compiler-cppstd }}/g' ~/.conan2/profiles/default
fi
cat ~/.conan2/profiles/default
shell: bash
- name: cmake-configure-debug
run: |
conan install . --output-folder=build --build=missing --settings=build_type=Debug
if [ "${{ matrix.configure-preset }}" != "" ]; then
cmake --preset=${{ matrix.configure-preset }}
else
cmake --preset=ci-ninja-debug
fi
shell: bash
- name: build-debug
run: |
if [ "${{ matrix.build-preset }}" != "" ]; then
cmake --build ./build --preset=${{ matrix.build-preset }}
else
cmake --build ./build
fi
shell: bash
- name: ctest
run: ctest -C Debug
working-directory: ./build
- name: installation-tests
if: runner.os == 'Linux' || runner.os == 'macOs'
run: |
./test/installation-tests.sh
shell: bash
- name: program-termination-tests
if: runner.os == 'Linux' || runner.os == 'macOs'
run: |
./test/compilation-tests.sh
version-consistency-check:
if: github.event.action == 'published' || github.ref != 'refs/heads/main'
needs: ci
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt install shunit2 python3-setuptools python3-pip -y
sudo pip3 install conan
- name: version-consistency
run: |
git fetch --tags --force
./test/version-consistency.sh