forked from bytecodealliance/wasmtime-py
-
Notifications
You must be signed in to change notification settings - Fork 0
155 lines (145 loc) · 4.36 KB
/
main.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
146
147
148
149
150
151
152
153
154
155
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.6, 3.7, 3.8, pypy3]
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@v2
- uses: actions/setup-python@v1
with:
python-version: 3.8
- run: python download-wasmtime.py
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- run: pip install pytest
- run: pytest
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
plat: manylinux1-x86_64
- os: macos-latest
plat: macosx-10-13-x86_64
- os: windows-latest
plat: win-amd64
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v1
with:
python-version: '3.x'
- run: pip install setuptools wheel
# If this is a tagged build use real version numbers
- run: echo "::set-env name=PROD::true"
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
- run: python download-wasmtime.py
- run: python setup.py bdist_wheel --plat-name ${{ matrix.plat }}
- uses: actions/upload-artifact@v1
with:
name: wheel-${{ matrix.os }}
path: dist
flake8:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: '3.x'
- run: pip install flake8
- run: flake8
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: '3.x'
- run: pip install pdoc3
- run: python download-wasmtime.py
- run: pdoc --html wasmtime
- uses: actions/upload-artifact@v1
with:
name: generated-docs
path: html/wasmtime
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: '3.x'
- run: python download-wasmtime.py
- run: pip install coverage pytest
- run: coverage run -m pytest
- run: coverage html
- uses: actions/upload-artifact@v1
with:
name: coverage
path: htmlcov
upload_docs:
needs: [coverage, docs]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v1
with:
name: coverage
- uses: actions/download-artifact@v1
with:
name: generated-docs
- run: find .
- run: mv coverage generated-docs
- name: Push to gh-pages
run: curl -LsSf https://git.io/fhJ8n | rustc - && (cd generated-docs && ../rust_out)
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
env:
GITHUB_DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
BUILD_REPOSITORY_ID: ${{ github.repository }}
BUILD_SOURCEVERSION: ${{ github.sha }}
upload_wheels:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: '3.x'
- uses: actions/download-artifact@v1
with:
name: wheel-ubuntu-latest
- uses: actions/download-artifact@v1
with:
name: wheel-macos-latest
- uses: actions/download-artifact@v1
with:
name: wheel-windows-latest
- run: find .
- run: mkdir dist && mv wheel-*-latest/* dist
- name: Publish distribution 📦 to Test PyPI
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: pypa/gh-action-pypi-publish@master
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@master
with:
user: __token__
password: ${{ secrets.test_pypi_password }}
repository_url: https://test.pypi.org/legacy/