-
Notifications
You must be signed in to change notification settings - Fork 40
137 lines (111 loc) · 3.71 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
name: CI
on:
push:
pull_request:
release:
types: [published]
jobs:
ci:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
name:
[ubuntu-gcc-9, ubuntu-clang-12, macos-apple-clang-11, windows-msvc-19]
include:
- name: ubuntu-gcc-9
os: ubuntu-22.04
compiler: g++
compiler-version: 9
compiler-name-conan: gcc
- name: ubuntu-clang-12
os: ubuntu-22.04
compiler: clang++
compiler-version: "12"
compiler-name-conan: clang
- name: macos-apple-clang-11
os: macos-11
- name: windows-msvc-19
os: windows-2019
configure-preset: "ci-windows-msvc2019"
build-preset: "ci-msvc2019-debug"
steps:
- uses: actions/checkout@v2
- 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 profile detect --force
if [ "${{ matrix.compiler-name-conan }}" != "" ]; then
sed -i 's/compiler=.*/compiler=${{ matrix.compiler-name-conan }}/g' ~/.conan2/profiles/default
fi
if [ "${{ matrix.compiler-version }}" != "" ]; then
sed -i 's/compiler.version=[0-9]\+/compiler.version=${{ matrix.compiler-version }}/g' ~/.conan2/profiles/default
fi
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@v2
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