Updated python bindings with python-dev-level stuff #812
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: win-build | |
on: | |
push: | |
branches: [ main, dev ] | |
pull_request: | |
branches: [ main, dev ] | |
workflow_dispatch: | |
env: | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
BUILD_TYPE: Release | |
USER_CONFIG: ${{github.workspace}}/.github/config/boost/user-config.jam | |
jobs: | |
build-boost: | |
runs-on: windows-2019 | |
defaults: | |
run: | |
working-directory: ${{github.workspace}} | |
steps: | |
- name: Add MSBuild to PATH | |
uses: microsoft/[email protected] | |
- name: Create folder structure | |
run: | | |
mkdir ${{github.workspace}}/lib | |
- name: Cache Boost | |
id: cache-boost | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{github.workspace}}/lib/boost | |
${{github.workspace}}/.github/config/boost | |
key: ${{ runner.os }}-boost.1.78-2 | |
- uses: actions/checkout@v3 | |
- name: Set Up Python 3.6 | |
if: steps.cache-boost.outputs.cache-hit != 'true' | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.6' | |
- name: Write Python 3.6 to user-config.jam | |
if: steps.cache-boost.outputs.cache-hit != 'true' | |
run: | | |
$pythonString = "using python `n`t: 3.6 `n`t: ${{env.pythonLocation}}\bin\python.exe `n`t: ${{env.pythonLocation}}\include `n`t: ${{env.pythonLocation}}\libs `n;" | |
echo $pythonString.replace("\", "\\") >> ${{env.USER_CONFIG}} | |
- name: Set Up Python 3.7 | |
if: steps.cache-boost.outputs.cache-hit != 'true' | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.7' | |
- name: Write Python 3.7 to user-config.jam | |
if: steps.cache-boost.outputs.cache-hit != 'true' | |
run: | | |
$pythonString = "using python `n`t: 3.7 `n`t: ${{env.pythonLocation}}\bin\python.exe `n`t: ${{env.pythonLocation}}\include `n`t: ${{env.pythonLocation}}\libs `n;" | |
echo $pythonString.replace("\", "\\") >> ${{env.USER_CONFIG}} | |
- name: Set Up Python 3.8 | |
if: steps.cache-boost.outputs.cache-hit != 'true' | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.8' | |
- name: Write Python 3.8 to user-config.jam | |
if: steps.cache-boost.outputs.cache-hit != 'true' | |
run: | | |
$pythonString = "using python `n`t: 3.8 `n`t: ${{env.pythonLocation}}\bin\python.exe `n`t: ${{env.pythonLocation}}\include `n`t: ${{env.pythonLocation}}\libs `n;" | |
echo $pythonString.replace("\", "\\") >> ${{env.USER_CONFIG}} | |
- name: Set Up Python 3.9 | |
if: steps.cache-boost.outputs.cache-hit != 'true' | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Write Python 3.9 to user-config.jam | |
if: steps.cache-boost.outputs.cache-hit != 'true' | |
run: | | |
$pythonString = "using python `n`t: 3.9 `n`t: ${{env.pythonLocation}}\bin\python.exe `n`t: ${{env.pythonLocation}}\include `n`t: ${{env.pythonLocation}}\libs `n;" | |
echo $pythonString.replace("\", "\\") >> ${{env.USER_CONFIG}} | |
- name: Set Up Python 3.10 | |
if: steps.cache-boost.outputs.cache-hit != 'true' | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Write Python 3.10 to user-config.jam | |
if: steps.cache-boost.outputs.cache-hit != 'true' | |
run: | | |
$pythonString = "using python `n`t: 3.10 `n`t: ${{env.pythonLocation}}\bin\python.exe `n`t: ${{env.pythonLocation}}\include `n`t: ${{env.pythonLocation}}\libs `n;" | |
echo $pythonString.replace("\", "\\") >> ${{env.USER_CONFIG}} | |
- uses: suisei-cn/[email protected] | |
if: steps.cache-boost.outputs.cache-hit != 'true' | |
id: downloadboost | |
name: Download boost | |
with: | |
url: "https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.zip" | |
target: lib/boost_1_78_0.zip | |
- name: Extract boost | |
if: steps.cache-boost.outputs.cache-hit != 'true' | |
working-directory: ${{env.GITHUB_WORKSPACE}} | |
run: | | |
7z x lib/boost_1_78_0.zip -olib | |
move lib/boost_1_78_0 lib/boost | |
- uses: suisei-cn/[email protected] | |
id: downloadzlib | |
name: Download zlib | |
with: | |
url: "https://github.com/madler/zlib/releases/download/v1.3/zlib13.zip" | |
target: lib/boost/zlib13.zip | |
- name: Extract zlib | |
working-directory: ${{env.GITHUB_WORKSPACE}} | |
run: | | |
7z x lib/boost/zlib13.zip -olib/boost | |
- name: Build Boost | |
if: steps.cache-boost.outputs.cache-hit != 'true' | |
working-directory: ${{env.GITHUB_WORKSPACE}} | |
run: | | |
Get-Content ${{env.USER_CONFIG}} | |
cd lib/boost | |
cmd.exe /c 'bootstrap.bat' | |
.\b2.exe --user-config=${{env.USER_CONFIG}} -j6 -sNO_ZLIB=0 -sZLIB_INCLUDE="zlib-1.3" -sZLIB_SOURCE="zlib-1.3" address-model=64 link=static python=3.6,3.7,3.8,3.9,3.10 | |
build-libs: | |
runs-on: windows-2019 | |
defaults: | |
run: | |
working-directory: ${{github.workspace}} | |
steps: | |
- name: Add MSBuild to PATH | |
uses: microsoft/[email protected] | |
- name: Create folder structure | |
run: | | |
mkdir ${{github.workspace}}/lib | |
- name: Cache Armadillo, GDAL and LASTools | |
id: cache-lastools-armadillo-gdal | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{github.workspace}}/lib | |
key: ${{ runner.os }}-gdal-lastools-armadillo-latest3 | |
- uses: suisei-cn/[email protected] | |
if: steps.cache-lastools-armadillo-gdal.outputs.cache-hit != 'true' | |
id: downloadarmadillo | |
name: Download Armadillo | |
with: | |
url: "http://sourceforge.net/projects/arma/files/armadillo-10.6.2.tar.xz" | |
target: lib/armadillo.tar.xz | |
- name: Install Armadillo | |
if: steps.cache-lastools-armadillo-gdal.outputs.cache-hit != 'true' | |
working-directory: ${{env.GITHUB_WORKSPACE}} | |
run: | | |
cd lib | |
dir | |
7z x armadillo.tar.xz | |
7z x armadillo-10.6.2.tar | |
dir | |
move armadillo-10.6.2 armadillo | |
cd armadillo | |
$env:Path += ';"C:\Program Files\scilab-6.1.1\bin"' | |
cmake -DCMAKE_BUILD_TYPE=Release -DLAPACK_LIBRARY="C:\Program Files\scilab-6.1.1\bin\lapack.lib" -DBLAS_LIBRARY="C:\Program Files\scilab-6.1.1\bin\blasplus.lib" . | |
msbuild.exe armadillo.sln /p:Configuration=Release | |
- uses: suisei-cn/[email protected] | |
if: steps.cache-lastools-armadillo-gdal.outputs.cache-hit != 'true' | |
id: downloadglm | |
name: Download GLM | |
with: | |
url: "https://github.com/g-truc/glm/releases/download/0.9.9.8/glm-0.9.9.8.zip" | |
target: lib/glm-0.9.9.8.zip | |
- name: Extract GLM | |
if: steps.cache-lastools-armadillo-gdal.outputs.cache-hit != 'true' | |
working-directory: ${{env.GITHUB_WORKSPACE}} | |
run: | | |
7z x lib/glm-0.9.9.8.zip -olib | |
dir lib | |
- uses: suisei-cn/[email protected] | |
if: steps.cache-lastools-armadillo-gdal.outputs.cache-hit != 'true' | |
id: downloadgdal1 | |
name: Download GDAL (1/2) | |
with: | |
url: "https://download.gisinternals.com/sdk/downloads/release-1928-x64-gdal-3-5-3-mapserver-8-0-0-libs.zip" | |
target: lib/gdal.zip | |
- name: Extract GDAL | |
if: steps.cache-lastools-armadillo-gdal.outputs.cache-hit != 'true' | |
working-directory: ${{env.GITHUB_WORKSPACE}} | |
run: | | |
cd lib | |
7z x gdal.zip -ogdal | |
dir . | |
dir gdal | |
move gdal/include/boost gdal/include/boost-gdal | |
- uses: suisei-cn/[email protected] | |
if: steps.cache-lastools-armadillo-gdal.outputs.cache-hit != 'true' | |
id: downloadlastools | |
name: Download LAStools | |
with: | |
url: "https://github.com/LAStools/LAStools/releases/download/v2.0.2/LAStools.zip" | |
target: lib/LAStools.zip | |
- name: Extract LAStools | |
if: steps.cache-lastools-armadillo-gdal.outputs.cache-hit != 'true' | |
working-directory: ${{env.GITHUB_WORKSPACE}} | |
run: | | |
cd lib | |
7z x LAStools.zip | |
cd LAStools | |
cmake -DCMAKE_BUILD_TYPE=Release . | |
msbuild.exe LAStools.sln /p:Configuration=Release | |
build-helios: | |
runs-on: windows-2019 | |
needs: [build-boost, build-libs] | |
defaults: | |
run: | |
working-directory: ${{github.workspace}} | |
strategy: | |
matrix: | |
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] | |
steps: | |
- name: Add MSBuild to PATH | |
uses: microsoft/[email protected] | |
- uses: suisei-cn/[email protected] | |
id: downloadscilab | |
name: Download SciLab | |
with: | |
url: "https://oos.eu-west-2.outscale.com/scilab-releases/6.1.1/scilab-6.1.1_x64.exe" | |
- name: Install | |
working-directory: ${{env.GITHUB_WORKSPACE}} | |
run: | | |
dir | |
Start-Process -FilePath .\scilab-6.1.1_x64.exe -ArgumentList "/SILENT /NORESTART /DIR=`"C:\Program Files\scilab-6.1.1\`"" -Wait | |
dir "C:\Program Files" | |
dir "C:\Program Files\scilab-6.1.1" | |
- uses: actions/checkout@v3 | |
- name: Set Up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Load LasTools, Armadillo and GDAL from cache | |
id: cache-lastools-armadillo-gdal | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{github.workspace}}/lib | |
key: ${{ runner.os }}-gdal-lastools-armadillo-latest3 | |
restore-keys: | | |
Windows-gdal-lastools-armadillo-latest | |
- name: Load Boost from Cache | |
id: cache-boost | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{github.workspace}}/lib/boost | |
${{github.workspace}}/.github/config/boost | |
key: ${{ runner.os }}-boost.1.78-2 | |
- name: Build HELIOS++ | |
working-directory: ${{env.GITHUB_WORKSPACE}} | |
run: | | |
dir "C:\Program Files\scilab-6.1.1\bin" | |
$py_no_dot="${{ matrix.python-version }}" | |
$py_no_dot=$py_no_dot.Replace(".", "") | |
((Get-Content -path src\main\helios_version.cpp -Raw) -replace '(^const char \* HELIOS_VERSION = ")(.*)(";)','$1$2 - ${{ github.head_ref }}.${{ github.sha }}$3') | Set-Content -Path src\main\helios_version.cpp | |
cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_BINDING=1 "-DPYTHON_VERSION=${{ matrix.python-version }}" -DPYTHON_PATH=${{env.pythonLocation}} -DLAPACK_LIB="C:\Program Files\scilab-6.1.1\bin\lapack.lib;C:\Program Files\scilab-6.1.1\bin\blasplus.lib" . | |
msbuild.exe helios.sln /p:AdditionalDependencies='"C:\Program Files\scilab-6.1.1\bin\blasplus.lib;C:\Program Files\scilab-6.1.1\bin\lapack.lib"' /p:AdditionalLibraryDirectories='"C:\Program Files\scilab-6.1.1\bin"' /p:Configuration=Release | |
copy ${{github.workspace}}/Release/helios.exe ${{github.workspace}}/run/helios.exe | |
copy ${{github.workspace}}/Release/_pyhelios.pyd "${{github.workspace}}/run/_pyhelios.cpython-$py_no_dot.pyd" | |
- name: Save compiled executable | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ runner.os}}-helios-pybinds-${{ matrix.python-version }} | |
path: | | |
${{github.workspace}}/run/helios.exe | |
${{github.workspace}}/run/_pyhelios.cpython-*.pyd | |
- name: Test | |
if: false | |
run: ${{github.workspace}}/run/helios.exe --test |