Skip to content

Commit

Permalink
Test for MacOS build.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gediminas Kirsanskas committed May 5, 2024
1 parent bd88c0d commit eea0b29
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 20 deletions.
25 changes: 14 additions & 11 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,26 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-10.15]
os: [ubuntu-22.04, windows-2022, macos-12, macos-14]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

# Used to host cibuildwheel
- uses: actions/setup-python@v5

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.17.0

- name: Build wheels
uses: pypa/cibuildwheel@v1.11.1.post1
run: python -m cibuildwheel --output-dir wheelhouse
# to supply options, put them in 'env', like:
env:
CIBW_BEFORE_ALL_MACOS: bash scripts/cibw_before_all_macos.sh
CIBW_BUILD: cp36-* cp37-* cp38-* cp39-*
CIBW_SKIP: "*-win32 *-manylinux_i686 *aarch64 *ppc64le *s390x *universal2 *arm64"
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: pytest --pyargs qmeq

- uses: actions/upload-artifact@v2
# env:
# CIBW_SOME_OPTION: value

- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

- name: Upload binaries to release
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/full_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, windows-2022, macos-11]
os: [ubuntu-22.04, windows-2022, macos-12, macos-14]

steps:
- uses: actions/checkout@v4
Expand All @@ -26,11 +26,10 @@ jobs:
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
# to supply options, put them in 'env', like:
env:
CIBW_BEFORE_ALL_MACOS: bash scripts/cibw_before_all_macos.sh
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: pytest --pyargs qmeq
# env:
# CIBW_SOME_OPTION: value

- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
15 changes: 12 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,29 @@ classifiers = [
[project.urls]
Homepage = "http://github.com/gedaskir/qmeq"

[tool.cibuildwheel.macos]
before-all = "bash scripts/cibw_before_all_macos.sh"

[tool.cibuildwheel]
# List of Python versions to build
build = [
"cp38-*",
"cp39-*",
"cp310-*",
"cp311-*",
"cp312-*"
]
# List of builds to skip
skip = [
"*-win32",
"*-manylinux_i686",
"*-win_arm64",
"*musllinux*",
"*i686",
"*aarch64",
"*ppc64le",
"*s390x",
"*universal2",
"*arm64"
"*universal2"
]
# Run the package tests using `pytest`
test-requires = "pytest"
test-command = "pytest --pyargs qmeq"
17 changes: 16 additions & 1 deletion scripts/cibw_before_all_macos.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
#!/bin/bash
set -e -x

ln -sf /usr/local/bin/gcc-10 /usr/local/bin/gcc
GCC_VERSION=gcc-12

echo "Check the locations compilers"
whereis gcc
whereis clang
whereis $GCC_VERSION

echo "Determine the location of $GCC_VERSION"
GCC12_PATH=$(type -P $GCC_VERSION)
echo $GCC12_PATH

echo "Link gcc command to particular $GCC_VERSION"
ln -sf $GCC12_PATH /usr/local/bin/gcc
gcc --version

echo "Link clang command to particular $GCC_VERSION"
ln -sf $GCC12_PATH /usr/local/bin/clang
clang --version

0 comments on commit eea0b29

Please sign in to comment.