-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (92 loc) · 2.93 KB
/
Copy pathpython.yml
File metadata and controls
97 lines (92 loc) · 2.93 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
name: Python
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
tests:
name: Run tests on Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: python -m pip install --upgrade pip # dependency groups require pip >= 25.1
- name: Build and install
run: pip install --verbose . --group tests
- name: Run tests with pytest
run: pytest
build-wheels:
name: Build wheels on ${{ matrix.config.os }} (${{ matrix.config.platform }})
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- os: ubuntu-24.04 # using manylinux/musllinux images
platform: linux
- os: ubuntu-24.04-arm # using manylinux/musllinux images
platform: linux
- os: ubuntu-24.04
platform: pyodide
- os: windows-latest
platform: windows
- os: macos-15
platform: macos
steps:
- uses: actions/checkout@v7
- name: Build wheels
env:
# <memory_resource> requires 14.0: https://developer.apple.com/xcode/cpp/
# https://cibuildwheel.pypa.io/en/stable/cpp_standards/#macos-and-deployment-target-versions
MACOSX_DEPLOYMENT_TARGET: "14.0"
CIBW_ARCHS_MACOS: "x86_64 arm64" # https://cibuildwheel.pypa.io/en/stable/faq/#cross-compiling
CIBW_PLATFORM: ${{ matrix.config.platform }}
uses: pypa/cibuildwheel@v4.1.1
- uses: actions/upload-artifact@v7
with:
name: cibw-wheels-${{ matrix.config.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build-sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v7
with:
name: cibw-sdist
path: ./dist/*.tar.gz
publish-to-testpypi:
name: Publish Python distributions to TestPyPI
needs:
- build-wheels
- build-sdist
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/openae
permissions:
id-token: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v8
with:
path: dist/
pattern: cibw-*
merge-multiple: true
- name: Remove unsupported Pyodide wheels
run: rm -fv dist/*pyodide* || echo "No Pyodide wheels found to remove."
- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true