diff options
Diffstat (limited to '.github/workflows/ci.yml')
| -rw-r--r-- | .github/workflows/ci.yml | 48 |
1 files changed, 44 insertions, 4 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 61042a8..68e1a10 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml | |||
| @@ -41,8 +41,21 @@ jobs: | |||
| 41 | strategy: | 41 | strategy: |
| 42 | fail-fast: false | 42 | fail-fast: false |
| 43 | matrix: | 43 | matrix: |
| 44 | rust-toolchain: [1.45, nightly] | ||
| 44 | python-version: [3.6, 3.7, 3.8, 3.9] | 45 | python-version: [3.6, 3.7, 3.8, 3.9] |
| 45 | os: [ubuntu-latest, macos-latest, windows-latest] | 46 | os: [ubuntu-latest, macos-latest, windows-latest] |
| 47 | architecture: [x86, x64] | ||
| 48 | exclude: | ||
| 49 | # Only build 32-bit for Windows | ||
| 50 | - os: macos-latest | ||
| 51 | architecture: x86 | ||
| 52 | - os: ubuntu-latest | ||
| 53 | architecture: x86 | ||
| 54 | # Only build on Rust 1.45 on Linux | ||
| 55 | - os: macos-latest | ||
| 56 | rust-toolchain: 1.45 | ||
| 57 | - os: windows-latest | ||
| 58 | rust-toolchain: 1.45 | ||
| 46 | 59 | ||
| 47 | steps: | 60 | steps: |
| 48 | - name: Checkout | 61 | - name: Checkout |
| @@ -51,22 +64,35 @@ jobs: | |||
| 51 | - uses: actions/setup-python@v2 | 64 | - uses: actions/setup-python@v2 |
| 52 | with: | 65 | with: |
| 53 | python-version: ${{ matrix.python-version }} | 66 | python-version: ${{ matrix.python-version }} |
| 67 | architecture: ${{ matrix.architecture }} | ||
| 54 | 68 | ||
| 55 | - name: Install dependencies | 69 | - name: Install dependencies |
| 56 | run: | | 70 | run: | |
| 57 | python -m pip install --upgrade pip | 71 | python -m pip install --upgrade pip |
| 58 | pip install poetry | 72 | pip install poetry |
| 59 | poetry install | 73 | poetry install |
| 60 | - name: Install latest nightly | 74 | |
| 75 | - name: Set Rust target environment variable | ||
| 76 | run: bash ci/set-target.sh ${{ matrix.os }} ${{ matrix.architecture }} | ||
| 77 | shell: bash | ||
| 78 | |||
| 79 | - name: Install Rust | ||
| 61 | uses: actions-rs/toolchain@v1 | 80 | uses: actions-rs/toolchain@v1 |
| 62 | with: | 81 | with: |
| 63 | toolchain: nightly | 82 | toolchain: ${{ matrix.rust-toolchain }} |
| 83 | target: ${{ env.ACTIONS_RUST_TARGET }} | ||
| 64 | override: true | 84 | override: true |
| 65 | 85 | ||
| 66 | - name: Build Python package | 86 | - name: Build Python package |
| 67 | run: poetry run maturin develop --release | 87 | if: matrix.architecture == 'x86' |
| 88 | run: poetry run maturin build --target ${{ env.ACTIONS_RUST_TARGET }} | ||
| 89 | |||
| 90 | - name: Build Python package | ||
| 91 | if: matrix.architecture != 'x86' | ||
| 92 | run: poetry run maturin develop | ||
| 68 | 93 | ||
| 69 | - name: Run Python tests | 94 | - name: Run Python tests |
| 95 | if: matrix.architecture != 'x86' | ||
| 70 | run: poetry run pytest -vv --color=yes | 96 | run: poetry run pytest -vv --color=yes |
| 71 | 97 | ||
| 72 | python-publish: | 98 | python-publish: |
| @@ -77,17 +103,31 @@ jobs: | |||
| 77 | matrix: | 103 | matrix: |
| 78 | python-version: [3.6, 3.7, 3.8, 3.9] | 104 | python-version: [3.6, 3.7, 3.8, 3.9] |
| 79 | os: [ubuntu-latest, macos-latest, windows-latest] | 105 | os: [ubuntu-latest, macos-latest, windows-latest] |
| 106 | architecture: [x86, x64] | ||
| 107 | exclude: | ||
| 108 | # Only build 32-bit for Windows | ||
| 109 | - os: macos-latest | ||
| 110 | architecture: x86 | ||
| 111 | - os: ubuntu-latest | ||
| 112 | architecture: x86 | ||
| 113 | |||
| 80 | steps: | 114 | steps: |
| 81 | - uses: actions/checkout@v1 | 115 | - uses: actions/checkout@v1 |
| 82 | 116 | ||
| 83 | - uses: actions/setup-python@v2 | 117 | - uses: actions/setup-python@v2 |
| 84 | with: | 118 | with: |
| 85 | python-version: ${{ matrix.python-version }} | 119 | python-version: ${{ matrix.python-version }} |
| 120 | architecture: ${{ matrix.architecture }} | ||
| 121 | |||
| 122 | - name: Set Rust target environment variable | ||
| 123 | run: bash ci/set-target.sh ${{ matrix.os }} ${{ matrix.architecture }} | ||
| 124 | shell: bash | ||
| 86 | 125 | ||
| 87 | - name: Install latest nightly | 126 | - name: Install latest nightly |
| 88 | uses: actions-rs/toolchain@v1 | 127 | uses: actions-rs/toolchain@v1 |
| 89 | with: | 128 | with: |
| 90 | toolchain: nightly | 129 | toolchain: nightly |
| 130 | target: ${{ env.ACTIONS_RUST_TARGET }} | ||
| 91 | override: true | 131 | override: true |
| 92 | 132 | ||
| 93 | - name: Install dependencies | 133 | - name: Install dependencies |
| @@ -96,7 +136,7 @@ jobs: | |||
| 96 | pip install poetry | 136 | pip install poetry |
| 97 | poetry install | 137 | poetry install |
| 98 | - name: Build Python package | 138 | - name: Build Python package |
| 99 | run: poetry run maturin build --release --no-sdist --strip --interpreter python${{matrix.python_version}} | 139 | run: poetry run maturin build --release --no-sdist --strip --interpreter python${{matrix.python_version}} --target ${{ env.ACTIONS_RUST_TARGET }} |
| 100 | 140 | ||
| 101 | - name: List wheels | 141 | - name: List wheels |
| 102 | if: matrix.os == 'windows-latest' | 142 | if: matrix.os == 'windows-latest' |
