Skip to content

Commit d0f8481

Browse files
committed
ci: add workaround for generated file during syntax check stage
When the syntax check is running, CMake has not executed yet. Thus the file defaults.hpp does not exist yet. So the file is created for the syntax check and deleted afterwards.
1 parent bd2e21f commit d0f8481

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.gitlab-ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,14 @@ build_gcc:
1515
# way when linting.
1616
- rm -rf ./libstriezel/archive ./libstriezel/common/graphics ./libstriezel/common/gui ./libstriezel/tests
1717
script:
18+
# Syntax check of C++ files. The defaults.hpp file is generated by CMake
19+
# during the build and does not exist yet, so we temporarily copy the
20+
# incomplete template file to its place - and remove it after the syntax
21+
# check is done.
22+
- cp ./code/templates/defaults.prototype.hpp ./code/templates/defaults.hpp
1823
- ./ci/cpplint.sh
24+
- unlink ./code/templates/default.hpp
25+
# build and run tests
1926
- mkdir ./build
2027
- cd ./build
2128
- cmake ../
@@ -33,7 +40,14 @@ build_clang:
3340
- rm -rf ./libstriezel/archive ./libstriezel/common/graphics ./libstriezel/common/gui ./libstriezel/tests
3441
- export CC=clang && export CXX=clang++
3542
script:
43+
# Syntax check of C++ files. The defaults.hpp file is generated by CMake
44+
# during the build and does not exist yet, so we temporarily copy the
45+
# incomplete template file to its place - and remove it after the syntax
46+
# check is done.
47+
- cp ./code/templates/defaults.prototype.hpp ./code/templates/defaults.hpp
3648
- ./ci/cpplint.sh
49+
- unlink ./code/templates/default.hpp
50+
# build and run tests
3751
- mkdir ./build
3852
- cd ./build
3953
- cmake ../

0 commit comments

Comments
 (0)