-
Notifications
You must be signed in to change notification settings - Fork 2
163 lines (143 loc) · 5.03 KB
/
CI.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
156
157
158
159
160
161
162
163
name: CI
on: [push, pull_request]
jobs:
windows:
# Skip building pull requests from the same repository
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }}
runs-on: windows-latest
env:
# Disable output buffering in an attempt to get readable errors
PYTHONUNBUFFERED: '1'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'true'
- name: Python environment
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-pc-windows-msvc
- name: Build
shell: bash
run: |
pip install -r requirements.txt
python setup.py sdist
python setup.py bdist_wheel --py-limited-api=cp37
pip install --force-reinstall dist/*.whl
python -c "import icicle"
- name: Test
run: |
pip install -r tests/requirements.txt
python tests/example.py
python tests/invalid.py
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
macos:
# Skip building pull requests from the same repository
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }}
runs-on: macos-latest
env:
# Disable output buffering in an attempt to get readable errors
PYTHONUNBUFFERED: '1'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'true'
- name: Python environment
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin, x86_64-apple-darwin
- name: Build
shell: bash
env:
DEVELOPER_DIR: /Applications/Xcode.app/Contents/Developer
MACOSX_DEPLOYMENT_TARGET: '10.9'
ARCHFLAGS: -arch x86_64 -arch arm64
PYO3_CROSS_LIB_DIR: /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib
run: |
pip install -r requirements.txt
python setup.py bdist_wheel --py-limited-api=cp37
pip install --force-reinstall dist/*_universal2.whl
python -c "import icicle"
- name: Test
run: |
pip install -r tests/requirements.txt
python tests/example.py
python tests/invalid.py
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
linux:
# Skip building pull requests from the same repository
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }}
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux2014_x86_64
env:
# Disable output buffering in an attempt to get readable errors
PYTHONUNBUFFERED: '1'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'true'
- name: Build
shell: bash
run: |
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y && yum install -y openssl-devel
export PATH="$PATH:$HOME/.cargo/bin"
export PATH="/opt/python/cp38-cp38/bin:$PATH"
pip install -r requirements.txt
python setup.py bdist_wheel --py-limited-api=cp37 --plat-name manylinux2014_x86_64
auditwheel show dist/*.whl
pip install --force-reinstall dist/*.whl
python -c "import icicle"
- name: Test
run: |
export PATH="/opt/python/cp38-cp38/bin:$PATH"
pip install -r tests/requirements.txt
python tests/example.py
python tests/invalid.py
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
release:
if: ${{ startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
needs: [windows, macos, linux]
permissions:
contents: write
discussions: write
steps:
- name: Download wheels
uses: actions/download-artifact@v3
with:
name: wheels
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e # v1.8.10
with:
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: dist/
- name: Release
uses: softprops/action-gh-release@c9b46fe7aad9f02afd89b12450b780f52dacfb2d # master 2023-03-26
with:
generate_release_notes: true
files: dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}