21
21
22
22
- name : Check formatting
23
23
run : |
24
- git fetch --depth=1 origin main
24
+ git fetch --depth=1 origin master
25
25
clang-format -style=file -output-replacements-xml $(git ls-files '*.cpp' '*.h' '*.ixx' '*.hpp') | grep "<replacement " && echo "Code is not properly formatted" && exit 1 || echo "All good"
26
26
27
27
build :
@@ -30,40 +30,48 @@ jobs:
30
30
if : github.event_name == 'push' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'run-ci'))
31
31
strategy :
32
32
matrix :
33
- os : [windows-latest, ubuntu-latest]
34
- compiler : [msvc, clang, gcc]
33
+ include :
34
+ - os : windows-latest
35
+ compiler : msvc
36
+ - os : windows-latest
37
+ compiler : clang
38
+ - os : ubuntu-latest
39
+ compiler : clang
40
+ - os : ubuntu-latest
41
+ compiler : gcc
35
42
36
43
steps :
37
44
- uses : actions/checkout@v3
38
45
39
46
- name : Setup CMake
40
47
uses : jwlawson/actions-setup-cmake@v2
48
+ with :
49
+ cmake-version : ' 3.27.0' # or whatever version you want
41
50
42
- - name : Setup compiler
51
+ - name : Install compiler on Ubuntu
52
+ if : matrix.os == 'ubuntu-latest'
43
53
run : |
44
- if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
45
- if [ "${{ matrix.compiler }}" == "clang" ]; then
46
- sudo apt-get install -y clang
47
- elif [ "${{ matrix.compiler }}" == "gcc" ]; then
48
- sudo apt-get install -y g++
49
- fi
54
+ sudo apt-get update
55
+ if [ "${{ matrix.compiler }}" == "clang" ]; then
56
+ sudo apt-get install -y clang
57
+ elif [ "${{ matrix.compiler }}" == "gcc" ]; then
58
+ sudo apt-get install -y g++
50
59
fi
51
60
shell : bash
52
61
53
62
- name : Configure CMake
54
63
run : |
55
64
mkdir build
56
65
cd build
66
+ GENERATOR="-G Ninja"
57
67
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
58
68
if [ "${{ matrix.compiler }}" == "clang" ]; then
59
- cmake -DCMAKE_CXX_COMPILER=clang++ ..
69
+ cmake $GENERATOR -DCMAKE_CXX_COMPILER=clang++ ..
60
70
elif [ "${{ matrix.compiler }}" == "gcc" ]; then
61
- cmake -DCMAKE_CXX_COMPILER=g++ ..
62
- else
63
- cmake ..
71
+ cmake $GENERATOR -DCMAKE_CXX_COMPILER=g++ ..
64
72
fi
65
73
else
66
- cmake ..
74
+ cmake $GENERATOR ..
67
75
fi
68
76
shell : bash
69
77
0 commit comments