Skip to content

Commit 6f158a7

Browse files
authored
Merge pull request #28 from thewtex/all-repos_autofix_ci-itk-5.4.0-secret-syntax
ENH: Upgrade CI for ITK 5.4.0
2 parents e38e8a3 + b391af2 commit 6f158a7

File tree

1 file changed

+10
-277
lines changed

1 file changed

+10
-277
lines changed
Lines changed: 10 additions & 277 deletions
Original file line numberDiff line numberDiff line change
@@ -1,282 +1,15 @@
1+
12
name: Build, test, package
23

34
on: [push,pull_request]
45

56
jobs:
6-
build-test-cxx:
7-
runs-on: ${{ matrix.os }}
8-
strategy:
9-
max-parallel: 3
10-
matrix:
11-
os: [ubuntu-18.04, windows-2019, macos-10.15]
12-
include:
13-
- os: ubuntu-18.04
14-
c-compiler: "gcc"
15-
cxx-compiler: "g++"
16-
itk-git-tag: "d6acfd26bfcdec606d605beb1301bddfb17c05a6"
17-
cmake-build-type: "MinSizeRel"
18-
- os: windows-2019
19-
c-compiler: "cl.exe"
20-
cxx-compiler: "cl.exe"
21-
itk-git-tag: "d6acfd26bfcdec606d605beb1301bddfb17c05a6"
22-
cmake-build-type: "Release"
23-
- os: macos-10.15
24-
c-compiler: "clang"
25-
cxx-compiler: "clang++"
26-
itk-git-tag: "d6acfd26bfcdec606d605beb1301bddfb17c05a6"
27-
cmake-build-type: "MinSizeRel"
28-
29-
steps:
30-
- uses: actions/checkout@v1
31-
32-
- name: Set up Python 3.7
33-
uses: actions/setup-python@v1
34-
with:
35-
python-version: 3.7
36-
37-
- name: Install build dependencies
38-
run: |
39-
python -m pip install --upgrade pip
40-
python -m pip install ninja
41-
42-
- name: Get specific version of CMake, Ninja
43-
uses: lukka/get-cmake@v3.18.3
44-
45-
- name: Download ITK
46-
run: |
47-
cd ..
48-
git clone https://github.com/InsightSoftwareConsortium/ITK.git
49-
cd ITK
50-
git checkout ${{ matrix.itk-git-tag }}
51-
52-
#ITK-b due to path length issues for Windows
53-
- name: Build ITK
54-
if: matrix.os != 'windows-2019'
55-
run: |
56-
cd ..
57-
mkdir ITK-b
58-
cd ITK-b
59-
cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING=${{ matrix.cmake-build-type }} -DBUILD_TESTING:BOOL=OFF -GNinja ../ITK
60-
ninja
61-
62-
- name: Build ITK
63-
if: matrix.os == 'windows-2019'
64-
run: |
65-
cd ..
66-
mkdir ITK-b
67-
cd ITK-b
68-
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
69-
cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING=${{ matrix.cmake-build-type }} -DBUILD_TESTING:BOOL=OFF -GNinja ../ITK
70-
ninja
71-
shell: cmd
72-
73-
- name: Fetch CTest driver script
74-
run: |
75-
curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITK/dashboard/itk_common.cmake -O
76-
77-
- name: Configure CTest script
78-
shell: bash
79-
run: |
80-
operating_system="${{ matrix.os }}"
81-
cat > dashboard.cmake << EOF
82-
set(CTEST_SITE "GitHubActions")
83-
file(TO_CMAKE_PATH "\$ENV{GITHUB_WORKSPACE}/.." CTEST_DASHBOARD_ROOT)
84-
file(TO_CMAKE_PATH "\$ENV{GITHUB_WORKSPACE}/" CTEST_SOURCE_DIRECTORY)
85-
file(TO_CMAKE_PATH "\$ENV{GITHUB_WORKSPACE}/../build" CTEST_BINARY_DIRECTORY)
86-
set(dashboard_source_name "${GITHUB_REPOSITORY}")
87-
if(ENV{GITHUB_REF} MATCHES "master")
88-
set(branch "-master")
89-
set(dashboard_model "Continuous")
90-
else()
91-
set(branch "-${GITHUB_REF}")
92-
set(dashboard_model "Experimental")
93-
endif()
94-
set(CTEST_BUILD_NAME "${GITHUB_REPOSITORY}-${operating_system}-\${branch}")
95-
set(CTEST_UPDATE_VERSION_ONLY 1)
96-
set(CTEST_TEST_ARGS \${CTEST_TEST_ARGS} PARALLEL_LEVEL \${PARALLEL_LEVEL})
97-
set(CTEST_BUILD_CONFIGURATION "Release")
98-
set(CTEST_CMAKE_GENERATOR "Ninja")
99-
set(CTEST_CUSTOM_WARNING_EXCEPTION
100-
\${CTEST_CUSTOM_WARNING_EXCEPTION}
101-
# macOS Azure VM Warning
102-
"ld: warning: text-based stub file"
103-
)
104-
set(dashboard_no_clean 1)
105-
set(ENV{CC} ${{ matrix.c-compiler }})
106-
set(ENV{CXX} ${{ matrix.cxx-compiler }})
107-
if(WIN32)
108-
set(ENV{PATH} "\${CTEST_DASHBOARD_ROOT}/ITK-build/bin;\$ENV{PATH}")
109-
endif()
110-
set(dashboard_cache "
111-
ITK_DIR:PATH=\${CTEST_DASHBOARD_ROOT}/ITK-b
112-
BUILD_TESTING:BOOL=ON
113-
")
114-
string(TIMESTAMP build_date "%Y-%m-%d")
115-
message("CDash Build Identifier: \${build_date} \${CTEST_BUILD_NAME}")
116-
message("CTEST_SITE = \${CTEST_SITE}")
117-
include(\${CTEST_SCRIPT_DIRECTORY}/itk_common.cmake)
118-
EOF
119-
cat dashboard.cmake
120-
121-
- name: Build and test
122-
if: matrix.os != 'windows-2019'
123-
run: |
124-
ctest --output-on-failure -j 2 -V -S dashboard.cmake
125-
126-
- name: Build and test
127-
if: matrix.os == 'windows-2019'
128-
run: |
129-
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
130-
ctest --output-on-failure -j 2 -V -S dashboard.cmake
131-
shell: cmd
132-
133-
build-linux-python-packages:
134-
runs-on: ubuntu-18.04
135-
strategy:
136-
max-parallel: 2
137-
matrix:
138-
python-version: [37, 38, 39, 310]
139-
include:
140-
- itk-python-git-tag: "v5.3rc04"
141-
142-
steps:
143-
- uses: actions/checkout@v2
144-
145-
- name: 'Free up disk space'
146-
run: |
147-
# Workaround for https://github.com/actions/virtual-environments/issues/709
148-
df -h
149-
sudo apt-get clean
150-
sudo rm -rf "/usr/local/share/boost"
151-
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
152-
df -h
153-
154-
- name: 'Fetch build script'
155-
run: |
156-
curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O
157-
chmod u+x dockcross-manylinux-download-cache-and-build-module-wheels.sh
158-
159-
- name: 'Build 🐍 Python 📦 package'
160-
run: |
161-
export ITK_PACKAGE_VERSION=${{ matrix.itk-python-git-tag }}
162-
./dockcross-manylinux-download-cache-and-build-module-wheels.sh cp${{ matrix.python-version }}
163-
164-
- name: Publish Python package as GitHub Artifact
165-
uses: actions/upload-artifact@v1
166-
with:
167-
name: LinuxWheel${{ matrix.python-version }}
168-
path: dist
169-
170-
build-macos-python-packages:
171-
runs-on: macos-10.15
172-
strategy:
173-
max-parallel: 2
174-
matrix:
175-
include:
176-
- itk-python-git-tag: "v5.3rc04"
177-
178-
steps:
179-
- uses: actions/checkout@v2
180-
181-
- name: 'Specific XCode version'
182-
run: |
183-
sudo xcode-select -s "/Applications/Xcode_11.7.app"
184-
185-
- name: Get specific version of CMake, Ninja
186-
uses: lukka/get-cmake@v3.18.3
187-
188-
- name: 'Fetch build script'
189-
run: |
190-
curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O
191-
chmod u+x macpython-download-cache-and-build-module-wheels.sh
192-
193-
- name: 'Build 🐍 Python 📦 package'
194-
run: |
195-
export ITK_PACKAGE_VERSION=${{ matrix.itk-python-git-tag }}
196-
export MACOSX_DEPLOYMENT_TARGET=10.9
197-
./macpython-download-cache-and-build-module-wheels.sh
198-
199-
- name: Publish Python package as GitHub Artifact
200-
uses: actions/upload-artifact@v1
201-
with:
202-
name: MacOSWheels
203-
path: dist
204-
205-
build-windows-python-packages:
206-
runs-on: windows-2019
207-
strategy:
208-
max-parallel: 2
209-
matrix:
210-
python-version-minor: [7, 8, 9, 10]
211-
include:
212-
- itk-python-git-tag: "v5.3rc04"
213-
214-
steps:
215-
- name: Get specific version of CMake, Ninja
216-
uses: lukka/get-cmake@v3.18.3
217-
218-
- uses: actions/checkout@v2
219-
with:
220-
path: "im"
221-
222-
- name: 'Install Python'
223-
run: |
224-
$pythonArch = "64"
225-
$pythonVersion = "3.${{ matrix.python-version-minor }}"
226-
iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/scikit-build/scikit-ci-addons/master/windows/install-python.ps1'))
227-
228-
- name: 'Fetch build dependencies'
229-
shell: bash
230-
run: |
231-
mv im ../../
232-
cd ../../im
233-
curl -L "https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/${{ matrix.itk-python-git-tag }}/ITKPythonBuilds-windows.zip" -o "ITKPythonBuilds-windows.zip"
234-
7z x ITKPythonBuilds-windows.zip -o/c/P -aoa -r
235-
curl -L "https://data.kitware.com/api/v1/file/5c0ad59d8d777f2179dd3e9c/download" -o "doxygen-1.8.11.windows.bin.zip"
236-
7z x doxygen-1.8.11.windows.bin.zip -o/c/P/doxygen -aoa -r
237-
curl -L "https://data.kitware.com/api/v1/file/5bbf87ba8d777f06b91f27d6/download/grep-win.zip" -o "grep-win.zip"
238-
7z x grep-win.zip -o/c/P/grep -aoa -r
239-
240-
- name: 'Build 🐍 Python 📦 package'
241-
shell: cmd
242-
run: |
243-
cd ../../im
244-
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
245-
set PATH=C:\P\grep;%PATH%
246-
set CC=cl.exe
247-
set CXX=cl.exe
248-
C:\Python3${{ matrix.python-version-minor }}-x64\python.exe C:\P\IPP\scripts\windows_build_module_wheels.py --py-envs "3${{ matrix.python-version-minor }}-x64"
249-
250-
- name: Publish Python package as GitHub Artifact
251-
uses: actions/upload-artifact@v1
252-
with:
253-
name: WindowsWheel3.${{ matrix.python-version-minor }}
254-
path: ../../im/dist
255-
256-
publish-python-packages-to-pypi:
257-
needs:
258-
- build-linux-python-packages
259-
- build-macos-python-packages
260-
- build-windows-python-packages
261-
runs-on: ubuntu-18.04
262-
263-
steps:
264-
- name: Download Python Packages
265-
uses: actions/download-artifact@v2
266-
267-
- name: Prepare packages for upload
268-
run: |
269-
ls -R
270-
for d in */; do
271-
mv ${d}/*.whl .
272-
done
273-
mkdir dist
274-
mv *.whl dist/
275-
ls dist
276-
277-
- name: Publish 🐍 Python 📦 package to PyPI
278-
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
279-
uses: pypa/gh-action-pypi-publish@master
280-
with:
281-
user: __token__
282-
password: ${{ secrets.pypi_password }}
7+
cxx-build-workflow:
8+
uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-cxx.yml@v5.4.0
9+
10+
python-build-workflow:
11+
uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-package-python.yml@v5.4.0
12+
with:
13+
test-notebooks: false
14+
secrets:
15+
pypi_password: ${{ secrets.pypi_password }}

0 commit comments

Comments
 (0)