-
Notifications
You must be signed in to change notification settings - Fork 47
179 lines (160 loc) · 5.03 KB
/
build_and_upolad.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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
name: Build
on:
workflow_dispatch:
pull_request:
release:
types:
- released
push:
env:
Python_Version: 3.9
jobs:
build_sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: ${{env.Python_Version}}
- name: Build sdist
run: |
pip install -r requirements.txt
python setup.py sdist
- uses: actions/upload-artifact@v4
with:
name: artifact
path: dist/*.tar.gz
retention-days: 1
codecov:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: ${{env.Python_Version}}
- name: Install PyQUBO
run: |
python -m pip install .
- name: Generate Codecov Report
run: |
pip install -r requirements.txt
python -m coverage run -m unittest discover .
- name: Upload Codecov Report
run: |
codecov
doctest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: ${{env.Python_Version}}
- name: Install PyQUBO
run: |
python -m pip install .
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install -r requirements_doctest.txt
sphinx-build -W -b html docs docs/_build/html
- name: Run Doctest
run: |
make doctest
build_wheels:
name: Build wheels on ${{ matrix.os }} ${{matrix.arch}}
runs-on: ${{ matrix.os }}
env:
CIBW_DEPENDENCY_VERSIONS: pinned
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
arch: [x86_64, AMD64, arm64]
python: [38, 39, 310, 311, 312, 313]
exclude:
- os: ubuntu-latest
arch: AMD64
- os: ubuntu-latest
arch: arm64
- os: macos-latest
arch: AMD64
- os: windows-latest
arch: x86_64
- os: windows-latest
arch: arm64
include:
- os: ubuntu-latest
CIBW_PLATFORM: linux
CIBW_BUILD: "cp3*-manylinux*"
CIBW_BEFORE_ALL: ""
CIBW_BEFORE_BUILD: ""
CIBW_REPAIR_WHEEL_COMMAND: "auditwheel repair -w {dest_dir} {wheel}"
- os: macos-latest
CIBW_PLATFORM: macos
CIBW_BUILD: "cp3*-macosx*"
CIBW_BEFORE_ALL: ""
CIBW_BEFORE_BUILD: ""
- os: windows-latest
CIBW_PLATFORM: windows
CIBW_BUILD: "cp3*-win_amd64*"
CIBW_BEFORE_ALL: ""
CIBW_BEFORE_BUILD: "pip install delvewheel"
CIBW_REPAIR_WHEEL_COMMAND: "delvewheel repair -w {dest_dir} {wheel}"
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: ${{env.Python_Version}}
- name: Build wheels on ${{ matrix.CIBW_PLATFORM }} ${{matrix.arch}}
uses: pypa/cibuildwheel@v2.21.3
env:
CIBW_PLATFORM: ${{ matrix.CIBW_PLATFORM }}
CIBW_BUILD: cp${{matrix.python}}-*
CIBW_ENVIRONMENT:
CFLAGS="-flto -Ofast -pipe"
CXXFLAGS="-flto -Ofast -pipe"
CIBW_ARCHS: ${{matrix.arch}}
CIBW_SKIP: "*-musllinux_*"
CIBW_BEFORE_TEST: "pip install -r requirements.txt"
CIBW_TEST_COMMAND: "python -m coverage run -m unittest discover {package}"
CIBW_DEPENDENCY_VERSIONS: ${{ env.CIBW_DEPENDENCY_VERSIONS }}
CIBW_BEFORE_BUILD: ${{matrix.CIBW_BEFORE_BUILD}}
CIBW_BEFORE_ALL: ${{matrix.CIBW_BEFORE_ALL}}
CIBW_REPAIR_WHEEL_COMMAND: ${{matrix.CIBW_REPAIR_WHEEL_COMMAND}}
CIBW_BUILD_VERBOSITY: 3
- uses: actions/upload-artifact@v3
with:
name: artifact-${{ github.sha }}
path: ./wheelhouse/*.whl
retention-days: 1
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
if: github.event_name == 'release'
steps:
- uses: actions/download-artifact@v3
with:
name: artifact-${{ github.sha }}
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_PASSWORD }}
upload_test_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/download-artifact@v3
with:
name: artifact-${{ github.sha }}
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TEST_PASSWORD }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
verbose: true