33 pull_request :
44 release :
55 types : [published]
6+
67 push :
78 tags :
89 branches :
910 - main
1011 - develop
1112
1213env :
13- # Conan cache environment variables
14- CONAN_SYSREQUIRES_MODE : enabled
15- CONAN_USER_HOME : " ${{ github.workspace }}/conan-cache"
16- CONAN_USER_HOME_SHORT : " ${{ github.workspace }}/conan-cache/short"
14+ CLANG_TIDY_VERSION : " 15.0.2"
15+ VERBOSE : 1
1716
1817jobs :
1918 Test :
@@ -34,17 +33,19 @@ jobs:
3433 - macos-10.15
3534 - windows-2019
3635 compiler :
37- # you can specify the version after `-` like "llvm-13 .0.0 ".
38- - llvm-13 .0.0
36+ # you can specify the version after `-` like "llvm-15 .0.2 ".
37+ - llvm-15 .0.2
3938 - gcc-11
4039 generator :
4140 - " Ninja Multi-Config"
4241 build_type :
4342 - Release
4443 - Debug
45- developer_mode :
44+ package_maintainer_mode :
4645 - ON
4746 - OFF
47+ build_shared :
48+ - OFF
4849
4950 exclude :
5051 # mingw is determined by this author to be too buggy to support
@@ -56,50 +57,107 @@ jobs:
5657 # if you try to use a compiler that does not have gcov set
5758 - compiler : gcc-11
5859 gcov_executable : gcov
59- - compiler : llvm-13.0.0
60+ enable_ipo : On
61+
62+ - compiler : llvm-15.0.2
63+ enable_ipo : Off
6064 gcov_executable : " llvm-cov gcov"
6165
66+ - os : macos-10.15
67+ enable_ipo : Off
68+ enable_cppcheck : OFF
69+ enable_clang_tidy : OFF
70+
71+ - os : ubuntu-20.04
72+ enable_clang_tidy : On
73+ enable_cppcheck : On
74+
75+
6276 # Set up preferred package generators, for given build configurations
6377 - build_type : Release
64- developer_mode : OFF
78+ package_maintainer_mode : OFF
6579 package_generator : TBZ2
6680
81+ # This exists solely to make sure a non-multiconfig build works
82+ - os : ubuntu-20.04
83+ compiler : gcc-11
84+ generator : " Unix Makefiles"
85+ build_type : Debug
86+ gcov_executable : gcov
87+ package_maintainer_mode : On
88+ enable_ipo : Off
89+ enable_clang_tidy : On
90+ enable_cppcheck : On
91+
6792
93+ # Windows msvc builds
6894 - os : windows-2022
6995 compiler : msvc
7096 generator : " Visual Studio 17 2022"
7197 build_type : Debug
72- developer_mode : On
98+ package_maintainer_mode : On
99+ enable_ipo : On
100+ enable_clang_tidy : Off
101+ enable_cppcheck : Off
102+
103+
73104 - os : windows-2022
74105 compiler : msvc
75106 generator : " Visual Studio 17 2022"
76107 build_type : Release
77- developer_mode : On
108+ package_maintainer_mode : On
109+ enable_ipo : On
110+ enable_clang_tidy : Off
111+ enable_cppcheck : Off
112+
113+
78114 - os : windows-2022
79115 compiler : msvc
80116 generator : " Visual Studio 17 2022"
81117 build_type : Debug
82- developer_mode : Off
118+ package_maintainer_mode : Off
119+ enable_clang_tidy : Off
120+ enable_cppcheck : Off
121+
122+
83123 - os : windows-2022
84124 compiler : msvc
85125 generator : " Visual Studio 17 2022"
86126 build_type : Release
87- developer_mode : Off
127+ package_maintainer_mode : Off
88128 package_generator : ZIP
129+ enable_clang_tidy : Off
130+ enable_cppcheck : Off
89131
90132
133+ - os : windows-2022
134+ compiler : msvc
135+ generator : " Visual Studio 17 2022"
136+ build_type : Release
137+ package_maintainer_mode : On
138+ enable_ipo : On
139+ build_shared : On
140+ enable_clang_tidy : Off
141+ enable_cppcheck : Off
91142
92143
93144
94145 steps :
146+ - name : Check for llvm version mismatches
147+ if : ${{ contains(matrix.compiler, 'llvm') && !contains(matrix.compiler, env.CLANG_TIDY_VERSION) }}
148+ uses : actions/github-script@v3
149+ with :
150+ script : |
151+ core.setFailed('There is a mismatch between configured llvm compiler and clang-tidy version chosen')
152+
95153 - uses : actions/checkout@v2
96154
97155 - name : Setup Cache
98156 uses : ./.github/actions/setup_cache
99157 with :
100158 compiler : ${{ matrix.compiler }}
101159 build_type : ${{ matrix.build_type }}
102- developer_mode : ${{ matrix.developer_mode }}
160+ package_maintainer_mode : ${{ matrix.package_maintainer_mode }}
103161 generator : ${{ matrix.generator }}
104162
105163 - name : Setup Cpp
@@ -110,25 +168,19 @@ jobs:
110168
111169 cmake : true
112170 ninja : true
113- conan : true
114171 vcpkg : false
115172 ccache : true
116- clangtidy : true
173+ clangtidy : ${{ env.CLANG_TIDY_VERSION }}
174+
117175
118176 cppcheck : true
119177
120- gcovr : 5.0
178+ gcovr : true
121179 opencppcoverage : true
122180
123- - name : Cleanup Conan system packages (they are not properly cached)
124- run : |
125- conan remove -f '*/system'
126-
127- # make sure coverage is only enabled for Debug builds, since it sets -O0 to make sure coverage
128- # has meaningful results
129181 - name : Configure CMake
130182 run : |
131- cmake -S . -B ./build -G "${{matrix.generator}}" - DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} -DENABLE_DEVELOPER_MODE :BOOL=${{matrix.developer_mode }} -DOPT_ENABLE_COVERAGE :BOOL=${{ matrix.build_type == 'Debug' }} -DGIT_SHA:STRING=${{ github.sha }}
183+ cmake -S . -B ./build -G "${{matrix.generator}}" -Dtravels_ENABLE_CLANG_TIDY:BOOL=${{ matrix.enable_clang_tidy }} -Dtravels_ENABLE_CPPCHECK:BOOL=${{ matrix.enable_cppcheck }} -Dtravels_ENABLE_IPO=${{matrix.enable_ipo }} - DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} -Dtravels_PACKAGING_MAINTAINER_MODE :BOOL=${{matrix.package_maintainer_mode }} -Dtravels_ENABLE_COVERAGE :BOOL=${{ matrix.build_type == 'Debug' }} -DGIT_SHA:STRING=${{ github.sha }}
132184
133185 - name : Build
134186 # Execute the build. You can specify a specific target with "--target <NAME>"
@@ -156,6 +208,15 @@ jobs:
156208 run : |
157209 cpack -C ${{matrix.build_type}} -G ${{matrix.package_generator}}
158210
211+ - name : Publish Snapshot Release
212+ uses : softprops/action-gh-release@v1
213+ if : ${{ (github.ref == 'refs/heads/main') && matrix.package_generator != '' }}
214+ with :
215+ tag_name : " snapshot-${{ github.sha }}"
216+ files : |
217+ build/*-*${{ matrix.build_type }}*-*.*
218+
219+
159220 - name : Publish Tagged Release
160221 uses : softprops/action-gh-release@v1
161222 if : ${{ startsWith(github.ref, 'refs/tags/') && matrix.package_generator != '' }}
0 commit comments