Restructure python bindings, add more core bindings and tests #275
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: Build & Test | |
on: | |
push: | |
branches: ["main"] | |
tags: "v*" | |
pull_request: | |
branches: ["main"] | |
tags: "v*" | |
env: | |
BUILD_TYPE: Release | |
CPM_SOURCE_CACHE: ${{github.workspace}}/cache/cpm | |
OCC_DATA_PATH: ${{github.workspace}}/share | |
jobs: | |
build: | |
strategy: | |
matrix: | |
include: | |
- os: macos-latest | |
architecture: "arm64" | |
script: macos_generic_build.sh | |
name: "macos-arm64" | |
- os: macos-latest | |
architecture: "x86_64" | |
script: macos_generic_build.sh | |
name: "macos-x86_64" | |
- os: macos-latest | |
architecture: "x86_64;arm64" | |
script: macos_generic_build.sh | |
name: "macos-universal" | |
- os: ubuntu-latest | |
architecture: x86_64 | |
script: linux_generic_build.sh | |
name: "linux-x86_64" | |
- os: ubuntu-latest | |
architecture: x86_64 | |
script: linux_static_build.sh | |
name: "linux-x86_64-static" | |
- os: windows-latest | |
architecture: x86_64 | |
script: windows_build.ps1 | |
name: "windows-x86_64" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Dependencies Linux | |
if: startsWith(runner.os, 'Linux') | |
run: | | |
sudo apt update | |
sudo apt install -y python3-numpy libpthread-stubs0-dev \ | |
doxygen graphviz ninja-build | |
- name: Install Dependencies Mac | |
if: startsWith(runner.os, 'macOS') | |
run: | | |
brew install ninja doxygen graphviz | |
- name: Install Dependencies Windows | |
if: startsWith(runner.os, 'Windows') | |
run: | | |
choco install ninja -y | |
- name: Cache CPM Dependencies | |
uses: actions/cache@v4 | |
with: | |
path: | | |
${{env.CPM_SOURCE_CACHE}} | |
${{github.workspace}}/build | |
key: ${{ matrix.name }}-occ-build-cache | |
- name: Run build script (non-Windows) | |
if: runner.os != 'Windows' | |
run: | | |
rm -f build/*.xz | |
./scripts/${{matrix.script}} "${{matrix.architecture}}" "${{matrix.name}}" | |
- name: Run build script (Windows) | |
if: runner.os == 'Windows' | |
shell: pwsh | |
run: | | |
Remove-Item -Path build/*.xz -ErrorAction SilentlyContinue | |
./scripts/${{matrix.script}} "${{matrix.architecture}}" "${{matrix.name}}" | |
- name: Test | |
if: matrix.name == 'linux-x86_64' | |
working-directory: ${{github.workspace}}/build | |
run: ctest -C ${{env.BUILD_TYPE}} --rerun-failed --output-on-failure | |
- name: Build Documentation | |
if: matrix.name == 'linux-x86_64' | |
run: cmake --build ${{github.workspace}}/build --target docs | |
- name: Deploy Documentation | |
if: matrix.name == 'linux-x86_64' | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ${{github.workspace}}/build/docs/html | |
- name: Upload binaries | |
uses: actions/upload-artifact@v4 | |
with: | |
name: occ-binaries-${{ matrix.name }} | |
path: ${{github.workspace}}/build/*.xz | |
overwrite: true | |
create-release: | |
runs-on: ubuntu-latest | |
needs: build | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: binaries | |
pattern: occ-binaries-* | |
merge-multiple: true | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
binaries/* |