-
Notifications
You must be signed in to change notification settings - Fork 4
150 lines (142 loc) · 4.4 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
name: GH Actions
on:
release:
types: [published]
push:
pull_request:
jobs:
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
run: pipx run build --sdist
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: cibw-sdist
path: dist/*.tar.gz
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
- os: windows-latest
- os: macos-13 # Intel
CIBW_ENVIRONMENT: >
MACOSX_DEPLOYMENT_TARGET='10.15'
- os: macos-14 # Apple Silicon
CIBW_ENVIRONMENT: >
MACOSX_DEPLOYMENT_TARGET='11.7'
env:
CIBW_ENVIRONMENT_MACOS: >
MACOSX_DEPLOYMENT_TARGET='11.7'
CIBW_SKIP: "*-win32 *i686"
steps:
- uses: ilammy/msvc-dev-cmd@v1
if: runner.os == 'Windows'
with:
arch: amd64
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/cibuildwheel@v2.16.5
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
test_wheels:
needs: [build_wheels]
strategy:
matrix:
os: [macos-11, windows-latest, ubuntu-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
runs-on: ${{ matrix.os }}
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- uses: actions/download-artifact@v4
with:
pattern: cibw-wheels-*
path: dist
merge-multiple: true
- name: install wheel (Unix)
if: runner.os != 'Windows'
run: |
pip install --find-links $GITHUB_WORKSPACE/dist pycdfpp
- name: install wheel (Windows)
if: runner.os == 'Windows'
run: |
pip install --find-links $env:GITHUB_WORKSPACE\dist pycdfpp
- uses: actions/checkout@v3
- name: run tests
run: |
pip install ddt requests
python -vvv tests/full_corpus/test_full_corpus.py
test_wheels_macos_14:
needs: [build_wheels]
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
runs-on: macos-14
steps:
- name: add pyenv to path
run: |
echo " ~/.pyenv/shims" >> $GITHUB_PATH
- name: install dependencies
run: |
brew install pyenv
pyenv install ${{ matrix.python-version }}
- uses: actions/download-artifact@v4
with:
pattern: cibw-wheels-*
path: dist
merge-multiple: true
- name: install wheel
run: |
pyenv local ${{ matrix.python-version }}
python3 -m pip install --find-links $GITHUB_WORKSPACE/dist pycdfpp
- uses: actions/checkout@v3
- name: run tests
run: |
pyenv local ${{ matrix.python-version }}
python3 -m pip install ddt requests
python3 tests/full_corpus/test_full_corpus.py
upload_pypi:
needs: [build_sdist, build_wheels, test_wheels, test_wheels_macos_14]
runs-on: ubuntu-latest
# upload to PyPI only on github releases
if: github.event_name == 'release' && github.event.action == 'published' && github.repository_owner == 'SciQLop'
steps:
- uses: actions/download-artifact@v4
with:
pattern: cibw-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
skip-existing: true
upload_test_pypi:
needs: [build_sdist, build_wheels, test_wheels, test_wheels_macos_14]
runs-on: ubuntu-latest
# upload to test PyPI on github pushes
if: github.event_name == 'push' && github.repository_owner == 'SciQLop'
steps:
- uses: actions/download-artifact@v4
with:
pattern: cibw-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TEST_PASSWORD }}
repository-url: https://test.pypi.org/legacy/
skip-existing: true