@@ -6,22 +6,13 @@ name: Build and Test C++ and Python
66
77# Controls when the workflow will run
88on :
9- # run pipeline on push event of main branch
10- push :
11- branches :
12- - main
13- # run pipeline on pull request
14- pull_request :
15- # run pipeline on merge queue
16- merge_group :
179 # run pipeline from another workflow
1810 workflow_call :
1911 inputs :
2012 create_release :
2113 type : boolean
2214 description : Create a (pre-)release when CI passes
23- default : false
24- required : false
15+ required : true
2516 # run this workflow manually from the Actions tab
2617 workflow_dispatch :
2718 inputs :
3122 default : false
3223 required : true
3324
25+
3426concurrency :
3527 group : ${{ github.workflow }}-${{ github.ref }}-main
3628 cancel-in-progress : true
3729
38-
3930jobs :
40-
4131 acquire-python-version-build-sdist :
4232 name : Build sdist and set version
4333 runs-on : ubuntu-24.04
5444 python set_pypi_version.py
5545
5646 - name : Build SDist
57- run : python -m build --sdist --outdir wheelhouse .
47+ run : python -m build --sdist --outdir wheelhouse .
5848
5949 - name : Keep version file
6050 uses : actions/upload-artifact@v4
@@ -242,7 +232,6 @@ jobs:
242232 shell : bash -el {0}
243233 - os : windows
244234 shell : powershell
245-
246235 env :
247236 POWER_GRID_MODEL_NO_BINARY_BUILD : 1
248237
@@ -272,7 +261,6 @@ jobs:
272261 $vsPath = &(Join-Path ${env:ProgramFiles(x86)} '\Microsoft Visual Studio\Installer\vswhere.exe') -property installationpath
273262 Import-Module (Join-Path $vsPath 'Common7\Tools\Microsoft.VisualStudio.DevShell.dll')
274263 Enter-VsDevShell -VsInstallPath $vsPath -SkipAutomaticLocation -DevCmdArguments '-arch=x64 -host_arch=x64'
275-
276264 cmake -GNinja -DCMAKE_BUILD_TYPE=Release -B build/ -S .
277265 cmake --build build/ --verbose -j1
278266 cmake --install build/ --prefix ${env:CONDA_PREFIX}/Library
@@ -282,10 +270,10 @@ jobs:
282270 run : |
283271 cmake -GNinja -DCMAKE_BUILD_TYPE=Release -B build/ -S . -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_PREFIX_PATH=$CONDA_PREFIX
284272 cmake --build build/ --verbose -j1
285- cmake --install build/
273+ cmake --install build/
286274
287275 - name : Build python
288- run : python -m pip install . -vv --no-build-isolation --no-deps
276+ run : python -m pip install . -vv --no-build-isolation --no-deps
289277
290278 - name : Test
291279 run : pytest
@@ -337,15 +325,15 @@ jobs:
337325 run : echo "${{ steps.tag.outputs.tag }}"
338326
339327 - name : Upload wheels
340- if : (github.event_name == 'push') || ((github.event_name == 'workflow_dispatch') && ( inputs.create_release == 'true') )
328+ if : (inputs.create_release)
341329 run : |
342330 pip install twine
343331 echo "Publish to PyPI..."
344332 twine upload --verbose wheelhouse/*
345333
346334 - name : Release
347335 uses : softprops/action-gh-release@v2
348- if : (github.event_name == 'push') || ((github.event_name == 'workflow_dispatch') && ( inputs.create_release == 'true') )
336+ if : (inputs.create_release)
349337 with :
350338 files : |
351339 ./wheelhouse/*
0 commit comments