Merge pull request #831 from PyO3/x86-ci

Enable mac x64 and Win x86 tests on github Actions
This commit is contained in:
Yuji Kanagawa 2020-03-24 16:21:03 +09:00 committed by GitHub
commit dd240a6f00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 27 deletions

View File

@ -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: 12
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

View File

@ -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" )"

View File

@ -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 }
}

10
ci/actions/test.sh Executable file
View File

@ -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