Skip to content

Commit 9ecab8b

Browse files
committed
CI: Add Azure CI configuration files
1 parent 6d4cca7 commit 9ecab8b

16 files changed

Lines changed: 1185 additions & 0 deletions

.azure.bak/azure-pipelines.yml

Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
#==================================================================================================
2+
# Building against a branch *other* than `develop` on simplnx. There are a few items that will
3+
# need to be changed.
4+
#
5+
# [1] Under `resources->repository->name` you will need to put your fork.
6+
# You will also need to add another attribute to the `repository` for the branch/ref from github
7+
# [2] Under the `jobs->job->variables` section you will need to adjust the "simplnx_origin_name"
8+
# variable to match your fork.
9+
#==================================================================================================
10+
11+
resources:
12+
repositories:
13+
- repository: SimplnxReview
14+
type: github
15+
endpoint: BlueQuartzSoftware
16+
name: BlueQuartzSoftware/SimplnxReview
17+
- repository: simplnx
18+
type: github
19+
endpoint: BlueQuartzSoftware
20+
name: BlueQuartzSoftware/simplnx
21+
22+
trigger:
23+
- develop
24+
25+
jobs:
26+
- job:
27+
strategy:
28+
matrix:
29+
macOS-arm64:
30+
imageName: Darwin
31+
preset_name: ci-macos-arm64
32+
architecture: ARM64
33+
home_dir: /Users/buildbot
34+
macOS-x64:
35+
imageName: Darwin
36+
preset_name: ci-macos-x64
37+
architecture: X64
38+
home_dir: /Users/buildbot
39+
Windows:
40+
imageName: Windows_NT
41+
preset_name: ci-windows-v143
42+
architecture: X64
43+
home_dir: C:/Users/buildbot
44+
Linux:
45+
imageName: Linux
46+
preset_name: ci-linux-x64
47+
architecture: X64
48+
home_dir: /home/buildbot
49+
50+
pool:
51+
name: BlueQuartz Self Hosted
52+
demands:
53+
- Agent.OS -equals $(imageName)
54+
- BQ.DREAM3DNX
55+
- BQ.COMMERCIAL
56+
- Agent.OSArchitecture -equals $(architecture)
57+
58+
workspace:
59+
clean: all
60+
61+
timeoutInMinutes: 120
62+
63+
variables:
64+
simplnx_source_dir: $(Build.Repository.LocalPath)/simplnx
65+
dream3d_data_dir: $(Agent.WorkFolder)/DREAM3D_Data
66+
model_type: Experimental
67+
build_type: Release
68+
simplnx_origin_name: bluequartzsoftware
69+
simplnx_branch_name: develop
70+
simplnx_review_source_dir: $(Build.Repository.LocalPath)/SimplnxReview
71+
72+
73+
steps:
74+
- checkout: self
75+
submodules: true
76+
- checkout: simplnx
77+
submodules: true
78+
79+
- powershell: |
80+
try {
81+
echo System.PullRequest.SourceBranch=$(System.PullRequest.SourceBranch)
82+
echo System.PullRequest.PullRequestNumber=$(System.PullRequest.PullRequestNumber)
83+
} catch {
84+
}
85+
echo Build.SourceBranchName=$(Build.SourceBranchName)
86+
echo Build.Repository.Name=$(Build.Repository.Name)
87+
echo Build.Repository.Uri=$(Build.Repository.Uri)
88+
echo Build.Repository.LocalPath=$(Build.Repository.LocalPath)
89+
echo Build.BuildNumber=$(Build.BuildNumber)
90+
echo Agent.WorkFolder=$(Agent.WorkFolder)
91+
echo Agent.OS=$(Agent.OS)
92+
echo Agent.OSArchitecture=$(Agent.OSArchitecture)
93+
echo preset_name=$(preset_name)
94+
displayName: 'Dump Azure Variables'
95+
96+
#==================================================================================================
97+
# Change from the default https checkout to a git remote with ssh
98+
# The build bots have appropriate ssh keys to make this work
99+
# This also allows CDash to get the real git commit that we are on for SimplnxReview
100+
#==================================================================================================
101+
- powershell: |
102+
cd $(Build.Repository.LocalPath)/simplnx
103+
git config core.sshCommand "ssh -i $(home_dir)/.ssh/id_rsa"
104+
git remote rename origin azure
105+
git remote add origin ssh://git@github.com/$(simplnx_origin_name)/simplnx
106+
git fetch origin
107+
displayName: Update Simplnx Repo
108+
109+
- powershell: |
110+
cd $(Build.Repository.LocalPath)/SimplnxReview
111+
git config core.sshCommand "ssh -i $(home_dir)/.ssh/id_rsa"
112+
git remote rename origin azure
113+
git remote add origin ssh://git@github.com/bluequartzsoftware/SimplnxReview
114+
git fetch origin
115+
$sourceBranch = "$(Build.SourceBranchName)"
116+
if ($sourceBranch -eq "develop") {
117+
git checkout -b $(Build.SourceBranchName) --track origin/$(Build.SourceBranchName)
118+
} else {
119+
git checkout -b $(System.PullRequest.SourceBranch) --track origin/$(System.PullRequest.SourceBranch)
120+
}
121+
displayName: Update SimplnxReview Repo
122+
123+
#==================================================================================================
124+
# CDash Section:
125+
# In this section we are going to call `ctest` 3 times in order to separate out the output from
126+
# each CDash stage: Configure,Update :: Build :: Testing
127+
# This makes the output easier to parse through for the testing.
128+
#==================================================================================================
129+
130+
- powershell: |
131+
cd $(Build.BinariesDirectory)
132+
ctest -VV -DCTEST_SOURCE_DIR=$(simplnx_source_dir) -DSIMPLNX_EXTRA_PLUGINS="SimplnxReview" -DSIMPLNX_PLUGIN_ENABLE_SimplnxReview=ON -DSIMPLNX_SimplnxReview_SOURCE_DIR=$(simplnx_review_source_dir) -DCTEST_BINARY_DIRECTORY=$(Build.BinariesDirectory) -Ddashboard_model=Experimental -DCTEST_DASHBOARD_ROOT=$(Build.Repository.LocalPath) -DCMAKE_PRESET_NAME="$(preset_name)" -DCTEST_CONFIGURATION_TYPE=Release -S $(Build.Repository.LocalPath)/SimplnxReview/.azure/azure_ci_configure.cmake
133+
displayName: CDash Update/Configure
134+
135+
- powershell: |
136+
cd $(Build.BinariesDirectory)
137+
ctest -VV -DCTEST_SOURCE_DIR=$(simplnx_source_dir) -DCTEST_BINARY_DIRECTORY=$(Build.BinariesDirectory) -Ddashboard_model=Experimental -DCTEST_DASHBOARD_ROOT=$(Build.Repository.LocalPath) -DCMAKE_PRESET_NAME="$(preset_name)" -DCTEST_CONFIGURATION_TYPE=Release -S $(Build.Repository.LocalPath)/SimplnxReview/.azure/azure_ci_build.cmake
138+
displayName: CDash Build
139+
140+
- powershell: |
141+
cd $(Build.BinariesDirectory)
142+
ctest -VV -DCTEST_SOURCE_DIR=$(simplnx_source_dir) -DCTEST_BINARY_DIRECTORY=$(Build.BinariesDirectory) -Ddashboard_model=Experimental -DCTEST_DASHBOARD_ROOT=$(Build.Repository.LocalPath) -DCMAKE_PRESET_NAME="$(preset_name)" -DCTEST_CONFIGURATION_TYPE=Release -S $(Build.Repository.LocalPath)/SimplnxReview/.azure/azure_ci_test.cmake
143+
displayName: CDash Test
144+
145+
#==================================================================================================
146+
# CPack Section
147+
#==================================================================================================
148+
- powershell: |
149+
cd $(Build.BinariesDirectory)
150+
cpack -C $(build_type) --verbose
151+
displayName: Packing Commercial NX
152+
153+
#==================================================================================================
154+
# Publish Test Results
155+
#==================================================================================================
156+
- task: PublishTestResults@2
157+
inputs:
158+
testResultsFormat: CTest
159+
testResultsFiles: $(Build.BinariesDirectory)/Testing/*/Test.xml
160+
testRunTitle: CTest_$(Agent.Name)_$(Agent.OS)
161+
failTaskOnFailedTests: true
162+
displayName: Publish Commercial Test Results
163+
164+
# - script: |
165+
# cmake -S $(simplnx_source_dir) -B $(Build.BinariesDirectory)-Free -G Ninja -DDREAM3D_ENABLE_DOCUMENTATION=OFF -DDREAM3D_ENABLE_VISUALIZATION=OFF -DCMAKE_BUILD_TYPE:STRING=$(build_type) -DDREAM3D_DATA_DIR=$(dream3d_data_dir) -C $(Agent.WorkFolder)/NX.cmake -DSIMPLNX_EXTRA_PLUGINS="Core;ITKImageProcessing;OrientationAnalysis" -DCTEST_BUILD_NAME:STRING="NX-Free-$(Agent.MachineName)-$(Agent.OS)-$(Build.SourceBranchName)_$(Build.BuildNumber)"
166+
# displayName: Configure Free DREAM3D
167+
168+
# - script: |
169+
# cmake --build $(Build.BinariesDirectory)-Free --config $(build_type) --target all
170+
# displayName: Build Free DREAM3D
171+
172+
# - script: |
173+
# cd $(Build.BinariesDirectory)-Free
174+
# cpack -C $(build_type) --verbose
175+
# continueOnError: false
176+
# displayName: Packing Free DREAM3D
177+
178+
# - script: |
179+
# cd $(Build.BinariesDirectory)-Free
180+
# ctest -C $(build_type) -D Experimental --timeout 7200 -DCTEST_SITE:STRING=$(Agent.MachineName).bluequartz.net -Ddashboard_source_name:STRING=DREAM3D
181+
# continueOnError: true
182+
# displayName: Testing Free DREAM3D
183+
184+
# - task: PublishTestResults@2
185+
# inputs:
186+
# testResultsFormat: CTest
187+
# testResultsFiles: $(Build.BinariesDirectory)-Free/Testing/*/Test.xml
188+
# testRunTitle: CTest_$(Agent.Name)_$(Agent.OS)
189+
# failTaskOnFailedTests: true
190+
# displayName: Publish Free Test Results
191+

