diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 10ea312..18fa4e5 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -6,9 +6,48 @@ name: Python Package on: [ push, pull_request ] jobs: + test: + name: Run Unit Tests + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ macos-12, windows-latest, ubuntu-latest ] + steps: + - name: Setup cmake + uses: jwlawson/actions-setup-cmake@v1.12 + with: + cmake-version: 'latest' + github-api-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Python + uses: actions/setup-python@v3.1.2 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install flake8 pybind11 + + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + + - name: Build C side with cmake + run: | + cmake . + cmake --build . + + - name: Run C tests + run: ./Test + build-sdist: name: Build SDist runs-on: ubuntu-latest + needs: test steps: - uses: actions/checkout@v3 @@ -22,16 +61,8 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install flake8 python -m pip install setuptools twine build - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Build SDist run: python -m build --sdist @@ -46,6 +77,7 @@ jobs: build-wheels: name: Build Wheels on ${{ matrix.os }} ${{ matrix.arch[0] }} runs-on: ${{ matrix.os }} + needs: test strategy: matrix: os: [ macos-12, windows-latest, ubuntu-latest ] diff --git a/pyproject.toml b/pyproject.toml index b3e9a28..a8f5b97 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,7 +64,7 @@ package-dir = { '' = '.' } # without this line, C++ source files get included in [tool.cibuildwheel] build = "cp*" # only build wheels for cpython. build-frontend = "build" -test-command = "cmake {project} && cmake --build {project} && {project}/Test && pytest {project}/tests --verbose" +test-command = "pytest {project}/tests --verbose" test-extras = ["tests"] test-skip = "*-macosx_arm64 *-macosx_universal2:arm64" # skip testing on arm macOS because CIBW doesnt support it environment = { QUICKTEX_SIMD_MODE = "SSE4" } # SSE4 has a 99% market share and was released under the Bush administration