mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-10-05 01:49:02 +00:00
CI: Fetch main repo tags from forks
Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
This commit is contained in:
parent
3c8e160229
commit
6a041f6c61
@ -133,6 +133,7 @@ stages:
|
||||
- sccache --show-stats
|
||||
- .gitlab/ci/config/google_benchmarks.sh
|
||||
- "cmake --version"
|
||||
- "cmake -V -P .gitlab/ci/config/fetch_vtkm_tags.cmake"
|
||||
- "cmake -V -P .gitlab/ci/config/gitlab_ci_setup.cmake"
|
||||
- "ctest -VV -S .gitlab/ci/ctest_configure.cmake"
|
||||
script:
|
||||
|
34
.gitlab/ci/config/fetch_vtkm_tags.cmake
Normal file
34
.gitlab/ci/config/fetch_vtkm_tags.cmake
Normal file
@ -0,0 +1,34 @@
|
||||
##=============================================================================
|
||||
##
|
||||
## Copyright (c) Kitware, Inc.
|
||||
## All rights reserved.
|
||||
## See LICENSE.txt for details.
|
||||
##
|
||||
## This software is distributed WITHOUT ANY WARRANTY; without even
|
||||
## the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
## PURPOSE. See the above copyright notice for more information.
|
||||
##
|
||||
##=============================================================================
|
||||
|
||||
## Fetch latests tags from VTK-m main repo
|
||||
|
||||
find_package(Git)
|
||||
if(NOT Git_FOUND)
|
||||
message(ERROR "Git not installed, Could not fetch vtk/vtk-m tags")
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(REPO_URL "https://gitlab.kitware.com/vtk/vtk-m.git")
|
||||
|
||||
## Only fetch tags when in a fork in a MR since often times forks do not have
|
||||
## the latest tags from the main repo.
|
||||
if(DEFINED ENV{CI_MERGE_REQUEST_ID} AND NOT $ENV{CI_REPOSITORY_URL} MATCHES "vtk/vtk-m\\.git$")
|
||||
message("Fetching vtk/vtk-m repo latest tags")
|
||||
execute_process(
|
||||
COMMAND
|
||||
${GIT_EXECUTABLE}
|
||||
fetch
|
||||
${REPO_URL}
|
||||
"refs/tags/*:refs/tags/*"
|
||||
)
|
||||
endif()
|
Loading…
Reference in New Issue
Block a user