From 4796a13b7633ee3c4be6828e6e41770062c9eb07 Mon Sep 17 00:00:00 2001 From: kngwyu Date: Tue, 24 Mar 2020 14:59:03 +0900 Subject: [PATCH] Enable mac x64 and Win x86 tests on github Actions --- .github/workflows/test.yml | 16 +++++++++++----- ci/actions/setup.ps1 | 3 --- ci/actions/test.ps1 | 19 ------------------- ci/actions/test.sh | 10 ++++++++++ 4 files changed, 21 insertions(+), 27 deletions(-) delete mode 100644 ci/actions/setup.ps1 delete mode 100644 ci/actions/test.ps1 create mode 100755 ci/actions/test.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2b56a778..27c565e0 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: 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 diff --git a/ci/actions/setup.ps1 b/ci/actions/setup.ps1 deleted file mode 100644 index e33a7ffb..00000000 --- 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 1858dd90..00000000 --- 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 00000000..6f014585 --- /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