-
Notifications
You must be signed in to change notification settings - Fork 99
145 lines (128 loc) · 4.79 KB
/
build.yml
File metadata and controls
145 lines (128 loc) · 4.79 KB
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
136
137
138
139
140
141
142
143
144
145
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
timeout-minutes: 360 # Added timeout
strategy:
fail-fast: false
matrix:
config:
- {
name: "Ubuntu Latest GCC",
os: ubuntu-latest,
cc: "gcc",
cxx: "g++",
parallel: "$(nproc)"
}
- {
name: "macOS Latest Clang",
os: macos-latest,
cc: "clang",
cxx: "clang++",
parallel: "$(sysctl -n hw.ncpu)"
}
# - {
# name: "Windows Latest MSVC",
# os: windows-latest,
# cc: "cl",
# cxx: "cl",
# parallel: "$env:NUMBER_OF_PROCESSORS"
# }
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Dependencies (Ubuntu)
if: matrix.config.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y ninja-build
- name: Install Dependencies (macOS)
if: matrix.config.os == 'macos-latest'
run: |
brew install ninja
- name: Install Dependencies (Windows)
if: matrix.config.os == 'windows-latest'
run: |
choco install ninja
- name: Configure CMake
shell: bash
run: |
cmake -B build -G Ninja \
-DCMAKE_C_COMPILER=${{ matrix.config.cc }} \
-DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
-DCMAKE_CXX_STANDARD:STRING=17 \
${{ matrix.config.os != 'windows-latest' && '-DCMAKE_CXX_FLAGS="-mtune=native -march=native"' || '' }} \
${{ matrix.config.os != 'windows-latest' && '-DCMAKE_C_FLAGS="-mtune=native -march=native"' || '' }} \
-DCMAKE_BUILD_TYPE=Release \
-DEXTERNAL_PROJECT_BUILD_TYPE:STRING=Release \
-DBUILD_TESTING=ON \
-DBUILD_SHARED_LIBS=ON \
-DBRAINSTools_REQUIRES_VTK=OFF \
-DUSE_BRAINSABC:BOOL=OFF \
-DUSE_BRAINSCreateLabelMapFromProbabilityMaps:BOOL=OFF \
-DUSE_BRAINSDWICleanup:BOOL=OFF \
-DUSE_BRAINSInitializedControlPoints:BOOL=OFF \
-DUSE_BRAINSLabelStats:BOOL=OFF \
-DUSE_BRAINSLandmarkInitializer:BOOL=OFF \
-DUSE_BRAINSMultiModeSegment:BOOL=OFF \
-DUSE_BRAINSMultiSTAPLE:BOOL=OFF \
-DUSE_BRAINSMush:BOOL=OFF \
-DUSE_BRAINSPosteriorToContinuousClass:BOOL=OFF \
-DUSE_BRAINSResample:BOOL=ON \
-DUSE_BRAINSROIAuto:BOOL=OFF \
-DUSE_BRAINSSnapShotWriter:BOOL=OFF \
-DUSE_BRAINSStripRotation:BOOL=OFF \
-DUSE_BRAINSTransformConvert:BOOL=OFF \
-DUSE_ConvertBetweenFileFormats:BOOL=OFF \
-DUSE_ImageCalculator:BOOL=OFF \
-DUSE_ReferenceAtlas:BOOL=OFF \
-DBRAINSTools_BUILD_DICOM_SUPPORT:BOOL=OFF \
-DUSE_DWIConvert:BOOL=OFF
# Disable testing that requires VTK
# -DBRAINSTools_BUILD_DICOM_SUPPORT:BOOL=OFF \
# -DUSE_DWIConvert:BOOL=OFF
- name: Build
shell: bash
run: cmake --build build --config Release --parallel ${{ matrix.config.parallel }}
- name: Clean build/BRAINSTools-Release-EPRelease-build
working-directory: build/BRAINSTools-Release-EPRelease-build
shell: bash
run: ninja clean
- name: ExperimentalStart
working-directory: build/BRAINSTools-Release-EPRelease-build
shell: bash
run: ctest -D ExperimentalStart
- name: ExperimentalConfigure
working-directory: build/BRAINSTools-Release-EPRelease-build
shell: bash
run: ctest -D ExperimentalConfigure
- name: ExperimentalBuild
working-directory: build/BRAINSTools-Release-EPRelease-build
shell: bash
run: ctest -D ExperimentalBuild -j ${{ matrix.config.parallel }}
- name: ExperimentalTest
working-directory: build/BRAINSTools-Release-EPRelease-build
shell: bash
run: ctest -D ExperimentalTest --schedule-random --output-on-failure -j ${{ matrix.config.parallel }}
- name: ExperimentalSubmit
working-directory: build/BRAINSTools-Release-EPRelease-build
shell: bash
run: ctest -D ExperimentalSubmit
- name: Upload Build Logs
uses: actions/upload-artifact@v4
if: always() # Changed from failure() to always()
with:
name: build-logs-${{ matrix.config.name }}
path: |
build/CMakeFiles/CMakeOutput.log
build/CMakeFiles/CMakeError.log
build/Testing/Temporary/LastTest.log