debian-mirror-gitlab/.gitlab/ci/setup.gitlab-ci.yml

120 lines
3 KiB
YAML
Raw Normal View History

2019-07-31 22:56:46 +05:30
# Insurance in case a gem needed by one of our releases gets yanked from
# rubygems.org in the future.
cache gems:
2019-12-04 20:38:33 +05:30
extends:
- .default-retry
2020-06-23 00:09:42 +05:30
- .rails-cache
2019-12-04 20:38:33 +05:30
- .default-before_script
2020-03-13 15:44:24 +05:30
- .setup:rules:cache-gems
2019-12-04 20:38:33 +05:30
stage: test
2020-05-24 23:13:21 +05:30
needs: ["setup-test-env"]
2019-12-04 20:38:33 +05:30
variables:
2020-07-28 23:09:34 +05:30
BUNDLE_INSTALL_FLAGS: --with=production --with=development --with=test --jobs=2 --path=vendor --retry=3 --quiet
2019-12-04 20:38:33 +05:30
SETUP_DB: "false"
2019-07-31 22:56:46 +05:30
script:
- bundle package --all --all-platforms
artifacts:
paths:
- vendor/cache
2020-05-24 23:13:21 +05:30
expire_in: 31d
2019-07-31 22:56:46 +05:30
2019-12-04 20:38:33 +05:30
.minimal-job:
2019-09-30 21:07:59 +05:30
extends:
2019-12-04 20:38:33 +05:30
- .default-retry
2020-04-08 14:13:33 +05:30
needs: []
2019-12-04 20:38:33 +05:30
2020-04-22 19:07:51 +05:30
dont-interrupt-me:
extends: .setup:rules:dont-interrupt-me
stage: sync
2021-03-11 19:13:27 +05:30
image: ${GITLAB_DEPENDENCY_PROXY}alpine:edge
2020-04-22 19:07:51 +05:30
interruptible: false
variables:
GIT_STRATEGY: none
script:
- echo "This jobs makes sure this pipeline won't be interrupted! See https://docs.gitlab.com/ee/ci/yaml/#interruptible."
2019-12-04 20:38:33 +05:30
gitlab_git_test:
2020-03-13 15:44:24 +05:30
extends:
- .minimal-job
- .setup:rules:gitlab_git_test
2020-04-08 14:13:33 +05:30
stage: test
2019-07-31 22:56:46 +05:30
script:
- spec/support/prepare-gitlab-git-test-for-commit --check-for-changes
no_ee_check:
2020-03-13 15:44:24 +05:30
extends:
- .minimal-job
- .setup:rules:no_ee_check
2020-04-08 14:13:33 +05:30
stage: test
2019-07-31 22:56:46 +05:30
script:
- scripts/no-ee-check
2020-11-24 15:15:51 +05:30
verify-tests-yml:
extends:
- .setup:rules:verify-tests-yml
2021-09-30 23:02:18 +05:30
image: ${GITLAB_DEPENDENCY_PROXY}ruby:2.7-alpine3.13
2020-11-24 15:15:51 +05:30
stage: test
needs: []
script:
- source scripts/utils.sh
- install_tff_gem
- scripts/verify-tff-mapping
.detect-test-base:
2021-03-11 19:13:27 +05:30
image: ${GITLAB_DEPENDENCY_PROXY}ruby:2.7
2020-11-24 15:15:51 +05:30
needs: []
stage: prepare
script:
2021-02-22 17:27:13 +05:30
- source ./scripts/utils.sh
- source ./scripts/rspec_helpers.sh
2020-11-24 15:15:51 +05:30
- install_gitlab_gem
- install_tff_gem
2021-02-22 17:27:13 +05:30
- retrieve_tests_mapping
2021-11-11 11:23:49 +05:30
- |
if [ -n "$CI_MERGE_REQUEST_IID" ]; then
tooling/bin/find_changes ${CHANGES_FILE};
tooling/bin/find_tests ${CHANGES_FILE} ${MATCHED_TESTS_FILE};
echo "related rspec tests: $(cat $MATCHED_TESTS_FILE)";
fi
2020-11-24 15:15:51 +05:30
artifacts:
expire_in: 7d
paths:
2021-11-11 11:23:49 +05:30
- ${CHANGES_FILE}
2020-11-24 15:15:51 +05:30
- ${MATCHED_TESTS_FILE}
detect-tests:
extends:
- .detect-test-base
- .rails:rules:detect-tests
variables:
2021-02-22 17:27:13 +05:30
RSPEC_TESTS_MAPPING_ENABLED: "true"
2021-11-11 11:23:49 +05:30
CHANGES_FILE: tmp/changed_files.txt
2020-11-24 15:15:51 +05:30
MATCHED_TESTS_FILE: tmp/matching_tests.txt
detect-tests as-if-foss:
extends:
- .detect-test-base
- .rails:rules:detect-tests
- .as-if-foss
variables:
2021-11-11 11:23:49 +05:30
CHANGES_FILE: tmp/changed_foss_files.txt
2020-11-24 15:15:51 +05:30
MATCHED_TESTS_FILE: tmp/matching_foss_tests.txt
before_script:
- '[ "$FOSS_ONLY" = "1" ] && rm -rf ee/ qa/spec/ee/ qa/qa/specs/features/ee/ qa/qa/ee/ qa/qa/ee.rb'
2021-11-18 22:05:49 +05:30
add-jh-folder:
extends: .setup:rules:add-jh-folder
image: ${GITLAB_DEPENDENCY_PROXY}alpine:edge
stage: prepare
before_script:
- apk add --no-cache --update curl bash
script:
- curl --location -o "jh-folder.tar.gz" "https://gitlab.com/gitlab-jh/gitlab/-/archive/main-jh/gitlab-main-jh.tar.gz?path=jh"
- tar -xf "jh-folder.tar.gz"
- mv gitlab-main-jh-jh/jh/ ./
- ls -l jh/
artifacts:
expire_in: 2d
paths:
- jh/