Skip to content

Commit b012fa7

Browse files
authored
Merge pull request #14 from rainman110/python_build
Add python and conda builds to CI
2 parents 3864966 + 6e6edab commit b012fa7

2 files changed

Lines changed: 89 additions & 4 deletions

File tree

.github/workflows/build.yml

Lines changed: 85 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ jobs:
2222
uses: mamba-org/setup-micromamba@v2
2323
with:
2424
environment-name: occ_gordon-ci
25-
channels: conda-forge
26-
channel-priority: strict
2725
cache-environment: true
2826
cache-downloads: true
2927
create-args: >-
@@ -84,3 +82,88 @@ jobs:
8482
path: |
8583
build/tests/unittests/test-results
8684
build/tests/apitests/test-results
85+
86+
python-build:
87+
name: Python build
88+
runs-on: ubuntu-latest
89+
90+
steps:
91+
- uses: actions/checkout@v4
92+
93+
- name: Set up micromamba
94+
uses: mamba-org/setup-micromamba@v2
95+
with:
96+
environment-name: occ_gordon-python
97+
cache-environment: true
98+
cache-downloads: true
99+
create-args: >-
100+
python=3.11
101+
pip
102+
scikit-build-core
103+
cmake
104+
ninja
105+
swig
106+
cxx-compiler
107+
occt=7.9.3
108+
pythonocc-core=7.9.3
109+
110+
- name: Install Python package
111+
shell: bash -el {0}
112+
working-directory: python
113+
run: |
114+
export CMAKE_GENERATOR=Ninja
115+
python -m pip install -v --no-build-isolation .
116+
117+
- name: Smoke test Python package
118+
shell: bash -el {0}
119+
run: |
120+
python -c "import occ_gordon; import occ_gordon.occ_helpers.topology; print(occ_gordon.__file__)"
121+
122+
conda-package:
123+
name: Conda package (${{ matrix.os }})
124+
runs-on: ${{ matrix.os }}
125+
126+
strategy:
127+
fail-fast: false
128+
matrix:
129+
include:
130+
- os: ubuntu-latest
131+
test_package: true
132+
- os: windows-2022
133+
test_package: false
134+
135+
env:
136+
CONDA_BLD_PATH: ${{ github.workspace }}/conda-bld
137+
138+
steps:
139+
- uses: actions/checkout@v4
140+
141+
- name: Setup MSVC compiler
142+
if: startsWith(matrix.os, 'windows')
143+
uses: ilammy/msvc-dev-cmd@v1
144+
145+
- name: Set up micromamba
146+
uses: mamba-org/setup-micromamba@v2
147+
with:
148+
environment-name: occ_gordon-conda
149+
cache-environment: true
150+
cache-downloads: true
151+
create-args: >-
152+
boa
153+
python=3.11
154+
155+
- name: Build conda package
156+
shell: bash -el {0}
157+
run: |
158+
if [ "${{ matrix.test_package }}" = "true" ]; then
159+
conda mambabuild conda --python 3.11
160+
else
161+
conda mambabuild conda --python 3.11 --no-test
162+
fi
163+
164+
- name: Upload conda packages
165+
if: always()
166+
uses: actions/upload-artifact@v4
167+
with:
168+
name: occ_gordon-conda-${{ matrix.os }}
169+
path: conda-bld

conda/meta.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ package:
66

77
source:
88
git_url: https://github.com/rainman110/occ_gordon
9-
git_tag: main # v{{ version }}
9+
git_tag: main # {{ version }}
1010

1111
build:
1212
number: 0
@@ -22,11 +22,13 @@ requirements:
2222
- python {{ python }}
2323
- pip
2424
- scikit-build-core
25+
- occt ==7.9.3
2526
- pythonocc-core==7.9.3
2627

2728
run:
2829
- python {{ python }}
29-
- pythonocc-core
30+
- occt ==7.9.3
31+
- pythonocc-core==7.9.3
3032

3133
test:
3234
imports:

0 commit comments

Comments
 (0)