Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ jobs:
submodules: recursive

- name: Build wheels
uses: pypa/cibuildwheel@v2.21.3
uses: pypa/cibuildwheel@f03ac7617d6cff873ccf24cc0d567ef5ba5a9e6d # v4.0.0
env:
CIBW_SKIP: cp36-* *-win32
CIBW_BEFORE_BUILD_WINDOWS: "choco install mingw -y"

- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl
Expand All @@ -47,7 +47,7 @@ jobs:
python -m pip install --upgrade build setuptools
python -m build --sdist .

- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: sdist
path: dist/*.tar.gz
Expand All @@ -67,15 +67,15 @@ jobs:
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: '3.12'
python-version: '3.14'

- name: Install MinGW (Windows)
if: runner.os == 'Windows'
run: |
choco install mingw -y
echo "C:\ProgramData\chocolatey\bin" >> $env:GITHUB_PATH

- uses: actions/download-artifact@v4
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: sdist
path: dist
Expand All @@ -94,7 +94,7 @@ jobs:
permissions:
contents: read
steps:
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
path: artifacts
merge-multiple: true
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,15 @@ jobs:
- name: install dependencies
run: |
sudo apt-get update --fix-missing
sudo apt-get install -y -f -o Acquire::Retries=3 libjson-c-dev pkg-config
- name: Build and test json-c
sudo apt-get install -y -f -o Acquire::Retries=3 libjson-c-dev cmake pkg-config
- name: Build and install yyjson
run: |
git clone --depth 1 https://github.com/ibireme/yyjson.git /tmp/yyjson
cmake -S /tmp/yyjson -B /tmp/yyjson/build -DCMAKE_BUILD_TYPE=Release
cmake --build /tmp/yyjson/build --parallel
sudo cmake --install /tmp/yyjson/build
sudo ldconfig
- name: Build and test json-c/yyjson
run: |
make
make tests-c
Expand Down
18 changes: 15 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
JSON_C_CFLAGS=$(shell pkg-config --cflags json-c)
JSON_C_LDFLAGS=$(shell pkg-config --libs json-c)
YYJSON_CFLAGS=$(shell pkg-config --cflags yyjson)
YYJSON_LDFLAGS=$(shell pkg-config --libs yyjson)

include config.mk

all: test-json-c-get-a test-json-update test-json-filter test-json-subpath test-json-c-array-root test-json-filter-and-missing-key test-json-get-array-big-index
all: test-json-c-get-a test-json-update test-json-filter test-json-subpath test-json-c-array-root test-json-filter-and-missing-key test-json-get-array-big-index test-json-union

YYJSON_TESTS=test-yyjson

bench:
make -C bench
Expand Down Expand Up @@ -36,14 +40,22 @@ test-json-filter-and-missing-key: tests/json-c/filter-and-missing-key.c csonpath
test-json-get-array-big-index: tests/json-c/get-array-big-index.c csonpath_json-c.h csonpath.h csonpath_do.h
$(CC) tests/json-c/get-array-big-index.c $(EXTRA_FILES) $(JSON_C_CFLAGS) $(CFLAGS) -Wno-format -I./ -o test-json-get-array-big-index $(JSON_C_LDFLAGS) $(LDFLAGS)

tests-c: test-json-c-get-a test-json-update test-json-filter test-json-subpath test-json-c-array-root test-json-filter-and-missing-key test-json-get-array-big-index
test-json-union: tests/json-c/union.c csonpath_json-c.h csonpath.h csonpath_do.h
$(CC) tests/json-c/union.c $(EXTRA_FILES) $(JSON_C_CFLAGS) $(CFLAGS) -Wno-format -I./ -o test-json-union $(JSON_C_LDFLAGS) $(LDFLAGS)

test-yyjson: tests/yyjson/test-yyjson.c csonpath_yyjson.h csonpath.h csonpath_do.h
$(CC) tests/yyjson/test-yyjson.c $(EXTRA_FILES) $(YYJSON_CFLAGS) $(CFLAGS) -Wno-format -I./ -o test-yyjson $(YYJSON_LDFLAGS) $(LDFLAGS)

tests-c: test-json-c-get-a test-json-update test-json-filter test-json-subpath test-json-c-array-root test-json-filter-and-missing-key test-json-get-array-big-index test-json-union test-yyjson
./test-json-c-get-a
./test-json-update
./test-json-filter
./test-json-subpath
./test-json-c-array-root
./test-json-filter-and-missing-key
./test-json-get-array-big-index
./test-json-union
./test-yyjson

pip-dev:
pip install -e .[dev] --force-reinstall
Expand All @@ -54,5 +66,5 @@ tests-py: pip-dev
tests: tests-py tests-c

clean:
rm -rvf test-json-c-get-a test-json-update test-json-filter test-json-subpath test-json-c-array-root test-json-filter-and-missing-key test-json-get-array-big-index
rm -rvf test-json-c-get-a test-json-update test-json-filter test-json-subpath test-json-c-array-root test-json-filter-and-missing-key test-json-get-array-big-index test-json-union test-yyjson

Loading
Loading