-
-
Notifications
You must be signed in to change notification settings - Fork 51
145 lines (116 loc) · 3.05 KB
/
verify_shared_build.yml
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: shared_build
on:
push:
tags:
- v*
branches:
- master
pull_request:
branches:
- master
concurrency:
group: build_shared-${{ github.head_ref }}
cancel-in-progress: true
env:
PYTHON_VERSION: '3.12'
COINCURVE_IGNORE_SYSTEM_LIB: '1'
# Only 'SHARED' is recognized, any other string means 'not SHARED'
COINCURVE_SECP256K1_BUILD: 'SHARED'
CIBW_ENVIRONMENT_PASS_LINUX: >
COINCURVE_IGNORE_SYSTEM_LIB
COINCURVE_SECP256K1_BUILD
CIBW_BEFORE_ALL_MACOS: ./.github/scripts/install-macos-build-deps.sh
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: >
python -c
"from coincurve import PrivateKey;
a=PrivateKey();
b=PrivateKey();
assert a.ecdh(b.public_key.format())==b.ecdh(a.public_key.format())
" &&
python -m pytest {project}
CIBW_TEST_SKIP: "*-macosx_arm64"
CIBW_SKIP: >
pp*
jobs:
test:
name: Test latest Python
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install system dependencies
if: runner.os == 'macOS'
run: ./.github/scripts/install-macos-build-deps.sh
- name: Install Hatch
uses: pypa/hatch@install
- name: Run static analysis
run: hatch fmt --check
- name: Check types
run: hatch run types:check
- name: Run tests
run: hatch test
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Benchmark
run: uv run --python-preference system scripts/bench.py
linux-wheels-standard:
name: Build Linux wheels
needs:
- test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/[email protected]
macos-wheels-x86_64:
name: Build macOS wheels
needs:
- test
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS_MACOS: x86_64
macos-wheels-arm:
name: Build macOS wheels for ARM (Native)
needs:
- test
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/[email protected]
windows-wheels-x86_64:
name: Build Windows wheels AMD64
needs:
- test
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS_WINDOWS: 'AMD64'
CIBW_BEFORE_ALL: choco install -y --no-progress --no-color cmake>=3.28
windows-wheels-arm:
name: Build Windows wheels for ARM64
needs:
- test
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/[email protected]
env:
COINCURVE_CROSS_HOST: 'arm64'
CIBW_ARCHS_WINDOWS: 'ARM64'
CIBW_BEFORE_ALL: choco install -y --no-progress --no-color cmake>=3.28