Пропустить сборку и использовать последний успешный артефакт gitlab CIC++

Программы на C++. Форум разработчиков
Anonymous
Пропустить сборку и использовать последний успешный артефакт gitlab CI

Сообщение Anonymous »

У меня есть проект, в котором используется сочетание кода C++ и Python. Код Python использует некоторые привязки и, следовательно, зависит от сборки.
Я хочу иметь возможность пропустить этап сборки, если я не менял файлы cpp, hpp или ipp, но иметь возможность загружать артефакты с предыдущего успешного этапа сборки, чтобы я мог запускать тесты. Возможно ли это в gitlab?
# Configure CMake, which sets up the build directory and adds any files that CMake produces with the configure_file command
configure-cmake:
stage: configure
image: $UPSTREAM_REGISTRY/$CONDA_ENV_IMAGE:latest
script:
- cmake ${CMAKE_ARGS} -DCMAKE_EXPORT_COMPILE_COMMANDS=true -B $BUILD_DIR -S .
artifacts:
expire_in: 2h
paths:
- $BUILD_DIR/
# there might be an easier way to auto-detect the artifacts below, which are made by CMake's configure_file
- src/version.hpp
- bayeswavecpp_bindings/autoload_cppyy.py

####################################################################################################
############################################### BUILD ##############################################
####################################################################################################

# Build the library with CMake (includes clang-tidy static analysis)
build-cpp-library:
stage: build
image: $UPSTREAM_REGISTRY/$CONDA_ENV_IMAGE:latest
needs: ["configure-cmake"]
script:
- cmake --build $BUILD_DIR --target bayeswavecpp -- VERBOSE=1
dependencies:
- configure-cmake
artifacts:
expire_in: 2h
paths:
- $BUILD_DIR/

# This is what I want to run, especially when there have been no c++ changes
test-python-binding-import:
stage: test
image: $UPSTREAM_REGISTRY/$CONDA_ENV_IMAGE:latest
needs: ["configure-cmake", "build-cpp-library"]
# for now, install cppyy through pip because the version from conda is out of date and has bugs
script:
- pip install cppyy-cling cppyy-backend CPyCppyy cppyy
- pip install -e .
- cd test/python_binding_tests
- python -m unittest -v -b test_cppyy_imports.py
dependencies:
- configure-cmake
- build-cpp-library


Подробнее здесь: https://stackoverflow.com/questions/784 ... -gitlab-ci

Вернуться в «C++»