forked from yuravk/compose-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
23 lines (20 loc) · 937 Bytes
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
stages:
- lint
- validate
workflow:
rules:
# allow pipeline triggered by MR
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
lint:
image: registry.gitlab.com/centos/integration/containers/tmt:latest
stage: lint
script:
- tmt lint --failed-only
- find . -name '*.sh' -not -path "*/legacy/*" | xargs -n 1 shellcheck --severity=error --shell=bash
validate-cs9:
stage: validate
image: quay.io/testing-farm/cli:latest
when: manual
script:
- git diff --name-only $CI_MERGE_REQUEST_DIFF_BASE_SHA..$CI_COMMIT_SHA | awk -F/ '/tests/ { if ($2 == "legacy") { print "name:/" $1 "/" $2 "/" $3 } else { print "name:/" $1 "/" $2 } }' | sort -u | awk '{ if (NR > 1) {printf "|" $0 } else { printf $0 } }' > changed-tests-regex.log
- testing-farm request --git-ref $CI_MERGE_REQUEST_REF_PATH --git-url $CI_MERGE_REQUEST_PROJECT_URL --compose CentOS-Stream-9 --test-filter "$(cat changed-tests-regex.log)"