Skip to content
Snippets Groups Projects
Commit 5fd64e70 authored by Martin Heistermann's avatar Martin Heistermann
Browse files

init

parents
Branches main
No related tags found
No related merge requests found
Pipeline #9112 failed
/build*/
stages:
- component
- test
- release
include:
# include the component located in the current project from the current SHA
- component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/sonoma@$CI_COMMIT_SHA
inputs:
stage: component
src_folder: 'demo'
tags:
- macos
- m1
- tart
job_name_prefix: "pref-"
ensure-job-added:
tags:
- cgg
- docker-docker
- linux
stage: test
image: badouralix/curl-jq
script:
- |
route="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/pipelines/${CI_PIPELINE_ID}/jobs"
echo "$route"
count=`curl --silent "$route" | jq 'map(select(.name | contains("pref-macos-sonoma"))) | length'`
if [ "$count" != "1" ]; then
curl --silent "$route" | jq '.'
exit 1; else
echo "Component Job present"
fi
# If the pipeline is for a new tag with a semantic version, and all previous jobs succeed,
# create the release.
create-release:
tags:
- cgg
- docker-docker
- linux
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
script: echo "Creating release $CI_COMMIT_TAG"
rules:
- if: $CI_COMMIT_TAG
release:
tag_name: $CI_COMMIT_TAG
description: "Release $CI_COMMIT_TAG of components repository $CI_PROJECT_PATH"
# MacOS/Tart CI Component (experimentaL)
## Components
This project also publishes CI components to build cmake based projects.
### sonoma
project(Test)
add_executable(test test.cc)
#include <iostream>
int main(int argc, char *argv[])
{
std::cout << "Hello." << std::endl;
return 0;
}
spec:
inputs:
stage:
default: test
BUILD_TYPE:
default: Release
C_COMPILER:
default: "gcc"
CXX_COMPILER:
default: "g++"
tags:
description: "Tags to apply to the jobs (to select proper runner)"
default: []
type: array
cmake_options:
description: "Additional commandline options for cmake"
default: ""
src_folder:
description: "a repo subfolder that contains a CMakeLists.txt to build"
default: "."
job_name_prefix:
description: "The job's prefix (if any)"
default: ""
---
".$[[ inputs.job_name_prefix ]]macos":
stage: $[[ inputs.stage ]]
variables:
CMAKE_GENERATOR: "Ninja"
CMAKE_C_COMPILER: "$[[ inputs.C_COMPILER ]]"
CMAKE_CXX_COMPILER: "$[[ inputs.CXX_COMPILER ]]"
BUILD_TYPE: "$[[ inputs.BUILD_TYPE ]]"
BUILD_DIR: "build-${CI_JOB_NAME}"
tags: $[[ inputs.tags ]]
before_script:
# -Force prevents an error if the directory already exists.
script:
artifacts:
when: always
reports:
junit: "${BUILD_DIR}/test-report-${BUILD_TYPE}.xml"
script:
- ccache -z
- >
cmake
-B "${BUILD_DIR}"
-S "$[[ inputs.src_folder ]]"
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}"
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
$[[ inputs.cmake_options ]]
- ccache -s -v
- ctest --test-dir "${BUILD_DIR}" --output-junit "${BUILD_DIR}/test-report-${BUILD_TYPE}.xml"
artifacts:
when: always
reports:
junit: "${BUILD_DIR}/test-report-${BUILD_TYPE}.xml"
"$[[ inputs.job_name_prefix ]]macos-sonoma-arm":
extends:
- ".$[[ inputs.job_name_prefix ]]macos"
image: ghcr.io/cirruslabs/macos-sonoma-base:latest
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment