Skip to content

Commit f0fa9dd

Browse files
committed
Update Github CI
Remove python 3.9 EOL Add python 3.13 Remove macos CI for PR to limit build time Add Windows ARM for tag version
1 parent 92c5534 commit f0fa9dd

File tree

4 files changed

+305
-201
lines changed

4 files changed

+305
-201
lines changed

.github/workflows/ci_macos.sh

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
#!/bin/bash
2+
set -e
3+
4+
brew install [email protected] || true
5+
brew link --overwrite [email protected]
6+
#brew update
7+
#rm -rf /usr/local/bin/python3.1*-config /usr/local/bin/2to3-3.1* /usr/local/bin/idle3.1* /usr/local/bin/pydoc3.1* /usr/local/bin/python3.1*
8+
#rm -rf /usr/local/bin/python3-config /usr/local/bin/2to3 /usr/local/bin/idle3 /usr/local/bin/pydoc3 /usr/local/bin/python3
9+
brew install --force --verbose --overwrite \
10+
ccache \
11+
fftw \
12+
libomp \
13+
xquartz \
14+
xerces-c \
15+
wget || true
16+
brew uninstall --ignore-dependencies libxext
17+
brew uninstall --ignore-dependencies libx11
18+
export LDFLAGS="-L/usr/local/opt/llvm/lib"
19+
export CPPFLAGS="-I/usr/local/opt/llvm/include -fopenmp"
20+
conda info
21+
conda list
22+
which python
23+
python --version
24+
export PATH="/usr/local/miniconda/envs/opengate_core/bin/:$PATH"
25+
pip install wget colored
26+
pip install wheel delocate
27+
if [[ ${{ matrix.os }} == "macos-15-intel" ]]; then
28+
conda install conda-forge::qt6-main conda-forge::qt6-3d
29+
else
30+
brew install qt
31+
fi
32+
mkdir -p $HOME/software
33+
if [ "${{ steps.cache_opengate_core_dependencies.outputs.cache-hit }}" != 'true' ]; then
34+
cd $HOME/software
35+
mkdir geant4
36+
cd geant4
37+
mkdir src bin data
38+
git clone --branch $GEANT4_VERSION https://github.com/Geant4/geant4.git --depth 1 src
39+
cd bin
40+
cmake -DCMAKE_CXX_FLAGS=-std=c++17 \
41+
-DGEANT4_INSTALL_DATA=OFF \
42+
-DGEANT4_INSTALL_DATADIR=$HOME/software/geant4/data \
43+
-DGEANT4_USE_QT=ON \
44+
-DGEANT4_USE_OPENGL_X11=OFF \
45+
-DGEANT4_USE_QT_QT6=ON \
46+
-DGEANT4_USE_SYSTEM_EXPAT=OFF \
47+
-DGEANT4_BUILD_MULTITHREADED=ON \
48+
-DGEANT4_USE_GDML=ON \
49+
../src
50+
make -j4
51+
cd $HOME/software
52+
mkdir itk
53+
cd itk
54+
mkdir src bin
55+
git clone --branch $ITK_VERSION https://github.com/InsightSoftwareConsortium/ITK.git --depth 1 src
56+
cd bin
57+
cmake -DCMAKE_CXX_FLAGS=-std=c++17 \
58+
-DBUILD_TESTING=OFF \
59+
-DITK_USE_FFTWD=ON \
60+
-DITK_USE_FFTWF=ON \
61+
-DITK_USE_SYSTEM_FFTW:BOOL=ON \
62+
../src
63+
make -j4
64+
fi
65+
cd $GITHUB_WORKSPACE
66+
source $HOME/software/geant4/bin/geant4make.sh
67+
export CMAKE_PREFIX_PATH=$HOME/software/geant4/bin:$HOME/software/itk/bin/:${CMAKE_PREFIX_PATH}
68+
cd core
69+
mkdir opengate_core/plugins
70+
if [[ ${{ matrix.os }} == "macos-15-intel" ]]; then
71+
cp -r /Users/runner/miniconda3/envs/opengate_core/lib/qt6/plugins/platforms/* opengate_core/plugins/
72+
cp -r /Users/runner/miniconda3/envs/opengate_core/lib/qt6/plugins/imageformats opengate_core/plugins/
73+
else
74+
cp -r /opt/homebrew/share/qt/plugins/platforms/* opengate_core/plugins/
75+
cp -r /opt/homebrew/share/qt/plugins/imageformats/* opengate_core/plugins/
76+
fi
77+
python3 setup.py sdist bdist_wheel
78+
ls dist
79+
if [[ ${{ matrix.os }} == "macos-15-intel" ]]; then
80+
export DYLD_LIBRARY_PATH=$HOME/software/geant4/bin/BuildProducts/lib:/Users/runner/miniconda3/envs/opengate_core/lib/qt6/plugins/platforms:/opt/X11/lib/:$DYLD_LIBRARY_PATH:/Users/runner/miniconda3/envs/opengate_core/lib
81+
else
82+
export DYLD_LIBRARY_PATH=$HOME/software/geant4/bin/BuildProducts/lib:/opt/homebrew/share/qt/plugins/platforms/:/opt/X11/lib/:$DYLD_LIBRARY_PATH:/opt/homebrew/lib
83+
python -c "import os,delocate; print(os.path.join(os.path.dirname(delocate.__file__), 'tools.py'));quit()" | xargs -I{} sed -i."" "s/first, /input.pop('i386',None); first, /g" {}
84+
fi
85+
delocate-listdeps --all dist/*.whl
86+
delocate-wheel -w fixed_wheels -v dist/*.whl
87+
rm -rf dist
88+
ls fixed_wheels
89+
delocate-listdeps --all fixed_wheels/*.whl
90+
mv fixed_wheels dist
91+
cd dist
92+
if [[ ${{ matrix.os }} == "macos-15-intel" ]]; then
93+
find . -name '*whl' -exec bash -c ' mv $0 ${0/macosx_15_0/macosx_10_9}' {} \;
94+
fi
95+
cd ../..
96+
mv core/dist .

.github/workflows/ci_ubuntu.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
set -e
3+
4+
if [ ${{ matrix.python-version }} == "3.10" ]; then
5+
export PYTHONFOLDER="cp310-cp310"
6+
elif [ ${{ matrix.python-version }} == "3.11" ]; then
7+
export PYTHONFOLDER="cp311-cp311"
8+
elif [ ${{ matrix.python-version }} == "3.12" ]; then
9+
export PYTHONFOLDER="cp312-cp312"
10+
elif [ ${{ matrix.python-version }} == "3.13" ]; then
11+
export PYTHONFOLDER="cp313-cp313"
12+
fi
13+
mkdir -p $HOME/software
14+
if [ ${{ matrix.os }} == "ubuntu-24.04-arm" ]; then
15+
export ARMDOCKER="_arm64"
16+
fi
17+
docker run --rm -e "PYTHONFOLDER=${PYTHONFOLDER}" -v $GITHUB_WORKSPACE:/home tbaudier/opengate_core:${{ env.GEANT4_VERSION }}$ARMDOCKER /home/.github/workflows/createWheelLinux.sh
18+
ls wheelhouse
19+
rm -rf dist
20+
mv wheelhouse dist
21+
sudo chown -R runner:docker dist

.github/workflows/ci_windows.sh

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/bin/bash
2+
set -e
3+
4+
conda info
5+
conda install cmake
6+
cmake --version
7+
conda list
8+
which python
9+
python --version
10+
export PATH="/usr/local/miniconda/envs/opengate_core/bin/:$PATH"
11+
pip install wheel wget colored
12+
pip install cibuildwheel==2.21.1
13+
which pip
14+
mkdir -p $HOME/software
15+
if [ "${{ steps.cache_opengate_core_dependencies.outputs.cache-hit }}" != 'true' ]; then
16+
cd $HOME/software
17+
mkdir geant4
18+
cd geant4
19+
mkdir src bin data
20+
git clone --branch $GEANT4_VERSION https://github.com/Geant4/geant4.git --depth 1 src
21+
cd bin
22+
cmake -DGEANT4_INSTALL_DATA=ON \
23+
-DGEANT4_INSTALL_DATADIR=$HOME/software/geant4/data \
24+
-DGEANT4_BUILD_MULTITHREADED=ON \
25+
../src
26+
cmake --build . --config Release
27+
cd $HOME/software
28+
mkdir itk
29+
cd itk
30+
mkdir src bin
31+
git clone --branch $ITK_VERSION https://github.com/InsightSoftwareConsortium/ITK.git --depth 1 src
32+
cd bin
33+
cmake -DCMAKE_CXX_FLAGS=-std=c++17 \
34+
-DBUILD_TESTING=OFF \
35+
../src
36+
cmake --build . --config Release
37+
fi
38+
cd $GITHUB_WORKSPACE
39+
source $HOME/software/geant4/bin/geant4make.sh
40+
export CMAKE_PREFIX_PATH=$HOME/software/geant4/bin:$HOME/software/itk/bin/:${CMAKE_PREFIX_PATH}
41+
cd core
42+
if [[ ${{ matrix.python-version }} == "3.10" ]]; then
43+
export CIBW_BUILD="cp310-win_amd64"
44+
elif [[ ${{ matrix.python-version }} == "3.11" ]]; then
45+
export CIBW_BUILD="cp311-win_amd64"
46+
elif [[ ${{ matrix.python-version }} == "3.12" ]]; then
47+
export CIBW_BUILD="cp312-win_amd64"
48+
elif [[ ${{ matrix.python-version }} == "3.13" ]]; then
49+
export CIBW_BUILD="cp313-win_amd64"
50+
fi
51+
find $HOME/software/geant4/bin/ -iname "*.dll"
52+
ls $HOME/software/geant4/bin/BuildProducts/Release/bin
53+
ls $HOME/software/geant4/bin/BuildProducts/Release/lib/
54+
export CIBW_BEFORE_BUILD="python -m pip install colored"
55+
python -m cibuildwheel --output-dir dist
56+
cd ..
57+
mkdir core/dist2
58+
pip install pefile machomachomangler
59+
ls core/dist
60+
python $GITHUB_WORKSPACE\\.github\\workflows\\delocateWindows.py core\\dist -w core\\dist2 -d C:\\Users\\runneradmin\\software\\geant4\\bin\\BuildProducts\\Release\\bin
61+
mv core/dist2 dist

0 commit comments

Comments
 (0)