Repository navigation
183 lines (170 loc) · 5.63 KB
/
Copy pathmain.yml
File metadata and controls
183 lines (170 loc) · 5.63 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
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
name: CI
on:
push:
branches: [main]
tags-ignore: [dev]
pull_request:
branches: [main]
schedule:
- cron: '0 0 * * *' # run at 00:00 UTC
# Cancel any in-flight jobs for the same PR/branch so there's only one active
# at a time
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3', '3.9', 'pypy3.11']
exclude:
# Looks like pypy on Windows is 32-bit, so don't test it since we
# only work with 64-bit builds
- os: windows-latest
python-version: pypy3
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup
with:
python-version: ${{ matrix.python-version }}
- run: uv run --all-extras pytest
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
# Fetch history & tags so setuptools-git-versioning can generate a
# unique .devN suffix on untagged builds uploaded to test.pypi.org.
# See `tool.setuptools-git-versioning` in `pyproject.toml`.
fetch-depth: 0
- uses: ./.github/actions/setup
- name: Build sdist (source distribution)
run: |
git clean -fdx wasmtime build
uv build --sdist
- run: |
git clean -fdx wasmtime build
uv build --wheel -C=--build-option=--plat-name -C=--build-option=manylinux1-x86_64
- run: |
git clean -fdx wasmtime build
uv build --wheel -C=--build-option=--plat-name -C=--build-option=manylinux2014_aarch64
- run: |
git clean -fdx wasmtime build
uv build --wheel -C=--build-option=--plat-name -C=--build-option=macosx-10-13-x86_64
- run: |
git clean -fdx wasmtime build
uv build --wheel -C=--build-option=--plat-name -C=--build-option=macosx-11-0-arm64
- run: |
git clean -fdx wasmtime build
uv build --wheel -C=--build-option=--plat-name -C=--build-option=win-amd64
- run: |
git clean -fdx wasmtime build
uv build --wheel -C=--build-option=--plat-name -C=--build-option=win-arm64
- run: |
git clean -fdx wasmtime build
uv build --wheel -C=--build-option=--plat-name -C=--build-option=musllinux_1_2_x86_64
- run: |
git clean -fdx wasmtime build
uv build --wheel -C=--build-option=--plat-name -C=--build-option=musllinux_1_2_aarch64
- run: |
git clean -fdx wasmtime build
uv build --wheel -C=--build-option=--plat-name -C=--build-option=android_26_x86_64
- run: |
git clean -fdx wasmtime build
uv build --wheel -C=--build-option=--plat-name -C=--build-option=android_26_arm64_v8a
# Build an "any" wheel with:
#
# * MinGW
#
# because at this time I don't know what the `--plat-name` tags supported on
# PyPI are for these platforms. Our hope is that any platform not matching
# the above `--plat-name` arguments will install this `any` wheel instead,
# and then when the wheel runs it'll dynamically select from the available
# shared libraries.
- run: |
git clean -fdx wasmtime build
uv build --wheel -C=--wasmtime-py-mingw-any=
- uses: actions/upload-artifact@v7
with:
name: dists
path: dist
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup
- run: uv run --with pdoc3 pdoc --html wasmtime
- uses: actions/upload-artifact@v7
with:
name: generated-docs
path: html/wasmtime
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup
- run: uv run --all-extras coverage run -m pytest
- run: uv run --all-extras coverage html
- uses: actions/upload-artifact@v7
with:
name: coverage
path: htmlcov
upload_docs:
needs: [coverage, docs]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/download-artifact@v8
with:
name: coverage
path: generated-docs/coverage
- uses: actions/download-artifact@v8
with:
name: generated-docs
path: generated-docs
- run: find .
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/configure-pages@v6
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v5
with:
path: generated-docs
upload_dists:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v8
with:
name: dists
path: dist
- run: find .
- name: Publish distribution 📦 to Test PyPI
if: github.event_name == 'push'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.test_pypi_password }}
repository-url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}
deploy:
name: Deploy gh-pages
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: upload_docs
permissions:
pages: write
id-token: write
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v5