-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
135 lines (121 loc) · 3.89 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
stages:
- lint
- build
- test
default:
interruptible: true
variables:
NUGET_SOURCE: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/nuget/index.json"
NUGET_NAME: gitlab
VCPKG_VERSION: 2024.10.21
VCPKG_BINARY_SOURCES: "clear;nuget,${NUGET_NAME},readwrite"
CMAKE_COMMAND: ${CI_PROJECT_DIR}/vcpkg/downloads/tools/cmake-3.30.1-linux/cmake-3.30.1-linux-x86_64/bin/cmake
NUGET_COMMAND: ${CI_PROJECT_DIR}/vcpkg/downloads/tools/nuget-6.10.0-linux/nuget.exe
.get-vcpkg: &get-vcpkg
# Get vcpkg
- git clone https://github.com/microsoft/vcpkg.git --depth 1 --branch ${VCPKG_VERSION}
- ./vcpkg/bootstrap-vcpkg.sh
- ./vcpkg/vcpkg fetch nuget --x-wait-for-lock
- ./vcpkg/vcpkg fetch cmake --x-wait-for-lock
- ./vcpkg/vcpkg fetch ninja --x-wait-for-lock
- export PATH=$PATH:${CI_PROJECT_DIR}/vcpkg/downloads/tools/ninja-1.11.1-linux
# Configure NuGet
- mono ${NUGET_COMMAND} sources add -source ${NUGET_SOURCE} -name ${NUGET_NAME} -username gitlab-ci-token -password $CI_JOB_TOKEN
lint-clang-tidy:
image: $CI_REGISTRY/asxa86/images/ubuntu-dev:latest
stage: lint
needs: []
tags:
# - saas-linux-medium-amd64
- shelley
- docker
- large
script:
- *get-vcpkg
# Configure Aspire
- ${CMAKE_COMMAND} --preset x64-linux-gcc-debug
# Build to force generate moc files.
- ${CMAKE_COMMAND} --build --preset x64-linux-gcc-debug
# Run Clang Tidy
- find module/ app/ -type f -name "*.cpp" -print0 | xargs -0 -P $(nproc --all) clang-tidy-18 -p build
build-gcc-debug:
image: $CI_REGISTRY/asxa86/images/ubuntu-dev:latest
stage: build
needs: []
tags:
# - saas-linux-medium-amd64
- shelley
- docker
- large
script:
- *get-vcpkg
# Build Aspire
- ${CMAKE_COMMAND} --preset x64-linux-gcc-debug
- ${CMAKE_COMMAND} --build --preset x64-linux-gcc-debug --target install
# artifacts:
# when: on_failure
# paths:
# - vcpkg/buildtrees/**/*.txt
# - vcpkg/buildtrees/**/*.log
artifacts:
expire_in: 1 day
paths:
- build
exclude:
- build/vcpkg_installed/**/*
build-arm64-android-debug:
image: $CI_REGISTRY/asxa86/images/android-build:latest
stage: build
needs: []
tags:
# - saas-linux-medium-amd64
- shelley
- docker
- large
script:
- *get-vcpkg
# Build Aspire
- ${CMAKE_COMMAND} --preset arm64-android-debug
- ${CMAKE_COMMAND} --build --preset arm64-android-debug
artifacts:
expire_in: 1 day
paths:
- build/**/*.apk
build-gcc-debug-sonar:
image: $CI_REGISTRY/asxa86/images/ubuntu-dev:latest
stage: build
needs: []
tags:
# - saas-linux-medium-amd64
- shelley
- docker
- large
variables:
CMAKE_PRESET: x64-linux-gcc-debug
script:
# Download sonar-scanner
- curl -sSLo ./sonar-scanner.zip 'https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.1.0.4477-linux-x64.zip'
- unzip -o sonar-scanner.zip
- mv sonar-scanner-6.1.0.4477-linux-x64 sonar-scanner
# Download build-wrapper
- curl -sSLo ./build-wrapper-linux-x86.zip "${SONAR_HOST_URL}/static/cpp/build-wrapper-linux-x86.zip"
- unzip -oj build-wrapper-linux-x86.zip -d ./build-wrapper
# Run the build inside the build wrapper
- *get-vcpkg
- ${CMAKE_COMMAND} --preset ${CMAKE_PRESET}
- build-wrapper/build-wrapper-linux-x86-64 --out-dir bw-output ${CMAKE_COMMAND} --build --preset ${CMAKE_PRESET}
# Run the sonar-scanner in the same stage as the build
- sonar-scanner/bin/sonar-scanner -Dsonar.host.url="${SONAR_HOST_URL}" -Dsonar.token="${SONAR_TOKEN}" -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json
test-gcc-debug:
image: $CI_REGISTRY/asxa86/images/ubuntu-dev:latest
stage: test
needs:
- build-gcc-debug
tags:
# - saas-linux-medium-amd64
- shelley
- docker
- large
script:
- *get-vcpkg
- ${CMAKE_COMMAND} --build --preset x64-linux-gcc-debug --target test