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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

175 lines
4.5 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
2022-08-13 15:12:31 +05:30
.absolutely-minimal-job:
extends:
- .minimal-job
2021-03-11 19:13:27 +05:30
image: ${GITLAB_DEPENDENCY_PROXY}alpine:edge
2020-04-22 19:07:51 +05:30
variables:
GIT_STRATEGY: none
2022-08-13 15:12:31 +05:30
dont-interrupt-me:
extends:
- .absolutely-minimal-job
- .setup:rules:dont-interrupt-me
stage: sync
interruptible: false
2020-04-22 19:07:51 +05:30
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
2021-12-11 22:18:48 +05:30
no-ee-check:
2020-03-13 15:44:24 +05:30
extends:
- .minimal-job
2021-12-11 22:18:48 +05:30
- .setup:rules:no-ee-check
2020-04-08 14:13:33 +05:30
stage: test
2019-07-31 22:56:46 +05:30
script:
2021-12-11 22:18:48 +05:30
- scripts/no-dir-check ee
no-jh-check:
extends:
- .minimal-job
- .setup:rules:no-jh-check
stage: test
script:
- scripts/no-dir-check jh
2020-11-24 15:15:51 +05:30
2022-08-13 15:12:31 +05:30
verify-ruby-2.7:
extends:
- .absolutely-minimal-job
- .setup:rules:verify-ruby-2.7
stage: prepare
script:
- echo 'Please remove label ~"pipeline:run-in-ruby3" so we do test against Ruby 2.7 (default version) before merging the merge request'
- exit 1
2020-11-24 15:15:51 +05:30
verify-tests-yml:
extends:
- .setup:rules:verify-tests-yml
2022-07-23 23:45:48 +05:30
image: ${GITLAB_DEPENDENCY_PROXY}ruby:${RUBY_VERSION}-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
2022-06-21 17:19:12 +05:30
verify-approvals:
extends:
2022-08-13 15:12:31 +05:30
- .minimal-job
2022-06-21 17:19:12 +05:30
- .setup:rules:jh-contribution
script:
- source scripts/utils.sh
- install_gitlab_gem
- tooling/bin/find_app_sec_approval
2022-01-26 12:08:38 +05:30
generate-frontend-fixtures-mapping:
extends:
- .setup:rules:generate-frontend-fixtures-mapping
- .use-pg12
- .rails-cache
needs: ["setup-test-env"]
stage: prepare
before_script:
- !reference [.default-before_script, before_script]
- source ./scripts/rspec_helpers.sh
- run_timed_command "scripts/gitaly-test-spawn"
script:
- generate_frontend_fixtures_mapping
artifacts:
expire_in: 7d
paths:
- ${FRONTEND_FIXTURES_MAPPING_PATH}
2020-11-24 15:15:51 +05:30
.detect-test-base:
2022-07-23 23:45:48 +05:30
image: ${GITLAB_DEPENDENCY_PROXY}ruby:${RUBY_VERSION}
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
2022-01-26 12:08:38 +05:30
- retrieve_frontend_fixtures_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};
2022-01-26 12:08:38 +05:30
tooling/bin/find_changes ${CHANGES_FILE} ${MATCHED_TESTS_FILE} ${FRONTEND_FIXTURES_MAPPING_PATH};
echo "Changed files: $(cat $CHANGES_FILE)";
echo "Related rspec tests: $(cat $MATCHED_TESTS_FILE)";
2021-11-11 11:23:49 +05:30
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}
2022-01-26 12:08:38 +05:30
- ${FRONTEND_FIXTURES_MAPPING_PATH}
2020-11-24 15:15:51 +05:30
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
2021-12-11 22:18:48 +05:30
detect-previous-failed-tests:
extends:
- .detect-test-base
- .rails:rules:detect-previous-failed-tests
variables:
PREVIOUS_FAILED_TESTS_DIR: tmp/previous_failed_tests/
RSPEC_PG_REGEX: /rspec .+ pg12( .+)?/
RSPEC_EE_PG_REGEX: /rspec-ee .+ pg12( .+)?/
script:
- source ./scripts/utils.sh
- source ./scripts/rspec_helpers.sh
- retrieve_previous_failed_tests ${PREVIOUS_FAILED_TESTS_DIR} "${RSPEC_PG_REGEX}" "${RSPEC_EE_PG_REGEX}"
artifacts:
expire_in: 7d
paths:
- ${PREVIOUS_FAILED_TESTS_DIR}