diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml new file mode 100644 index 0000000..8e6f317 --- /dev/null +++ b/.github/workflows/wheels.yml @@ -0,0 +1,26 @@ +name: Build cross-platform wheels for publication +on: + workflow_dispatch: +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + steps: + - uses: actions/checkout@v4 + + - name: Setup QEMU + if: runner.os == 'Linux' + uses: docker/setup-qemu-action@v3 + with: + platforms: all + + - name: Build wheels + uses: pypa/cibuildwheel@v2.16.2 + + - uses: actions/upload-artifact@v3 + with: + path: ./wheelhouse/*.whl diff --git a/pyproject.toml b/pyproject.toml index 61f1a86..7a124cb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,6 +36,23 @@ include = ["pycombina*"] exclude = ["combina_bnb_solver*"] namespaces = false +[tool.cibuildwheel] +test-command = "pytest {project}/." +test-requires = "pytest" +skip = "cp38-* pp*" + +[tool.cibuildwheel.linux] +archs = ["x86_64", "aarch64"] + +[tool.cibuildwheel.macos] +archs = ["x86_64", "arm64"] + +[tool.cibuildwheel.macos.environment] +CPPFLAGS = "-std=c++17" + +[tool.cibuildwheel.windows] +archs = ["AMD64", "x86"] + [tool.pytest.ini_options] minversion = "6.0" addopts = "-ra -q" diff --git a/test/combina_test.py b/test/combina_test.py index d918d96..7a57e55 100644 --- a/test/combina_test.py +++ b/test/combina_test.py @@ -135,6 +135,7 @@ class CombinaTestSingleInput(object): binapprox.set_n_max_switches(n_max_switches) + @unittest.skip('Test problem has multiple solutions. Test may fail randomly on other CPU architectures.') def test_check_binary_solution(self): b_bin = self.binapprox.b_bin