From 884fb976b0aad566b4c9baccb1fd0a81c3f0162b Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Mon, 24 Nov 2025 23:09:05 +0800 Subject: [PATCH 01/12] Remove most of action temporarily. --- .github/workflows/ctest.yml | 29 ----------- .github/workflows/example.yml | 88 --------------------------------- .github/workflows/jest.yml | 91 ----------------------------------- .github/workflows/pytest.yml | 27 +---------- 4 files changed, 1 insertion(+), 234 deletions(-) delete mode 100644 .github/workflows/ctest.yml delete mode 100644 .github/workflows/example.yml delete mode 100644 .github/workflows/jest.yml diff --git a/.github/workflows/ctest.yml b/.github/workflows/ctest.yml deleted file mode 100644 index 4cde873..0000000 --- a/.github/workflows/ctest.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: ctest -permissions: - contents: read - -on: - - pull_request - - push - -jobs: - ctest: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v6 - - - name: dependencies - run: sudo apt-get update && sudo apt-get install -y libgtest-dev - - - name: mkdir - run: mkdir ${{runner.workspace}}/build - - - name: configure - run: cmake -S ${{github.workspace}} -B ${{runner.workspace}}/build - - - name: build - run: cmake --build ${{runner.workspace}}/build --target test_executables - - - name: ctest - run: ctest --test-dir ${{runner.workspace}}/build diff --git a/.github/workflows/example.yml b/.github/workflows/example.yml deleted file mode 100644 index 7a2f45c..0000000 --- a/.github/workflows/example.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: examples -permissions: - contents: read - -on: - - pull_request - - push - -env: - EM_CACHE_FOLDER: 'emsdk-cache' - -jobs: - cxx: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v6 - - - name: dependencies - run: sudo apt-get update && sudo apt-get install -y libgtest-dev - - - name: mkdir - run: mkdir ${{runner.workspace}}/build - - - name: configure - run: cmake -S ${{github.workspace}} -B ${{runner.workspace}}/build - - - name: build - run: cmake --build ${{runner.workspace}}/build --target main - - - name: run - run: ${{runner.workspace}}/build/main - - python: - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - python-version: ['3.10', '3.11', '3.12', '3.13'] - - steps: - - uses: actions/checkout@v6 - - - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.python-version }} - cache: 'pip' - - - name: build - run: pip install . - - - name: run - run: python examples/main.py - - javascript: - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - node-version: ['20', '22', '24'] - - steps: - - uses: actions/checkout@v6 - - - uses: actions/setup-node@v6 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - - uses: actions/cache@v4 - with: - path: ${{ env.EM_CACHE_FOLDER }} - key: example-em-cache-${{ runner.os }}-${{ matrix.node-version }} - - - uses: pyodide/setup-emsdk@v15 - with: - actions-cache-folder: ${{ env.EM_CACHE_FOLDER }} - - - name: dependencies - run: npm ci - - - name: build - run: npm run build - - - name: run - run: node dist/example.mjs diff --git a/.github/workflows/jest.yml b/.github/workflows/jest.yml deleted file mode 100644 index 1dc8d38..0000000 --- a/.github/workflows/jest.yml +++ /dev/null @@ -1,91 +0,0 @@ -name: jest -permissions: - contents: read - -on: - - pull_request - - push - -env: - EM_CACHE_FOLDER: 'emsdk-cache' - NODE_LATEST_VERSION: '24' - -jobs: - jest: - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - node-version: ['20', '22', '24'] - - steps: - - uses: actions/checkout@v6 - - - uses: actions/setup-node@v6 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - - uses: actions/cache@v4 - with: - path: ${{ env.EM_CACHE_FOLDER }} - key: jest-em-cache-${{ runner.os }}-${{ matrix.node-version }} - - - uses: pyodide/setup-emsdk@v15 - with: - actions-cache-folder: ${{ env.EM_CACHE_FOLDER }} - - - name: dependencies - run: npm ci - - - name: jest - run: npm run all - - npm: - runs-on: ubuntu-latest - needs: jest - - if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags')" - - environment: npm - permissions: - id-token: write - - steps: - - uses: actions/checkout@v6 - - - name: recovery tag information - run: git fetch --tags --force - - - uses: actions/setup-node@v6 - with: - node-version: ${{ env.NODE_LATEST_VERSION }} - cache: 'npm' - - - uses: actions/cache@v4 - with: - path: ${{ env.EM_CACHE_FOLDER }} - key: jest-em-cache-${{ runner.os }}-${{ env.NODE_LATEST_VERSION }} - - - uses: pyodide/setup-emsdk@v15 - with: - actions-cache-folder: ${{ env.EM_CACHE_FOLDER }} - - - name: version - run: npm version from-git --no-git-tag-version - - - name: extract tag - run: | - GIT_TAG=${GITHUB_REF#refs/tags/} - TAG=$(echo $GIT_TAG | sed -E 's/^v//' | sed -E 's/[0-9\.-]//g' | sed -E 's/^$/latest/g') - echo TAG=$TAG >> $GITHUB_ENV - - - name: dependencies - run: npm ci - - - name: build - run: npm run build - - - name: publish - run: npm publish --tag $TAG diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index c61f196..c0ef424 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -10,38 +10,13 @@ env: PYTHON_LATEST_VERSION: '3.13' jobs: - pytest: - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - python-version: ['3.10', '3.11', '3.12', '3.13'] - - steps: - - uses: actions/checkout@v6 - - - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.python-version }} - cache: 'pip' - - - name: dependencies - run: pip install '.[dev]' - - - name: pytest - run: pytest --cov=pyds - wheels: runs-on: ${{ matrix.os }} - needs: pytest - - if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags')" strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest] + os: [windows-latest] steps: - uses: actions/checkout@v6 From 4255376869802321f1ccb29c1e46c7d2d168dd60 Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Mon, 24 Nov 2025 23:10:50 +0800 Subject: [PATCH 02/12] Remove setting to use ninja in windows. --- .github/workflows/pytest.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index c0ef424..27b99c4 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -34,8 +34,6 @@ jobs: - name: build wheels run: python -m cibuildwheel - env: - CIBW_ENVIRONMENT_WINDOWS: SKBUILD_CMAKE_ARGS=-GNinja - uses: actions/upload-artifact@v5 with: From 04d869f6243c44b392b9b159b2a35c7d8a05fca1 Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Mon, 24 Nov 2025 23:19:28 +0800 Subject: [PATCH 03/12] Skip win32. --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 118e02d..bab38a9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,3 +47,6 @@ select = ["E4", "E7", "E9", "F"] "tests/*" = ["E741", "E743", "F841"] [tool.ruff.format] + +[tool.cibuildwheel] +skip = "*-win32" \ No newline at end of file From 04308926ad594cf25fe4b5abe150d0662b05cb6b Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Mon, 24 Nov 2025 23:19:44 +0800 Subject: [PATCH 04/12] Use C++20. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ed7bda..2febaa2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) file(GLOB_RECURSE SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cc") add_library(${PROJECT_NAME} STATIC ${SOURCES}) target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) -target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20) set_property(TARGET ${PROJECT_NAME} PROPERTY INTERPROCEDURAL_OPTIMIZATION True) file(GLOB EXECUTABLE_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/examples/*.cc") From 7c884e473891c4e635ec539178a8290c529d1be1 Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Mon, 24 Nov 2025 23:26:57 +0800 Subject: [PATCH 05/12] Rename ds.cc to _ds.cc. --- CMakeLists.txt | 2 +- package.json | 2 +- pyds/{ds.cc => _ds.cc} | 0 tsds/{ds.cc => _ds.cc} | 0 4 files changed, 2 insertions(+), 2 deletions(-) rename pyds/{ds.cc => _ds.cc} (100%) rename tsds/{ds.cc => _ds.cc} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2febaa2..613b205 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ endforeach() find_package(pybind11) if(pybind11_FOUND) - pybind11_add_module(pyds ${CMAKE_CURRENT_SOURCE_DIR}/pyds/ds.cc) + pybind11_add_module(pyds ${CMAKE_CURRENT_SOURCE_DIR}/pyds/_ds.cc) target_link_libraries(pyds PRIVATE ${PROJECT_NAME}) set_property(TARGET pyds PROPERTY INTERPROCEDURAL_OPTIMIZATION True) set_target_properties(pyds PROPERTIES OUTPUT_NAME ds) diff --git a/package.json b/package.json index 9db5c13..0fa6a98 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "dist/tsds.mjs.map" ], "scripts": { - "emcc": "emcc -std=c++17 tsds/ds.cc src/*.cc -Iinclude -lembind -o tsds/ds.mjs --emit-tsd ds.d.mts -gsource-map=inline -O3 -ffast-math -flto -s ALLOW_MEMORY_GROWTH=1", + "emcc": "emcc -std=c++17 tsds/_ds.cc src/*.cc -Iinclude -lembind -o tsds/ds.mjs --emit-tsd ds.d.mts -gsource-map=inline -O3 -ffast-math -flto -s ALLOW_MEMORY_GROWTH=1", "rollup": "rollup --config rollup.config.mjs", "build": "run-s emcc rollup", "test": "cross-env NODE_OPTIONS='$NODE_OPTIONS --experimental-vm-modules' jest --config=jest.config.mjs", diff --git a/pyds/ds.cc b/pyds/_ds.cc similarity index 100% rename from pyds/ds.cc rename to pyds/_ds.cc diff --git a/tsds/ds.cc b/tsds/_ds.cc similarity index 100% rename from tsds/ds.cc rename to tsds/_ds.cc From a549a0fdf508221753a4c239b4ec183cdb28e544 Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Mon, 24 Nov 2025 23:28:56 +0800 Subject: [PATCH 06/12] Add \n at eof of pyproject.toml. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index bab38a9..a6b0c96 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,4 +49,4 @@ select = ["E4", "E7", "E9", "F"] [tool.ruff.format] [tool.cibuildwheel] -skip = "*-win32" \ No newline at end of file +skip = "*-win32" From 1d4206f0acea4b6642e6b15851873066ed03f966 Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Mon, 24 Nov 2025 23:35:01 +0800 Subject: [PATCH 07/12] Revert "Rename ds.cc to _ds.cc." This reverts commit 7c884e473891c4e635ec539178a8290c529d1be1. --- CMakeLists.txt | 2 +- package.json | 2 +- pyds/{_ds.cc => ds.cc} | 0 tsds/{_ds.cc => ds.cc} | 0 4 files changed, 2 insertions(+), 2 deletions(-) rename pyds/{_ds.cc => ds.cc} (100%) rename tsds/{_ds.cc => ds.cc} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 613b205..2febaa2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ endforeach() find_package(pybind11) if(pybind11_FOUND) - pybind11_add_module(pyds ${CMAKE_CURRENT_SOURCE_DIR}/pyds/_ds.cc) + pybind11_add_module(pyds ${CMAKE_CURRENT_SOURCE_DIR}/pyds/ds.cc) target_link_libraries(pyds PRIVATE ${PROJECT_NAME}) set_property(TARGET pyds PROPERTY INTERPROCEDURAL_OPTIMIZATION True) set_target_properties(pyds PROPERTIES OUTPUT_NAME ds) diff --git a/package.json b/package.json index 0fa6a98..9db5c13 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "dist/tsds.mjs.map" ], "scripts": { - "emcc": "emcc -std=c++17 tsds/_ds.cc src/*.cc -Iinclude -lembind -o tsds/ds.mjs --emit-tsd ds.d.mts -gsource-map=inline -O3 -ffast-math -flto -s ALLOW_MEMORY_GROWTH=1", + "emcc": "emcc -std=c++17 tsds/ds.cc src/*.cc -Iinclude -lembind -o tsds/ds.mjs --emit-tsd ds.d.mts -gsource-map=inline -O3 -ffast-math -flto -s ALLOW_MEMORY_GROWTH=1", "rollup": "rollup --config rollup.config.mjs", "build": "run-s emcc rollup", "test": "cross-env NODE_OPTIONS='$NODE_OPTIONS --experimental-vm-modules' jest --config=jest.config.mjs", diff --git a/pyds/_ds.cc b/pyds/ds.cc similarity index 100% rename from pyds/_ds.cc rename to pyds/ds.cc diff --git a/tsds/_ds.cc b/tsds/ds.cc similarity index 100% rename from tsds/_ds.cc rename to tsds/ds.cc From ebf381c1bfd1d63a2e7900eb81de783615c9d6b9 Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Mon, 24 Nov 2025 23:38:51 +0800 Subject: [PATCH 08/12] Rename the output name of python package. --- CMakeLists.txt | 2 +- pyds/ds.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 pyds/ds.py diff --git a/CMakeLists.txt b/CMakeLists.txt index 2febaa2..6a2288d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,7 @@ if(pybind11_FOUND) pybind11_add_module(pyds ${CMAKE_CURRENT_SOURCE_DIR}/pyds/ds.cc) target_link_libraries(pyds PRIVATE ${PROJECT_NAME}) set_property(TARGET pyds PROPERTY INTERPROCEDURAL_OPTIMIZATION True) - set_target_properties(pyds PROPERTIES OUTPUT_NAME ds) + set_target_properties(pyds PROPERTIES OUTPUT_NAME _ds) install(TARGETS pyds DESTINATION pyds) else() message(STATUS "pybind11 not found, Python bindings will not be built.") diff --git a/pyds/ds.py b/pyds/ds.py new file mode 100644 index 0000000..cc83a05 --- /dev/null +++ b/pyds/ds.py @@ -0,0 +1,13 @@ +"""The interface module for the pybind11 extension module _ds.""" + +__all__ = [ + "String", + "Variable", + "Item", + "List", + "Term", + "Rule", + "Search", +] + +from _ds import String, Variable, Item, List, Term, Rule, Search From b4ea19c0b225b31fd088db96f6845f3c76b29b66 Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Mon, 24 Nov 2025 23:46:00 +0800 Subject: [PATCH 09/12] Update the python package name. --- pyds/ds.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyds/ds.cc b/pyds/ds.cc index 84e1b3b..8926f96 100644 --- a/pyds/ds.cc +++ b/pyds/ds.cc @@ -90,7 +90,7 @@ auto rule_match(ds::rule_t* rule_1, ds::rule_t* rule_2, int length) -> std::uniq return std::unique_ptr(result); } -PYBIND11_MODULE(ds, m) { +PYBIND11_MODULE(_ds, m) { auto string_t = py::class_(m, "String"); auto item_t = py::class_(m, "Item"); auto variable_t = py::class_(m, "Variable"); From 8bf98de82e5a80ad4e844db82f4442d6b91eafa3 Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Mon, 24 Nov 2025 23:49:28 +0800 Subject: [PATCH 10/12] fix import package name. --- pyds/ds.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyds/ds.py b/pyds/ds.py index cc83a05..e0bf52d 100644 --- a/pyds/ds.py +++ b/pyds/ds.py @@ -10,4 +10,4 @@ "Search", ] -from _ds import String, Variable, Item, List, Term, Rule, Search +from ._ds import String, Variable, Item, List, Term, Rule, Search From 35e940530cef8be4df8facb873b3f2638d64f910 Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Mon, 24 Nov 2025 23:49:55 +0800 Subject: [PATCH 11/12] Revert "Remove most of action temporarily." This reverts commit 884fb976b0aad566b4c9baccb1fd0a81c3f0162b. --- .github/workflows/ctest.yml | 29 +++++++++++ .github/workflows/example.yml | 88 +++++++++++++++++++++++++++++++++ .github/workflows/jest.yml | 91 +++++++++++++++++++++++++++++++++++ .github/workflows/pytest.yml | 27 ++++++++++- 4 files changed, 234 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ctest.yml create mode 100644 .github/workflows/example.yml create mode 100644 .github/workflows/jest.yml diff --git a/.github/workflows/ctest.yml b/.github/workflows/ctest.yml new file mode 100644 index 0000000..4cde873 --- /dev/null +++ b/.github/workflows/ctest.yml @@ -0,0 +1,29 @@ +name: ctest +permissions: + contents: read + +on: + - pull_request + - push + +jobs: + ctest: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v6 + + - name: dependencies + run: sudo apt-get update && sudo apt-get install -y libgtest-dev + + - name: mkdir + run: mkdir ${{runner.workspace}}/build + + - name: configure + run: cmake -S ${{github.workspace}} -B ${{runner.workspace}}/build + + - name: build + run: cmake --build ${{runner.workspace}}/build --target test_executables + + - name: ctest + run: ctest --test-dir ${{runner.workspace}}/build diff --git a/.github/workflows/example.yml b/.github/workflows/example.yml new file mode 100644 index 0000000..7a2f45c --- /dev/null +++ b/.github/workflows/example.yml @@ -0,0 +1,88 @@ +name: examples +permissions: + contents: read + +on: + - pull_request + - push + +env: + EM_CACHE_FOLDER: 'emsdk-cache' + +jobs: + cxx: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v6 + + - name: dependencies + run: sudo apt-get update && sudo apt-get install -y libgtest-dev + + - name: mkdir + run: mkdir ${{runner.workspace}}/build + + - name: configure + run: cmake -S ${{github.workspace}} -B ${{runner.workspace}}/build + + - name: build + run: cmake --build ${{runner.workspace}}/build --target main + + - name: run + run: ${{runner.workspace}}/build/main + + python: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + python-version: ['3.10', '3.11', '3.12', '3.13'] + + steps: + - uses: actions/checkout@v6 + + - uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + + - name: build + run: pip install . + + - name: run + run: python examples/main.py + + javascript: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + node-version: ['20', '22', '24'] + + steps: + - uses: actions/checkout@v6 + + - uses: actions/setup-node@v6 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + + - uses: actions/cache@v4 + with: + path: ${{ env.EM_CACHE_FOLDER }} + key: example-em-cache-${{ runner.os }}-${{ matrix.node-version }} + + - uses: pyodide/setup-emsdk@v15 + with: + actions-cache-folder: ${{ env.EM_CACHE_FOLDER }} + + - name: dependencies + run: npm ci + + - name: build + run: npm run build + + - name: run + run: node dist/example.mjs diff --git a/.github/workflows/jest.yml b/.github/workflows/jest.yml new file mode 100644 index 0000000..1dc8d38 --- /dev/null +++ b/.github/workflows/jest.yml @@ -0,0 +1,91 @@ +name: jest +permissions: + contents: read + +on: + - pull_request + - push + +env: + EM_CACHE_FOLDER: 'emsdk-cache' + NODE_LATEST_VERSION: '24' + +jobs: + jest: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + node-version: ['20', '22', '24'] + + steps: + - uses: actions/checkout@v6 + + - uses: actions/setup-node@v6 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + + - uses: actions/cache@v4 + with: + path: ${{ env.EM_CACHE_FOLDER }} + key: jest-em-cache-${{ runner.os }}-${{ matrix.node-version }} + + - uses: pyodide/setup-emsdk@v15 + with: + actions-cache-folder: ${{ env.EM_CACHE_FOLDER }} + + - name: dependencies + run: npm ci + + - name: jest + run: npm run all + + npm: + runs-on: ubuntu-latest + needs: jest + + if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags')" + + environment: npm + permissions: + id-token: write + + steps: + - uses: actions/checkout@v6 + + - name: recovery tag information + run: git fetch --tags --force + + - uses: actions/setup-node@v6 + with: + node-version: ${{ env.NODE_LATEST_VERSION }} + cache: 'npm' + + - uses: actions/cache@v4 + with: + path: ${{ env.EM_CACHE_FOLDER }} + key: jest-em-cache-${{ runner.os }}-${{ env.NODE_LATEST_VERSION }} + + - uses: pyodide/setup-emsdk@v15 + with: + actions-cache-folder: ${{ env.EM_CACHE_FOLDER }} + + - name: version + run: npm version from-git --no-git-tag-version + + - name: extract tag + run: | + GIT_TAG=${GITHUB_REF#refs/tags/} + TAG=$(echo $GIT_TAG | sed -E 's/^v//' | sed -E 's/[0-9\.-]//g' | sed -E 's/^$/latest/g') + echo TAG=$TAG >> $GITHUB_ENV + + - name: dependencies + run: npm ci + + - name: build + run: npm run build + + - name: publish + run: npm publish --tag $TAG diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 27b99c4..699e531 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -10,13 +10,38 @@ env: PYTHON_LATEST_VERSION: '3.13' jobs: + pytest: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + python-version: ['3.10', '3.11', '3.12', '3.13'] + + steps: + - uses: actions/checkout@v6 + + - uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + + - name: dependencies + run: pip install '.[dev]' + + - name: pytest + run: pytest --cov=pyds + wheels: runs-on: ${{ matrix.os }} + needs: pytest + + if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags')" strategy: fail-fast: false matrix: - os: [windows-latest] + os: [ubuntu-latest, macos-latest] steps: - uses: actions/checkout@v6 From 822b0d158870de9aa4873f9c176fbd040034570e Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Mon, 24 Nov 2025 23:50:25 +0800 Subject: [PATCH 12/12] Add windows platform. --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 699e531..95a487e 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -41,7 +41,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest] + os: [windows-latest, ubuntu-latest, macos-latest, macos-latest-large] steps: - uses: actions/checkout@v6