Repository navigation
117 lines (97 loc) · 2.74 KB
/
Copy pathci.yml
File metadata and controls
117 lines (97 loc) · 2.74 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
117
name: CI
on:
push:
branches: [master, dev, pr]
tags: ["v*"]
pull_request:
permissions:
contents: read
defaults:
run:
shell: bash
env:
BUILD_TYPE: Release
OMP_NUM_THREADS: "2"
jobs:
cpp:
name: C++ / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
steps:
- uses: actions/checkout@v6
- name: Configure on Windows
if: runner.os == 'Windows'
run: >-
cmake -S . -B build
-G "Visual Studio 18 2026" -A x64
-DTINYMESH_BUILD_PYTHON=OFF
-DTINYMESH_BUILD_TESTS=ON
-DTINYMESH_BUILD_EXAMPLES=ON
- name: Configure on Linux and macOS
if: runner.os != 'Windows'
run: >-
cmake -S . -B build
-DCMAKE_BUILD_TYPE="$BUILD_TYPE"
-DTINYMESH_BUILD_PYTHON=OFF
-DTINYMESH_BUILD_TESTS=ON
-DTINYMESH_BUILD_EXAMPLES=ON
- name: Build
run: cmake --build build --config "$BUILD_TYPE" --parallel 2
- name: Test
run: ctest --test-dir build -C "$BUILD_TYPE" --output-on-failure --no-tests=error
python:
name: Python ${{ matrix.python-version }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v6
- name: Install the latest uv and set the python version
uses: astral-sh/setup-uv@v10.3.3
with:
python-version: ${{ matrix.python-version }}
- name: Build distributions
run: uv build
- name: Install wheel for testing
run: |
uv sync --frozen --no-install-project
uv pip install --no-deps dist/*.whl
- name: Test
env:
MPLBACKEND: Agg
run: uv run --no-sync pytest -s tests/python
- name: Upload wheel
uses: actions/upload-artifact@v7
with:
name: wheels-${{ matrix.os }}-py${{ matrix.python-version }}
path: dist/*.whl
if-no-files-found: error
release:
name: Release
needs: [cpp, python]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: dist
merge-multiple: true
- name: Create release
uses: softprops/action-gh-release@v2
with:
files: dist/*.whl
fail_on_unmatched_files: true
draft: false
prerelease: false