Skip to content

Commit 5e8f230

Browse files
committed
add ci
1 parent 1ff0364 commit 5e8f230

File tree

3 files changed

+61
-5
lines changed

3 files changed

+61
-5
lines changed

.github/workflows/build.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
branches:
8+
- master
9+
pull_request:
10+
branches:
11+
- master
12+
13+
concurrency:
14+
group: build-${{ github.head_ref }}
15+
16+
jobs:
17+
build:
18+
name: Build wheels and source distribution
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@v3
23+
24+
- name: Install build dependencies
25+
run: python -m pip install --upgrade build
26+
27+
- name: Build
28+
run: python -m build
29+
30+
- uses: actions/upload-artifact@v3
31+
with:
32+
name: artifacts
33+
path: dist/*
34+
if-no-files-found: error
35+
36+
publish:
37+
name: Publish release
38+
needs:
39+
- build
40+
runs-on: ubuntu-latest
41+
42+
steps:
43+
- uses: actions/download-artifact@v3
44+
with:
45+
name: artifacts
46+
path: dist
47+
48+
- name: Push build artifacts to PyPI
49+
uses: pypa/gh-action-pypi-publish@v1.5.1
50+
with:
51+
skip_existing: true
52+
user: __token__
53+
password: ${{ secrets.PYPI_API_TOKEN }}

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ test.py
1010
.vscode/
1111
vgcore.*
1212
.venv/
13-
_pointers.cpython*
13+
_pointers.cpython*
14+
*.egg-info/
15+
wheelhouse/

tests/test_binding.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
)
55
from pointers._cstd import DivT
66

7-
# pytest breaks c pointers for whatever reason
87

98
def test_bindings():
109
assert type(localeconv()) is StructPointer
@@ -16,14 +15,16 @@ def test_bindings():
1615
assert r == 4
1716
assert type(r) is int
1817

18+
1919
def test_to_c_ptr():
20-
a = to_c_ptr('test')
20+
a = to_c_ptr("test")
2121
assert a.type is str
22-
assert ~a == 'test'
22+
assert ~a == "test"
23+
2324

2425
def test_strings():
2526
mem = c_malloc(2)
2627
sprintf(mem, "%s", "a") # testing format strings
2728
ptr = cast(mem, bytes)
2829
assert ~ptr == b"a"
29-
c_free(mem)
30+
c_free(mem)

0 commit comments

Comments
 (0)