.azure.bak/azure_ci_build.cmake

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
2+
#==================================================================================================
3+
# Define these variables
4+
#==================================================================================================
5+
# get_filename_component(HOST_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}" ABSOLUTE)
6+
## This is the Fully Qualified host name of your system
7+
set(CTEST_SITE "$ENV{AGENT_NAME}.bluequartz.net")
8+
## The name for this build. Combine the build type, compiler, and OS into a single string
9+
set(CTEST_BUILD_NAME "$ENV{PRESET_NAME}-$ENV{BUILD_BUILDNUMBER}-PR$ENV{SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}")
10+
## The type of build we are going to do "Release | Debug"
11+
#set(CTEST_CONFIGURATION_TYPE Release)
12+
## The type of generator we are going to use "Make | Ninja | NMake | JOM"
13+
set(CTEST_CMAKE_GENERATOR "Ninja")
14+
15+
#==================================================================================================
16+
# Append to the existing CTEST TAG
17+
#==================================================================================================
18+
ctest_start(Experimental ${CTEST_SOURCE_DIR} ${CTEST_BINARY_DIRECTORY} APPEND)
19+
20+
#==================================================================================================
21+
# Build the project
22+
#==================================================================================================
23+
ctest_build(BUILD ${CTEST_BINARY_DIRECTORY}
24+
CONFIGURATION ${CTEST_CONFIGURATION_TYPE}
25+
NUMBER_ERRORS ctest_build_errors
26+
NUMBER_WARNINGS ctest_build_warnings
27+
RETURN_VALUE ctest_build_result
28+
CAPTURE_CMAKE_ERROR ctest_cmake_result
29+
)
30+
ctest_submit(PARTS Build)
31+
32+
if("${ctest_build_result}" EQUAL -1 OR "${ctest_cmake_result}" EQUAL -1)
33+
message(FATAL_ERROR "CONFIGURE ERRORS: Go to https://my.cdash.org/index.php?project=DREAM3D for more information.
34+
Site: ${CTEST_SITE}
35+
Build Name: ${CTEST_BUILD_NAME}
36+
CMake returned the following error code during build: ${ctest_cmake_result}
37+
ctest_build() returned the following error code during build: ${ctest_build_result}")
38+
endif()
39+
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
2+
#==================================================================================================
3+
# Define these variables
4+
#==================================================================================================
5+
# get_filename_component(HOST_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}" ABSOLUTE)
6+
## This is the Fully Qualified host name of your system
7+
set(CTEST_SITE "$ENV{AGENT_NAME}.bluequartz.net")
8+
## The name for this build. Combine the build type, compiler, and OS into a single string
9+
set(CTEST_BUILD_NAME "$ENV{PRESET_NAME}-$ENV{BUILD_BUILDNUMBER}-PR$ENV{SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}")
10+
## The type of build we are going to do "Release | Debug"
11+
#set(CTEST_CONFIGURATION_TYPE Release)
12+
## The type of generator we are going to use "Make | Ninja | NMake | JOM"
13+
set(CTEST_CMAKE_GENERATOR "Ninja")
14+
15+
#==================================================================================================
16+
# Look for a GIT command-line client.
17+
#==================================================================================================
18+
if(NOT DEFINED CTEST_GIT_COMMAND)
19+
find_program(CTEST_GIT_COMMAND NAMES git git.exe git.cmd)
20+
endif()
21+
22+
if(NOT EXISTS ${CTEST_GIT_COMMAND})
23+
message(FATAL_ERROR "CONFIGURE ERRORS: Go to https://my.cdash.org/index.php?project=DREAM3D for more information.
24+
Site: ${CTEST_SITE}
25+
Build Name: ${CTEST_BUILD_NAME}
26+
No Git Found.")
27+
endif()
28+
29+
30+
#==================================================================================================
31+
# Configure the project
32+
#==================================================================================================
33+
file(WRITE ${CTEST_BINARY_DIRECTORY}/CMakeCache.txt "
34+
SITE:STRING=${CTEST_SITE}
35+
BUILDNAME:STRING=${CTEST_BUILD_NAME}
36+
CTEST_USE_LAUNCHERS:BOOL=${CTEST_USE_LAUNCHERS}
37+
DART_TESTING_TIMEOUT:STRING=${CTEST_TEST_TIMEOUT}
38+
CMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE}
39+
DART_TESTING_TIMEOUT:STRING=1500"
40+
)
41+
42+
#==================================================================================================
43+
# Start CTest the project. This will create the TAG that is APPENEDED to for the other 2 steps in
44+
# the process.
45+
#==================================================================================================
46+
ctest_start(Experimental ${CTEST_SOURCE_DIR} ${CTEST_BINARY_DIRECTORY})
47+
48+
#==================================================================================================
49+
# Update Git Hashes for the project
50+
#==================================================================================================
51+
set(REPO_NAMES "SimplnxReview" "simplnx")
52+
foreach(p ${REPO_NAMES})
53+
ctest_update(SOURCE ${CTEST_DASHBOARD_ROOT}/${p}
54+
RETURN_VALUE ctest_update_result
55+
CAPTURE_CMAKE_ERROR ctest_cmake_result)
56+
endforeach(p ${REPO_NAMES})
57+
ctest_submit(PARTS Update)
58+
59+
60+
#==================================================================================================
61+
# Configure the project
62+
#==================================================================================================
63+
ctest_configure( BUILD ${CTEST_BINARY_DIRECTORY}
64+
SOURCE ${CTEST_SOURCE_DIR}
65+
OPTIONS "--preset ${CMAKE_PRESET_NAME}"
66+
RETURN_VALUE ctest_configure_result
67+
CAPTURE_CMAKE_ERROR ctest_cmake_result)
68+
69+
ctest_submit(PARTS Configure Notes)
70+
message(STATUS "ctest_configure_result: ${ctest_configure_result}")
71+
message(STATUS " ctest_cmake_restult: ${ctest_cmake_result}")
72+
73+
if("${ctest_cmake_result}" EQUAL -1 OR "${ctest_configure_result}" EQUAL -1)
74+
message(FATAL_ERROR "CONFIGURE ERRORS: Go to https://my.cdash.org/index.php?project=DREAM3D for more information.
75+
Site: ${CTEST_SITE}
76+
Build Name: ${CTEST_BUILD_NAME}
77+
CMake returned the following error code during build: ${ctest_cmake_result}
78+
ctest_configure() returned the following error code during build: ${ctest_configure_result}")
79+
endif()

.azure.bak/azure_ci_test.cmake

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
#==================================================================================================
3+
# Define these variables
4+
#==================================================================================================
5+
# get_filename_component(HOST_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}" ABSOLUTE)
6+
## This is the Fully Qualified host name of your system
7+
set(CTEST_SITE "$ENV{AGENT_NAME}.bluequartz.net")
8+
## The name for this build. Combine the build type, compiler, and OS into a single string
9+
set(CTEST_BUILD_NAME "$ENV{PRESET_NAME}-$ENV{BUILD_BUILDNUMBER}-PR$ENV{SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}")
10+
## The type of build we are going to do "Release | Debug"
11+
#set(CTEST_CONFIGURATION_TYPE Release)
12+
## The type of generator we are going to use "Make | Ninja | NMake | JOM"
13+
set(CTEST_CMAKE_GENERATOR "Ninja")
14+
15+
16+
#==================================================================================================
17+
# Append to the existing CTEST TAG
18+
#==================================================================================================
19+
ctest_start(Experimental ${CTEST_SOURCE_DIR} ${CTEST_BINARY_DIRECTORY} APPEND)
20+
21+
22+
#==================================================================================================
23+
# Run the unit tests
24+
#==================================================================================================
25+
ctest_test(${CTEST_TEST_ARGS} APPEND)
26+
ctest_submit(PARTS Test)

0 commit comments

Comments
 (0)