Skip to content

Commit ccc1bc6

Browse files
committed
Clean up github actions workflows
1 parent 90f5bf6 commit ccc1bc6

File tree

5 files changed

+149
-55
lines changed

5 files changed

+149
-55
lines changed

.coveragerc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,3 @@ exclude_lines =
44
raise NotImplementedError()
55
partial_branches =
66
pragma: no branch
7-
if py3k:
8-
if not py3k:

.github/workflows/build.yml

Lines changed: 49 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,25 @@ on: [push, pull_request]
33

44
jobs:
55
build-wheels:
6-
name: Build wheels on ${{ matrix.os }}
7-
runs-on: ${{ matrix.os }}
6+
name: Build wheels for ${{ matrix.os }}
7+
runs-on: ${{ matrix.runs-on }}
88
strategy:
99
matrix:
10-
os:
11-
- ubuntu-latest
12-
- ubuntu-24.04-arm
13-
- windows-latest
14-
- macos-13 # intel
15-
- macos-latest # arm64
10+
- os: linux-intel
11+
runs-on: ubuntu-latest
12+
- os: linux-arm
13+
runs-on: ubuntu-24.04-arm
14+
- os: windows-intel
15+
runs-on: windows-latest
16+
- os: macos-intel
17+
runs-on: macos-13
18+
- os: macos-arm
19+
runs-on: macos-latest
1620

1721
steps:
1822
- uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
1925

2026
- name: Build wheels
2127
uses: pypa/[email protected]
@@ -25,12 +31,38 @@ jobs:
2531
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
2632
path: ./wheelhouse/*.whl
2733

28-
# - name: Publish package to PyPI
29-
# # Only actually publish if a new tag was pushed
30-
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
31-
# # We can't use the pypa action because of https://github.com/pypa/gh-action-pypi-publish/issues/15
32-
# run: |
33-
# pip install twine
34-
# TWINE_USERNAME="__token__" \
35-
# TWINE_PASSWORD="${{ secrets.pypi_password }}" \
36-
# twine upload dist/*
34+
- name: Coveralls
35+
uses: coverallsapp/github-action@v2
36+
37+
build-sdist:
38+
name: Build source distribution
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v4
42+
with:
43+
fetch-depth: 0
44+
45+
- name: Build sdist
46+
run: pipx run build --sdist
47+
48+
- uses: actions/upload-artifact@v4
49+
with:
50+
name: cibw-sdist
51+
path: dist/*.tar.gz
52+
53+
upload-pypi:
54+
needs: [build-wheels, build-sdist]
55+
runs-on: ubuntu-latest
56+
environment: pypi
57+
permissions:
58+
id-token: write
59+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
60+
steps:
61+
- uses: actions/download-artifact@v4
62+
with:
63+
pattern: cibw-*
64+
path: dist
65+
merge-multiple: true
66+
67+
- uses: pypa/gh-action-pypi-publish@release/v1
68+
with:

.github/workflows/run-tests.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

pyproject.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Changelog = "https://github.com/earwig/mwparserfromhell/blob/main/CHANGELOG"
3737
dev = [
3838
"psutil",
3939
"pytest",
40+
"pytest-cov",
4041
]
4142

4243
[build-system]
@@ -73,7 +74,10 @@ optional = true
7374
[tool.setuptools_scm]
7475

7576
[tool.cibuildwheel]
76-
build = ["cp3{9,10,11,12,13}-*"]
77+
test-command = [
78+
"python -c 'import mwparserfromhell.parser._tokenizer'",
79+
"pytest {project}/tests -rxs --cov=mwparserfromhell",
80+
]
7781

7882
[tool.pyright]
7983
pythonVersion = "3.9"

0 commit comments

Comments
 (0)