Skip to content

Commit

Permalink
fix: ifco v08 support (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
Krande authored Sep 4, 2024
1 parent 03aef29 commit 539d503
Show file tree
Hide file tree
Showing 19 changed files with 1,239 additions and 182 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly # or daily, weekly
groups:
dependencies:
patterns:
- '*'
49 changes: 49 additions & 0 deletions .github/workflows/ci-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: ci-tests

# bump 1
on:
push:

# Use concurrency to ensure that only one instance of this workflow is running at a time
concurrency:
group: ci-tests-${{ github.ref_name }}
cancel-in-progress: true

env:
CROOT_DIR: /home/runner/work/build
ARTIFACTS_DIR: /home/runner/work/artifacts
PKG_DIR: linux-64

jobs:

build_test:
name: ada-cpp-test
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}

# Install OpenGL dependencies
- name: Install OpenGL dependencies
run: sudo apt-get update && sudo apt-get install -y libgl1-mesa-dev

- uses: mamba-org/setup-micromamba@v1 # https://github.com/mamba-org/setup-micromamba
with:
environment-file: environment.build.yml
cache-environment: true
cache-downloads: true
create-args: >-
python=3.12
ada-py
- name: install package
run: |
pip install .
- name: test package
run: |
pytest tests
61 changes: 39 additions & 22 deletions .github/workflows/ci-test.yaml → .github/workflows/pr-tests.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,36 @@
name: ci-ada-cpp-test
name: pr-tests

# bump 1
on:
push:
# branches:
# - donotrun
paths-ignore:
- README.md
- .gitignore
- .github/workflows/basic_test.yaml
pull_request:
branches:
- main

# Use concurrency to ensure that only one instance of this workflow is running at a time
concurrency:
group: pr-tests-${{ github.ref_name }}
cancel-in-progress: true

env:
CROOT_DIR: /home/runner/work/build
ARTIFACTS_DIR: /home/runner/work/artifacts

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}

- uses: prefix-dev/[email protected] # https://github.com/prefix-dev/setup-pixi
with:
pixi-version: v0.28.2
cache: true
environments: lint

- run: pixi run lint

build_test:
name: ada-cpp-${{ matrix.platform.name }}-${{ matrix.pyver.name }}-${{ matrix.variant.name }}=${{ matrix.variant.value }}
runs-on: ${{ matrix.platform.distver }}
Expand All @@ -25,19 +41,26 @@ jobs:
fail-fast: false
matrix:
pyver: [
{ name: py311, distver: '3.11' },
{ name: py312, distver: '3.12' },
]
platform: [
{ name: win, distver: windows-latest, pkg_dir: 'win-64' },
{ name: linux, distver: ubuntu-latest, pkg_dir: 'linux-64' },
{ name: macOS, distver: macos-latest, pkg_dir: 'osx-64' }
{ name: macOS, distver: macos-13, pkg_dir: 'osx-64' }
]
variant: [
{ name: occt, value: '7.7.2=*novtk*' },
{ name: occt, value: '7.7.2=*all*' }
{ name: variant, value: 'novtk' },
{ name: variant, value: 'all' }
]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}

# Install OpenGL dependencies
- name: Install OpenGL dependencies
if: ${{ matrix.platform.name == 'linux' }}
run: sudo apt-get update && sudo apt-get install -y libgl1-mesa-dev

- name: set ENV WORK_DIR
run: |
Expand All @@ -58,7 +81,7 @@ jobs:
if: ${{ matrix.platform.name == 'macOS' }}
run: |
curl -L https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.15.sdk.tar.xz | tar -xvJf - -C /Users/runner/work/
- uses: mamba-org/setup-micromamba@v1 # https://github.com/mamba-org/setup-micromamba
with:
Expand All @@ -73,11 +96,9 @@ jobs:
zstd_compression_level: 19
channel_priority: strict
channels:
- krande
- conda-forge
create-args: >-
python=${{ matrix.pyver.distver }}
anaconda-client
python=3.12
boa
- name: make dirs
Expand All @@ -88,8 +109,4 @@ jobs:
- name: build local packages
run: |
conda mambabuild . --python ${{ matrix.pyver.distver }} --variants "{ '${{matrix.variant.name}}': '${{matrix.variant.value}}'}"
working-directory: conda

