diff --git a/.github/workflows/macos.yaml b/.github/workflows/macos.yaml index 77973d2b..6b1a1d4a 100644 --- a/.github/workflows/macos.yaml +++ b/.github/workflows/macos.yaml @@ -31,8 +31,6 @@ on: jobs: ci: runs-on: macos-latest - env: - PY_VERSION: "${{ matrix.python-version }}" strategy: matrix: python-version: @@ -58,8 +56,35 @@ jobs: brew unlink gcc brew link gcc - - name: Run "install" to setup Python environment and tooling - run: scripts/macos/setup.sh + - name: Show Python version + run: | + python --version + + - name: Update host Python packaging + run: | + python -m pip install --upgrade "cmake >= 3.25.2" "nox >= 2022.11.21" numpy pip + + - name: Unit tests in Python 3.9 + if: matrix.python-version == '3.9' + run: | + nox --session unit-3.9 + + - name: Unit tests in Python 3.10 + if: matrix.python-version == '3.10' + run: | + nox --session unit-3.10 + + - name: Unit tests AND line coverage in Python 3.11 + if: matrix.python-version == '3.11' + run: | + nox --session cover - - name: Run tests - run: scripts/macos/test.sh + - name: Functional tests in Python 3.11 + if: matrix.python-version == '3.11' + run: | + nox --session functional-3.11 + + - name: Run all doctests + if: matrix.python-version == '3.11' + run: | + nox --session doctest diff --git a/scripts/macos/setup.sh b/scripts/macos/setup.sh deleted file mode 100755 index 7dbb4697..00000000 --- a/scripts/macos/setup.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -e -x - -if [[ -z "${Python_ROOT_DIR}" ]]; then - echo "Python_ROOT_DIR environment variable should be set by the caller." >&2 - exit 1 -fi - -PIP_CMD="${Python_ROOT_DIR}/bin/python -m pip" -echo "PIP_CMD=${PIP_CMD}" - -# Make sure our installed CPython is set up for testing. -${PIP_CMD} install --ignore-installed virtualenv pip -${PIP_CMD} install --upgrade "nox >= 2022.11.21" numpy -# Make sure there is a working ``cmake`` on the ``${PATH}``. -${PIP_CMD} install --upgrade "cmake >= 3.25.2" -command -v cmake diff --git a/scripts/macos/test.sh b/scripts/macos/test.sh deleted file mode 100755 index 48a7be77..00000000 --- a/scripts/macos/test.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -e -x - -if [[ -z "${PY_VERSION}" ]]; then - echo "PY_VERSION environment variable should be set by the caller." >&2 - exit 1 -fi - -if [[ -z "${Python_ROOT_DIR}" ]]; then - echo "Python_ROOT_DIR environment variable should be set by the caller." >&2 - exit 1 -fi - -if [[ "${PY_VERSION}" == "3.9" ]]; then - "${Python_ROOT_DIR}/bin/nox" --session "unit-3.9" -elif [[ "${PY_VERSION}" == "3.10" ]]; then - "${Python_ROOT_DIR}/bin/nox" --session "unit-3.10" -elif [[ "${PY_VERSION}" == "3.11" ]]; then - "${Python_ROOT_DIR}/bin/nox" --session cover - "${Python_ROOT_DIR}/bin/nox" --session "functional-3.11" - "${Python_ROOT_DIR}/bin/nox" --session doctest -else - echo "Unexpected version: ${PY_VERSION}" >&2 - exit 1 -fi