include:
- remote: "https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/7ea696055e322cc7aa4bcbe5422b56a198c4bdff/templates/ci-fairy.yml"
image: registry.gitlab.gnome.org/gnome/gnome-shell/fedora/33:2020-11-17.0
stages:
- pre_review
- review
- build
default:
# Cancel jobs if newer commits are pushed to the branch
interruptible: true
# Auto-retry jobs in case of infra failures
retry:
max: 1
when:
- 'runner_system_failure'
- 'stuck_or_timeout_failure'
- 'scheduler_failure'
- 'api_failure'
variables:
LINT_LOG: "eslint-report.xml"
JS_LOG: "js-report.txt"
workflow:
rules:
- if: '$CI_MERGE_REQUEST_IID'
- if: '$CI_COMMIT_TAG'
- if: '$CI_COMMIT_BRANCH'
.pipeline_guard: &pipeline_guard
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_TAG'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
- if: '$CI_COMMIT_BRANCH =~ /^gnome-[0-9-]+$/'
- when: 'manual'
check_commit_log:
extends:
- .fdo.ci-fairy
stage: pre_review
script:
- ./.gitlab-ci/check-commit-log.sh
<<: *pipeline_guard
artifacts:
expire_in: 1 week
paths:
- commit-message-junit-report.xml
reports:
junit: commit-message-junit-report.xml
check-merge-request:
extends:
- .fdo.ci-fairy
stage: pre_review
script:
- if [[ x"$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" != "x" ]] ;
then
ci-fairy check-merge-request --require-allow-collaboration --junit-xml=check-merge-request-report.xml ;
else
echo "Not a merge request" ;
fi
<<: *pipeline_guard
artifacts:
expire_in: 1 week
paths:
- check-merge-request-report.xml
reports:
junit: check-merge-request-report.xml
js_check:
stage: review
script:
- find extensions -name '*.js' -exec js78 -c '{}' ';' 2>&1 | tee $JS_LOG
- (! grep -q . $JS_LOG)
artifacts:
paths:
- ${JS_LOG}
when: on_failure
eslint:
stage: review
script:
- eslint -o $LINT_LOG -f junit extensions
artifacts:
paths:
- ${LINT_LOG}
reports:
junit: ${LINT_LOG}
build-bundles:
stage: build
needs: ["check_commit_log"]
script:
- ./export-zips.sh
artifacts:
name: 'Extension bundles'
expose_as: 'Get Extension bundles here'
paths:
- zip-files/