Create .gitlab-ci.yml file
This commit is contained in:
parent
a1a8766f36
commit
c2615d02c3
1 changed files with 36 additions and 0 deletions
36
.gitlab-ci.yml
Normal file
36
.gitlab-ci.yml
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
stages:
|
||||||
|
- build
|
||||||
|
# - test
|
||||||
|
- package
|
||||||
|
|
||||||
|
variables:
|
||||||
|
BUILD_DIR: "build"
|
||||||
|
CMAKE_OPTIONS: ""
|
||||||
|
|
||||||
|
build_job:
|
||||||
|
stage: build
|
||||||
|
image: gcc:latest
|
||||||
|
script:
|
||||||
|
- apt-get update -y && apt-get install -y cmake
|
||||||
|
- mkdir -p ${BUILD_DIR}
|
||||||
|
- cd ${BUILD_DIR}
|
||||||
|
- cmake .. ${CMAKE_OPTIONS}
|
||||||
|
- make -j$(nproc)
|
||||||
|
|
||||||
|
# test_job:
|
||||||
|
# stage: test
|
||||||
|
# image: gcc:latest
|
||||||
|
# script:
|
||||||
|
# - cd ${BUILD_DIR}
|
||||||
|
# - ctest --output-on-failure
|
||||||
|
|
||||||
|
package_job:
|
||||||
|
stage: package
|
||||||
|
image: docker:latest
|
||||||
|
services:
|
||||||
|
- docker:bind
|
||||||
|
script:
|
||||||
|
- echo "Building Docker image..."
|
||||||
|
- docker build -t ${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG} .
|
||||||
|
only:
|
||||||
|
- main
|
||||||
Reference in a new issue