diff options
author | Thomas Haller <thaller@redhat.com> | 2020-11-10 10:47:04 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-11-10 13:51:29 +0100 |
commit | 7fa122394cd8036913b6082646783c37c8d092b2 (patch) | |
tree | 2c3e1a3fd14a06469e6866400baaecf9870f4bd9 /.gitlab-ci/ci.template | |
parent | a5d92d78c628e8c5771c57f7818013146a05ae96 (diff) | |
download | NetworkManager-7fa122394cd8036913b6082646783c37c8d092b2.tar.gz |
gitlab-ci: merge "check-ci-script" test with static checks
Certain parts of the code are entirely generated or must follow
a certain format that can be enforced by a tool. These invariants
must never fail:
- ci-fairy generate-template (check-ci-script)
- black python formatting
- clang-format C formatting
- msgfmt -vs
On the other hand, we also have a checkpatch script that checks
the current patch for common errors. These are heuristics and
only depend on the current patch (contrary to the previous type
that depend on the entire source tree).
Refactor the gitlab-ci tests:
- split "checkpatch" into "check-patch" and "check-tree".
- merge the "check-ci-script" test into "check-tree".
Diffstat (limited to '.gitlab-ci/ci.template')
-rw-r--r-- | .gitlab-ci/ci.template | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/.gitlab-ci/ci.template b/.gitlab-ci/ci.template index eb8b67502e..e2291bf036 100644 --- a/.gitlab-ci/ci.template +++ b/.gitlab-ci/ci.template @@ -49,26 +49,9 @@ variables: - NetworkManager-1*.tar.xz - NetworkManager-1*.src.rpm -################################################################# -# # -# prep stage # -# # -################################################################# - -# Re-generate the .gitlab-ci.yml file and make sure it's the one currently checked in -# If this job fails, re-generate the gitlab-ci.yml script and git commit it. -# -check-ci-script: - image: golang:alpine - stage: prep - before_script: - - apk add python3 py-pip git - - pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates - script: - - ci-fairy generate-template - - git diff --exit-code && exit 0 || true - - echo "Committed gitlab-ci.yml differs from generated gitlab-ci.yml. Please verify" - - exit 1 +.nm_artifacts_undo: + artifacts: + paths: [] ################################################################# # # @@ -192,17 +175,26 @@ t_{{distro.name}}:{{version}}: # specific jobs # # # ################################################################# -checkpatch: + +check-patch: extends: - {# run checkpatch on the same image that generates pages because why not #} - t_{{pages_build.name}}:{{pages_build.version}} + - .nm_artifacts_undo + stage: test + script: + - date '+%Y%m%d-%H%M%S'; NM_CHECKPATCH_FETCH_UPSTREAM=1 contrib/scripts/checkpatch-feature-branch.sh + allow_failure: true + +check-tree: + extends: + - t_{{pages_build.name}}:{{pages_build.version}} + - .nm_artifacts_undo stage: test script: - date '+%Y%m%d-%H%M%S'; black --check . examples/python/gi/nm-wg-set - date '+%Y%m%d-%H%M%S'; git ls-files -z -- 'po/*.po' | xargs -0 -n1 msgfmt -vc - date '+%Y%m%d-%H%M%S'; contrib/scripts/nm-code-format.sh - - date '+%Y%m%d-%H%M%S'; NM_CHECKPATCH_FETCH_UPSTREAM=1 contrib/scripts/checkpatch-feature-branch.sh - allow_failure: true + - date '+%Y%m%d-%H%M%S'; ci-fairy generate-template && git diff --exit-code pages: stage: deploy |