diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2b56a778170..69e7687508e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,11 +4,17 @@ on: [push, pull_request] jobs: build: - runs-on: windows-latest + name: python${{ matrix.python-version }}-${{ matrix.platform.python-architecture }} ${{ matrix.platform.os }} + runs-on: ${{ matrix.platform.os }} strategy: - max-parallel: 4 + max-parallel: 8 matrix: python-version: [3.5, 3.6, 3.7, 3.8] + platform: [ + { os: "macOS-latest", python-architecture: "x64", rust-target: "x86_64-apple-darwin" }, + { os: "windows-latest", python-architecture: "x64", rust-target: "x86_64-pc-windows-msvc" }, + { os: "windows-latest", python-architecture: "x86", rust-target: "i686-pc-windows-msvc" }, + ] steps: - uses: actions/checkout@v1 @@ -16,13 +22,12 @@ jobs: uses: actions/setup-python@v1 with: python-version: ${{ matrix.python-version }} - - name: Set Python PATH - run: ci/actions/setup - name: Install Rust uses: actions-rs/toolchain@v1 with: toolchain: nightly default: true + - run: rustup set default-host ${{ matrix.platform.rust-target }} - name: Build run: cargo build --verbose - name: Install test dependencies @@ -30,6 +35,7 @@ jobs: python -m pip install -U pip setuptools pip install setuptools-rust pytest pytest-benchmark tox tox-venv - name: Test - run: ci/actions/test + run: ci/actions/test.sh + shell: bash env: RUST_BACKTRACE: 1 diff --git a/ci/actions/setup.ps1 b/ci/actions/setup.ps1 deleted file mode 100644 index e33a7ffb814..00000000000 --- a/ci/actions/setup.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -$env:PATH="$env:PYTHON;$env:PYTHON\\Scripts;$env:PATH" -$pythonLocation = Invoke-Expression "python -c `"import sys; print(sys.base_prefix)`"" -$env:LIBPATH = "$env:LIBPATH; $( Join-Path $pythonLocation "libs" )" diff --git a/ci/actions/test.ps1 b/ci/actions/test.ps1 deleted file mode 100644 index 1858dd9028c..00000000000 --- a/ci/actions/test.ps1 +++ /dev/null @@ -1,19 +0,0 @@ -Set-PSDebug -trace 2 - -function Invoke-Call -{ - param ([scriptblock]$ScriptBlock) - & @ScriptBlock - if ($LastExitCode -ne 0) - { - exit $LastExitCode - } -} - -Invoke-Call { cargo test --verbose --features="num-bigint num-complex" } - -foreach ($example in Get-ChildItem -dir "examples") -{ - Set-Location $example - Invoke-Call { tox -c "tox.ini" -e py } -} diff --git a/ci/actions/test.sh b/ci/actions/test.sh new file mode 100755 index 00000000000..5feb3de0b51 --- /dev/null +++ b/ci/actions/test.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +cargo test --features "$FEATURES num-bigint num-complex" +(cd pyo3-derive-backend; cargo test) + +for example_dir in examples/*; do + cd $example_dir + tox -c "tox.ini" -e py + cd - +done