-
Notifications
You must be signed in to change notification settings - Fork 0
119 lines (98 loc) · 2.9 KB
/
Copy pathtests.yaml
File metadata and controls
119 lines (98 loc) · 2.9 KB
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
name: release_pipeline
on:
push:
branches: [main]
paths: ["**/*.py", "**/*.c", "**/*.h", "**/*.toml", "**/languages.json", "MANIFEST.in"]
tags: ["v*"]
pull_request:
branches: [main]
paths: ["**/*.py", "**/*.c", "**/*.h", "**/*.toml", "**/languages.json", "MANIFEST.in"]
types: ["opened", "reopened", "synchronize"]
jobs:
style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: psf/black@stable
with:
options: "--check --verbose"
src: "./locstat"
version: "26.1.0"
flake:
runs-on: ubuntu-latest
name: (Autoflake) Remove unused imports
needs: style
steps:
- uses: actions/checkout@v5
- uses: creyD/autoflake_action@v1.1
with:
checkpath: ./locstat
options: --check --remove-all-unused-imports --ignore-init-module-imports -r -v
no-commit: true
test:
runs-on: ubuntu-latest
needs: flake
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v5
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Build Python
run: |
python3 -m pip install --upgrade pip
pip install build pytest
pip install -e . --force-reinstall
- run: pytest -s
build-wheels:
if: startsWith(github.ref, 'refs/tags/v')
name: Build wheels for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: test
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-22.04-arm, windows-latest, windows-11-arm, macos-14]
steps:
- uses: actions/checkout@v5
- name: Run cibuildwheels
uses: pypa/cibuildwheel@v3.3.1
with:
output-dir: ${{ runner.temp }}/wheelhouse
- name: Persist files for publish jobs
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: ${{ runner.temp }}/wheelhouse
build-sdist:
if: startsWith(github.ref, 'refs/tags/v')
name: Build source distribution
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- name: Build sdist
run: pipx run build --sdist -o ${{ runner.temp }}/wheelhouse
- uses: actions/upload-artifact@v4
with:
name: sdist
path: ${{ runner.temp }}/wheelhouse
publish:
name: Publish release to Pypi
runs-on: ubuntu-latest
needs: [build-wheels, build-sdist]
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Upload to Pypi
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true