-
Notifications
You must be signed in to change notification settings - Fork 5
116 lines (114 loc) · 3.2 KB
/
build.yml
File metadata and controls
116 lines (114 loc) · 3.2 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Build the Python Wheel
on:
push:
branches: [ main ]
tags: [ 'v*' ]
pull_request:
branches: [ main ]
jobs:
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: astral-sh/ruff-action@v3
- run: ruff check
- run: ruff format --check --diff
build-binaries:
needs: [ lint ]
strategy:
matrix:
include:
- name: x86_64-linux
image: ubuntu-22.04
cmake-args: -D ARCHITECTURE=x86_64
- name: x86_64-windows
image: windows-2022
cmake-args: -A x64 -D ARCHITECTURE=x86_64
- name: x86_64-darwin
image: macos-13
cmake-args: -D CMAKE_OSX_ARCHITECTURES=x86_64 -D ARCHITECTURE=x86_64
- name: aarch64-darwin
image: macos-13
cmake-args: -D CMAKE_OSX_ARCHITECTURES=arm64 -D ARCHITECTURE=aarch64
runs-on: ${{ matrix.image }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Build NDTable
run: |
cmake -S C -B C/${{ matrix.name }} ${{ matrix.cmake-args }}
cmake --build C/${{ matrix.name }} --target install
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}
path: src/sdf/ndtable/${{ matrix.name }}
if-no-files-found: error
build-wheel:
runs-on: ubuntu-22.04
needs: [build-binaries]
steps:
- uses: astral-sh/setup-uv@v4
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: x86_64-linux
path: src/sdf/ndtable/x86_64-linux
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v4
with:
name: x86_64-windows
path: src/sdf/ndtable/x86_64-windows
- uses: actions/download-artifact@v4
with:
name: x86_64-darwin
path: src/sdf/ndtable/x86_64-darwin
- uses: actions/download-artifact@v4
with:
name: aarch64-darwin
path: src/sdf/ndtable/aarch64-darwin
- run: uv build --wheel
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist
if-no-files-found: error
run-tests:
needs: [ build-wheel ]
strategy:
matrix:
include:
- name: x86_64-linux
image: ubuntu-22.04
- name: x86_64-windows
image: windows-2022
- name: x86_64-darwin
image: macos-13
- name: aarch64-darwin
image: macos-13
runs-on: ${{ matrix.image }}
steps:
- uses: actions/checkout@v4
- run: rm pyproject.toml
- uses: astral-sh/setup-uv@v4
- uses: actions/download-artifact@v4
with:
name: dist
- if: matrix.name == 'x86_64-windows'
run: |
uv venv --python 3.10
.venv\Scripts\activate
uv pip install pytest
$files = Get-ChildItem "sdf-*-py3-none-any.whl"
foreach ($f in $files) {
uv pip install $f.FullName
}
uv run pytest
- if: matrix.name != 'x86_64-windows'
run: |
uv venv --python 3.10
source .venv/bin/activate
uv pip install pytest
uv pip install sdf-*-py3-none-any.whl
uv run pytest