[Tarantool-patches] [PATCH 6/6] gitlab-ci: enable static analysis with luacheck

Sergey Bronnikov sergeyb at tarantool.org
Tue Apr 14 11:01:55 MSK 2020


Closes #4681
---

 .gitlab-ci.yml |  9 +++++++++
 .travis.mk     | 15 ++++++++++++++-
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index cd710027f..adbd892c8 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,4 +1,5 @@
 stages:
+  - static_analysis
   - test
   - perf
   - cleanup
@@ -96,6 +97,14 @@ variables:
   script:
     - ${GITLAB_MAKE} perf_run
 
+# Static Analysis
+
+luacheck:
+  <<: *docker_test_definition
+  stage: static_analysis
+  script:
+    - ${GITLAB_MAKE} test_debian_luacheck
+
 # Tests
 
 release:
diff --git a/.travis.mk b/.travis.mk
index f709a18b6..d917a1694 100644
--- a/.travis.mk
+++ b/.travis.mk
@@ -77,9 +77,13 @@ deps_buster_clang_8: deps_debian
 # Release
 
 build_debian:
-	cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_WERROR=ON ${CMAKE_EXTRA_PARAMS}
+	# ENABLE_DIST required to enable tarantoolctl for test_debian_luacheck
+	cmake . -DENABLE_DIST=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_WERROR=ON ${CMAKE_EXTRA_PARAMS}
 	make -j
 
+build_debian_install: build_debian
+	sudo make install
+
 test_debian_no_deps: build_debian
 	cd test && /usr/bin/python test-run.py --force $(TEST_RUN_EXTRA_PARAMS)
 
@@ -145,6 +149,15 @@ test_static_build: deps_debian_static
 test_static_docker_build:
 	docker build --network=host --build-arg RUN_TESTS=ON -f Dockerfile.staticbuild .
 
+# ###################
+# Static Analysis
+# ###################
+
+test_debian_luacheck: build_debian_install
+	tarantoolctl rocks install luacheck
+	# TODO: run in parallel with LuaLanes
+	.rocks/bin/luacheck --codes --config .luacheckrc .
+
 #######
 # OSX #
 #######
-- 
2.23.0


-- 
sergeyb@


More information about the Tarantool-patches mailing list