2021-09-30 23:02:18 +05:30
|
|
|
# To contribute improvements to CI/CD templates, please follow the Development guide at:
|
|
|
|
# https://docs.gitlab.com/ee/development/cicd/templates.html
|
|
|
|
# This specific template is located at:
|
|
|
|
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Verify/FailFast.gitlab-ci.yml
|
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
rspec-rails-modified-path-specs:
|
2020-10-24 23:57:45 +05:30
|
|
|
image: ruby:2.6
|
2020-06-23 00:09:42 +05:30
|
|
|
stage: .pre
|
|
|
|
rules:
|
|
|
|
- if: $CI_MERGE_REQUEST_EVENT_TYPE == "merged_result" || $CI_MERGE_REQUEST_EVENT_TYPE == "merge_train"
|
|
|
|
changes: ["**/*.rb"]
|
|
|
|
script:
|
|
|
|
- gem install test_file_finder
|
|
|
|
- spec_files=$(tff $(git diff --name-only "$CI_MERGE_REQUEST_TARGET_BRANCH_SHA..$CI_MERGE_REQUEST_SOURCE_BRANCH_SHA"))
|
|
|
|
- |
|
|
|
|
if [ -n "$spec_files" ]
|
|
|
|
then
|
|
|
|
bundle install
|
|
|
|
bundle exec rspec -- $spec_files
|
|
|
|
else
|
|
|
|
echo "No relevant spec files found by tff"
|
|
|
|
exit 0
|
|
|
|
fi
|