Skip to content

Commit 87089e2

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 87089e2

File tree

4 files changed

+222
-197
lines changed

4 files changed

+222
-197
lines changed

.github/workflows/ci_macos.sh

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

.github/workflows/ci_ubuntu.sh

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

.github/workflows/ci_windows.sh

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

0 commit comments

Comments
 (0)