From dceb14e5725587165e0692bc1d3ee6796d976a43 Mon Sep 17 00:00:00 2001 From: Kentaro Ozeki <32771324+ozekik@users.noreply.github.com> Date: Tue, 26 Sep 2023 15:37:22 +0900 Subject: [PATCH] Fix tests --- .github/workflows/ci.yaml | 38 ++++++++++++++++++++++++++++++++++++++ tox.ini | 19 +++++-------------- 2 files changed, 43 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index dd9df9a..07862a1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -76,6 +76,17 @@ jobs: args: --release --out dist --find-interpreter sccache: 'true' manylinux: auto + - name: Run tests + # NOTE: aarch64 is built on docker, so we cannot run tests on it + if: "matrix.target != 'aarch64'" + shell: bash + # TODO: Run on all Python versions + run: | + python3.10 -m pip install --upgrade pip + python3.10 -m pip install pytest~=7.4.2 + python3.10 -m pip install dist/*cp310*${{ matrix.wheel_arch || matrix.target }}*.whl + cd tests/ + python3.10 -m pytest . - name: Upload wheels uses: actions/upload-artifact@v3 with: @@ -89,6 +100,9 @@ jobs: matrix: # target: [x64, x86] target: [x64] + include: + - target: x64 + wheel_arch: amd64 steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 @@ -101,6 +115,16 @@ jobs: target: ${{ matrix.target }} args: --release --out dist --find-interpreter sccache: 'true' + - name: Run tests + shell: bash + # TODO: Run on all Python versions + # NOTE: There is no versioned Python executables on Windows + run: | + python -m pip install --upgrade pip + python -m pip install pytest~=7.4.2 + python -m pip install dist/*cp310*${{ matrix.wheel_arch || matrix.target }}*.whl + cd tests/ + python -m pytest . - name: Upload wheels uses: actions/upload-artifact@v3 with: @@ -113,6 +137,9 @@ jobs: strategy: matrix: target: [x86_64, aarch64] + include: + - target: aarch64 + wheel_arch: arm64 steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 @@ -124,6 +151,17 @@ jobs: target: ${{ matrix.target }} args: --release --out dist --find-interpreter sccache: 'true' + - name: Run tests + # NOTE: We cannnot run tests for aarch64 (arm64) + if: "matrix.target != 'aarch64'" + shell: bash + # TODO: Run on all Python versions + run: | + python3.10 -m pip install --upgrade pip + python3.10 -m pip install pytest~=7.4.2 + python3.10 -m pip install dist/*cp310*${{ matrix.wheel_arch || matrix.target }}*.whl + cd tests/ + python3.10 -m pytest . - name: Upload wheels uses: actions/upload-artifact@v3 with: diff --git a/tox.ini b/tox.ini index 569dc36..413ce26 100644 --- a/tox.ini +++ b/tox.ini @@ -7,21 +7,12 @@ envlist = py38,py39,py310,py311 skip_missing_interpreters = true isolated_build = true -requires = tox-pyo3 - -[gh-actions] -python = - 3.8: py38 - 3.9: py39 - 3.10: py310 - 3.11: py311 [testenv] +allowlist_externals = maturin deps = - pytest ~= 6.1.1 + pytest ~= 7.4.2 +commands_pre = + maturin develop --release commands = - poetry install - poetry run pytest --cache-clear tests/ -pyo3 = true -whitelist_externals = poetry -skip_install = true + pytest --cache-clear tests/