- name: upload to anaconda
run: |
anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload --force --user krande --label dev ${{ env.ARTIFACTS_DIR }}/${{ env.PKG_DIR }}/*.conda
working-directory: conda
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ build/
cmake-build*/
.env
.env.json
temp/
temp/
.pixi/
18 changes: 0 additions & 18 deletions action_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,6 @@
enabled = true
pre_release_tag = "dev"

[tool.python.conda]
enabled = true
recipe_dir = "./conda"

# Anaconda Related
use_anaconda_server = true
owner = "Krande"
label = "main"
#
# info
#
# If you are uploading to public/private anaconda you need to set this
# secrets.CONDA_API_TOKEN
#
# Or if you will use a private QUETZ server you need to set these
# secrets.QUETZ_API_KEY
# secrets.QUETZ_URL

[tool.semantic_release]
version_toml = ["pyproject.toml:project.version"]
# info
Expand Down
4 changes: 1 addition & 3 deletions conda/bld.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
python -m pip install . --no-build-isolation -v ^
--config-settings=cmake.args=-DODBDUMP_BIN_DIR="%LIBRARY_PREFIX%"/bin ^
--config-settings=cmake.args=-DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^
--config-settings=cmake.args=-DCONDA_BUILD=ON

python %RECIPE_DIR%/stub_gen.py
--config-settings=cmake.args=-DCONDA_BUILD=ON
4 changes: 1 addition & 3 deletions conda/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@ set -ex
python -m pip install . --no-build-isolation -v \
--config-settings=cmake.args=-DODBDUMP_BIN_DIR="${PREFIX}"/bin \
--config-settings=cmake.args=-DCMAKE_INSTALL_PREFIX="${PREFIX}" \
--config-settings=cmake.args=-DCONDA_BUILD=ON

python "${RECIPE_DIR}/stub_gen.py"
--config-settings=cmake.args=-DCONDA_BUILD=ON
37 changes: 32 additions & 5 deletions conda/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,39 @@
occt:
- 7.7.2=*novtk*
- 7.7.2=*all*
- 7.7.2

#CONDA_BUILD_SYSROOT:
# - "/Users/runner/work/MacOSX10.15.sdk" # [osx]
variant:
- novtk
- all

c_stdlib:
- vs # [win]
- sysroot # [linux]
- macosx_deployment_target # [osx and x86_64]

cdt_name:
- cos7 # [linux]

c_stdlib_version:
- "10.15" # [osx and x86_64]
- '2.17' # [linux]

MACOSX_SDK_VERSION: # [osx and x86_64]
- "10.15" # [osx and x86_64]

c_compiler:
- vs2022 # [win]
- gcc # [linux]
- clang # [osx]

c_compiler_version:
- '17' # [osx]
- '13' # [linux]

cxx_compiler:
- vs2022 # [win]
- vs2022 # [win]
- gcc # [linux]
- clang # [osx]

cxx_compiler_version:
- '17' # [osx]
- '13' # [linux]
20 changes: 12 additions & 8 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,24 @@ source:
path: ../

build:
skip: True # [py<310]
number: 0
string: py{{ CONDA_PY }}_{{ variant }}_h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}
run_exports:
- {{ pin_subpackage(name, max_pin='x.x.x') }}

requirements:
build:
- "{{ compiler('c') }}"
- "{{ compiler('cxx') }}"
- "{{ cdt('mesa-libGL-devel') }}" # [unix] provides OpenGL development libraries
- {{ stdlib("c") }}
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- {{ cdt('mesa-libGL-devel') }} # [linux]
- cmake
- ninja # [win]
- make # [unix]

host:
- python
- occt
- pybind11-stubgen 2.1
- occt * *{{ variant }}*
- ifcopenshell
- cgal-cpp
- scikit-build-core
Expand All @@ -34,16 +39,15 @@ requirements:

run:
- python
- "{{ pin_compatible('occt', max_pin='x.x.x') }}"
- "{{ pin_compatible('gmsh', max_pin='x.x.x') }}"
- "{{ pin_compatible('ifcopenshell', max_pin='x.x.x') }}"

test:
source_files:
- tests
- files
requires:
- pytest
- ada-py
commands:
- pytest tests

Expand Down
Loading

0 comments on commit 539d503

Please sign in to comment.