-
Notifications
You must be signed in to change notification settings - Fork 3
162 lines (139 loc) · 4.25 KB
/
build-typecheck.yaml
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: Build python
on:
workflow_dispatch
jobs:
build_core:
name: Build tierkreis package
runs-on: ubuntu-latest
defaults:
run:
working-directory: python
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Protoc
uses: arduino/setup-protoc@v3
- name: build main package
run: |
pipx run build[uv] --installer=uv
- run: pipx twine check dist/*
- uses: actions/upload-artifact@v3
with:
name: core_build
path: python/dist
build_wheels:
name: build on ${{ matrix.platform || matrix.os }} (${{ matrix.target }} - ${{ matrix.manylinux || 'auto' }})
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos, windows]
# os: [ubuntu]
target: [x86_64, aarch64]
# target: [x86_64]
manylinux: [auto]
include:
- os: ubuntu
platform: linux
- os: windows
ls: dir
- os: macos
target: aarch64
# - os: windows
# ls: dir
# target: i686
# python-architecture: x86
# - os: ubuntu
# platform: linux
# target: i686
# musllinux
# - os: ubuntu
# platform: linux
# target: x86_64
# manylinux: musllinux_1_1
# - os: ubuntu
# platform: linux
# target: aarch64
# manylinux: musllinux_1_1
exclude:
# Windows on arm64 only supports Python 3.11+
- os: windows
target: aarch64
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v3
- name: build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
manylinux: ${{ matrix.manylinux || 'auto' }}
container: ${{ matrix.container }}
args: --release --out dist --interpreter ${{ matrix.interpreter || '3.10 3.11 3.12' }} -m type_check/Cargo.toml
rust-toolchain: stable
rustup-components: "rustfmt"
- run: ${{ matrix.ls || 'ls -lh' }} dist/
- run: pipx twine check dist/*
- uses: actions/upload-artifact@v4
with:
name: type_wheels
path: dist
test_wheels:
needs: [build_core, build_wheels]
name: test on ${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.python-version }}
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos, windows]
python-version: ['3.10', '3.11', '3.12']
include:
- os: ubuntu
platform: manylinux
arch: x86_64
- os: windows
platform: win
arch: amd64
- os: macos
platform: macos
arch: x86_64
runs-on: ${{ matrix.os }}-latest
defaults:
run:
working-directory: python
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
- name: Download core
uses: actions/download-artifact@v4
with:
name: core_build
path: python/dist/
- name: Install
run: |
pip install $(find dist -type f -iname "tierkreis-*.whl")'[docker,telemetry,commontypes,sc22-example]'
pip install pytest
shell: bash
- name: Test with pytest
run: |
pytest
- name: Download wheels
uses: actions/download-artifact@v4
with:
name: type_wheels
path: python/type_wheels/
- name: Install type_check
run: |
export PYVER=$(echo ${{ matrix.python-version }} | tr -d .)
export PLATFORM=${{ matrix.platform || matrix.os }}
export WHL=$(find type_wheels -type f -iname "tierkreis_typecheck*${PYVER}*-${PLATFORM}*${{ matrix.arch }}.whl")
pip install $WHL
shell: bash
- name: Test with pytest
run: |
pytest