Skip to content

Commit 03bc562

Browse files
feat: added test ci workflow for nim branch
1 parent 4cf0bfc commit 03bc562

2 files changed

Lines changed: 41 additions & 32 deletions

File tree

.github/workflows/ci.yml

Lines changed: 19 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,6 @@ jobs:
4949
run: |
5050
pip install -e ".[dev,test]"
5151
52-
- name: Run linter
53-
run: |
54-
ruff check .
55-
56-
- name: Run formatter check
57-
run: |
58-
ruff format --check .
59-
6052
- name: Build extension
6153
run: |
6254
nuwa develop
@@ -72,7 +64,6 @@ jobs:
7264
name: test-results-${{ matrix.os }}-py${{ matrix.python }}
7365
path: |
7466
.pytest_cache/
75-
htmlcov/
7667
7768
test-integration:
7869
name: Integration tests (Nuwa SDK wrappers)
@@ -114,38 +105,35 @@ jobs:
114105
run: |
115106
pytest tests/test_integration_nuwa_sdk.py -v --tb=short
116107
117-
build-wheel:
118-
name: Build wheel on ${{ matrix.os }}
108+
build-wheels:
109+
name: Wheels on ${{ matrix.os }}
119110
runs-on: ${{ matrix.os }}
120111
strategy:
121112
fail-fast: false
122113
matrix:
123-
os: [ubuntu-latest, macos-latest, windows-latest]
114+
os: [ubuntu-latest, windows-latest, macos-latest]
115+
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
116+
exclude:
117+
# Windows with Python 3.13 sometimes has issues
118+
- os: windows-latest
119+
python: '3.13'
120+
121+
env:
122+
PYTHONUTF8: 1
123+
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-*"
124+
CIBW_SKIP: "pp* *-musllinux_* *i686 *-win32"
124125

125126
steps:
126127
- name: Checkout
127128
uses: actions/checkout@v4
128129

129-
- name: Set up Python
130-
uses: actions/setup-python@v5
131-
with:
132-
python-version: '3.11'
133-
134-
- name: Install Nim
135-
uses: jiro4989/setup-nim-action@v1
130+
- name: Build wheels
131+
uses: martineastwood/nuwa-build-action@v1
136132
with:
137-
nim-version: '2.0.4'
138-
139-
- name: Install nuwa-build
140-
run: |
141-
pip install nuwa-build
142-
143-
- name: Build wheel
144-
run: |
145-
nuwa build
133+
nim-version: "2.0.4"
146134

147-
- name: Upload wheel
135+
- name: Upload wheels
148136
uses: actions/upload-artifact@v4
149137
with:
150-
name: wheel-${{ matrix.os }}
151-
path: dist/*.whl
138+
name: wheels-${{ matrix.os }}-${{ matrix.python }}
139+
path: wheelhouse/*.whl

.github/workflows/publish.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- "v*"
77
workflow_dispatch:
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
build_wheels:
1114
name: Wheels on ${{ matrix.os }}
@@ -25,7 +28,7 @@ jobs:
2528
- name: Build wheels
2629
uses: martineastwood/nuwa-build-action@v1
2730
with:
28-
nim-version: "2.2.0"
31+
nim-version: "2.0.4"
2932

3033
- uses: actions/upload-artifact@v4
3134
with:
@@ -47,3 +50,21 @@ jobs:
4750
with:
4851
name: cibw-sdist
4952
path: dist/*.tar.gz
53+
54+
publish:
55+
name: Publish to PyPI
56+
needs: [build_wheels, build_sdist]
57+
runs-on: ubuntu-latest
58+
permissions:
59+
id-token: write
60+
61+
steps:
62+
- name: Download all artifacts
63+
uses: actions/download-artifact@v4
64+
with:
65+
pattern: cibw-*
66+
path: dist
67+
merge-multiple: true
68+
69+
- name: Publish to PyPI
70+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)