-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ea74fc1
commit a96abcb
Showing
13 changed files
with
94 additions
and
97 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,32 @@ | ||
name: CMake build | ||
name: Build python wheels | ||
|
||
on: | ||
push: | ||
pull_request: | ||
schedule: | ||
- cron: '0 0 * * 1' # 0h mondays | ||
workflow_dispatch: | ||
inputs: | ||
git-ref: | ||
description: Git Ref (Optional) | ||
required: false | ||
|
||
# Show the git ref in the workflow name if it is invoked manually. | ||
run-name: ${{ github.event_name == 'workflow_dispatch' && format('Manual run {0} ', inputs.git-ref) || '' }} | ||
|
||
|
||
permissions: | ||
contents: read | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
|
||
build-python: | ||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
continue-on-error: true | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-2019] | ||
# env: | ||
# BUILD_PYTHON_CI: 1 # Or maybe just a cmake option BUILD_PYTHON? Defaulted to false? And maybe we can set shared libs to false for this build? | ||
os: [ubuntu-20.04, windows-2019, macos-11] | ||
|
||
steps: | ||
|
||
- name: Clone Repository (Latest) | ||
uses: actions/checkout@v4 | ||
if: github.event.inputs.git-ref == '' | ||
with: | ||
ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS | ||
submodules: recursive | ||
- name: Clone Repository (Custom Ref) | ||
uses: actions/checkout@v4 | ||
if: github.event.inputs.git-ref != '' | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.inputs.git-ref }} | ||
ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS | ||
submodules: recursive | ||
fetch-depth: 0 # Get tags for use with git describe | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
|
||
- run: pip install numpy pytest | ||
- run: python -c "import sys; print('PYTHON_EXECUTABLE=' + sys.executable)" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- name: Install Ninja / Ubuntu | ||
if: ${{ matrix.os == 'ubuntu-latest' }} | ||
run: sudo apt update && sudo apt install ninja-build | ||
- name: Install Ninja / MacOS | ||
if: ${{ matrix.os == 'macos-latest' }} | ||
run: brew install ninja | ||
- name: Install Ninja / Windows | ||
if: ${{ matrix.os == 'windows-2022' }} | ||
run: choco install ninja | ||
- name: Checkout pybind11 submodule | ||
run: git submodule update --init python/pybind11 | ||
|
||
- name: Win_amd64 - install rtools | ||
if: ${{ matrix.os == 'windows-2022' }} | ||
run: | | ||
# mingw-w64 | ||
choco install rtools -y --no-progress --force --version=4.0.0.20220206 | ||
echo "c:\rtools40\ucrt64\bin;" >> $env:GITHUB_PATH | ||
# TODO: I need to move the mingw folder so that it doesn't pick up the wrong gcc, yes? | ||
- uses: fortran-lang/setup-fortran@main | ||
id: setup-fortran | ||
with: | ||
compiler: gcc | ||
version: 8 | ||
|
||
- name: Build | ||
run: | | ||
cmake --version | ||
cmake -G Ninja -DPython_EXECUTABLE=$PYTHON_EXECUTABLE -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=. -LAH . | ||
cmake --build . --target prima_pybind | ||
cmake --build . --target tests | ||
ctest --output-on-failure -V -R python-tests | ||
shell: bash | ||
- name: Build wheels | ||
uses: pypa/cibuildwheel@v2.16.2 | ||
|
||
# This is a work in progress, more to come. | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: ./wheelhouse/*.whl |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,6 +109,7 @@ parts/ | |
sdist/ | ||
var/ | ||
wheels/ | ||
wheelhouse | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
|
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
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
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
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
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
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
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
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
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
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