-
Notifications
You must be signed in to change notification settings - Fork 81
123 lines (107 loc) · 3.06 KB
/
wheels.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
name: Test, build, release
on:
pull_request:
branches:
- master
push:
branches:
- master
- 'releases/**'
release:
types: [published]
jobs:
format_test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest black "black[jupyter]"
pip install build
- name: Check
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 --version
flake8 . --count --show-source --statistics
black --version
black -l 80 . --check
python -m compileall -f arc/*.py
function_test:
name: Basic test suite
runs-on: ubuntu-latest
needs: [format_test]
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Setup ARC
run: |
pip install .
pip install pytest coverage
pytest --version
- name: Run tests
run:
coverage run -m pytest -s -v
- name: Coverage report
run:
coverage report -m
build_wheels:
name: Build wheels on ${{ matrix.os }}
needs: [function_test]
if: github.event_name == 'release' && github.event.action == 'published'
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
steps:
- uses: actions/checkout@v4
# Used to host cibuildwheel
- uses: actions/setup-python@v5
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.18.0
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
needs: [function_test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz
upload_pypi:
name: Publish package to PyPI
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment: deploy
permissions:
id-token: write
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- name: Get artifacts
uses: actions/download-artifact@v4
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true
- name: Upload
uses: pypa/gh-action-pypi-publish@release/v1