Repository navigation
47 lines (47 loc) · 1.68 KB
/
Copy pathpython-numpy.yml
File metadata and controls
47 lines (47 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Python and NumPy bindings
on:
push:
paths-ignore:
- upstream-patches/**
branches: [master]
pull_request:
paths-ignore:
- upstream-patches/**
workflow_dispatch:
permissions:
contents: read
jobs:
python:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: pwsh
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Build shared library
run: |
cmake -S . -B build -DFREEIMAGE_STATIC=OFF -DBUILD_TESTS=OFF -DCMAKE_CXX_STANDARD=11 -DCMAKE_BUILD_TYPE=Release
if ($LASTEXITCODE) { exit $LASTEXITCODE }
cmake --build build --config Release --parallel 4
if ($LASTEXITCODE) { exit $LASTEXITCODE }
$library = Get-ChildItem build -Recurse -File | Where-Object { $_.Name -in @('FreeImage.dll', 'libFreeImage.so', 'libFreeImage.dylib') } | Select-Object -First 1
if (-not $library) { throw 'Shared library was not produced' }
"FREEIMAGE_LIBRARY=$($library.FullName)" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
- name: Install package and build wheel
run: |
python -m pip install ./bindings/python
if ($LASTEXITCODE) { exit $LASTEXITCODE }
python -m pip wheel --no-deps ./bindings/python --wheel-dir dist
- name: Test installed package
run: python -m unittest discover -s bindings/python/tests -v
- uses: actions/upload-artifact@v4
with:
name: python-wheel-${{ matrix.os }}
path: dist/*.whl