[gjs: 9/15] CI: Use variables expressions to skip linter and image builds
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs: 9/15] CI: Use variables expressions to skip linter and image builds
- Date: Fri, 20 Sep 2019 00:57:08 +0000 (UTC)
commit ac38c10f55ef997f5bd596cce741b4fb58a68dcd
Author: Philip Chimento <philip endlessm com>
Date: Thu Sep 19 17:27:42 2019 -0700
CI: Use variables expressions to skip linter and image builds
It uses fewer resources to not create a build in the first place, rather
than to spin it up only to skip it. This uses GitLab's variables
expressions to skip jobs if requested in the commit message.
.gitlab-ci.yml | 23 ++++++++++++++---------
test/test-ci.sh | 2 +-
2 files changed, 15 insertions(+), 10 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1e6a2a47..345abd9a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -210,8 +210,11 @@ cpplint:
TASK_ID: "cpplint"
CODECHECK: "CPPLINT"
except:
- - schedules
- - tags
+ refs:
+ - schedules
+ - tags
+ variables:
+ - $CI_COMMIT_MESSAGE =~ /\[skip cpplint\]/
eslint:
when: on_success
@@ -362,13 +365,6 @@ zeal_11:
# CI starts here. Previous messages are from GitLab Runner setup.
- *CI_header
- # Skip the build (if requested)
- - |
- if [[ -z "${CI_COMMIT_MESSAGE##*[skip images]*}" && -z "${CI_COMMIT_MESSAGE##*$NAME*}" ]]; then
- echo "== Nothing to do =="
- exit 0
- fi
-
# Build using the Dockerfile
- |
if [[ -n "${DOCKERFILE}" ]]; then
@@ -406,6 +402,9 @@ fedora.static-analysis:
DOCKER_TLS_CERTDIR: ""
DOCKERFILE: "test/extra/Dockerfile.fedora.static-analysis"
NAME: "fedora.static-analysis"
+ except:
+ variables:
+ - $CI_COMMIT_MESSAGE =~ /\[skip images\]/ && $CI_COMMIT_MESSAGE =~ /fedora.static-analysis/
SM60-gcc.fedora-dev:
<<: *create_docker_image
@@ -416,6 +415,9 @@ SM60-gcc.fedora-dev:
DOCKER_TLS_CERTDIR: ""
IMAGE: "fedora:rawhide"
NAME: "SM60-gcc.fedora-dev"
+ except:
+ variables:
+ - $CI_COMMIT_MESSAGE =~ /\[skip images\]/ && $CI_COMMIT_MESSAGE =~ /SM60-gcc.fedora-dev/
SM60-debug-gcc.fedora-dev:
<<: *create_docker_image
@@ -427,3 +429,6 @@ SM60-debug-gcc.fedora-dev:
DOCKER_TLS_CERTDIR: ""
IMAGE: "fedora:rawhide"
NAME: "SM60-debug-gcc.fedora-dev"
+ except:
+ variables:
+ - $CI_COMMIT_MESSAGE =~ /\[skip images\]/ && $CI_COMMIT_MESSAGE =~ /SM60-debug-gcc.fedora-dev/
diff --git a/test/test-ci.sh b/test/test-ci.sh
index 3ae47a39..f3913e84 100755
--- a/test/test-ci.sh
+++ b/test/test-ci.sh
@@ -231,7 +231,7 @@ elif [[ $1 == "GJS_COVERAGE" ]]; then
sed -e 's/<[^>]*>//g' "$save_dir"/coverage/index.html | tr -d ' \t' | grep -A3 -P '^Lines:$' | tr '\n'
' '; echo
echo '-----------------------------------------'
-elif [[ $1 == "CPPLINT" && "$log_message" != *'[skip cpplint]'* ]]; then
+elif [[ $1 == "CPPLINT" ]]; then
do_Print_Labels 'C/C++ Linter report '
cpplint --quiet $(find . -name \*.cpp -or -name \*.c -or -name \*.h | sort) 2>&1 >/dev/null | \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]