Skip to content

Try to fix workflow #115

Try to fix workflow

Try to fix workflow #115

Workflow file for this run

name: tests
on:
push:
paths-ignore:
- "*.md"
pull_request:
types: [opened, synchronize, reopened, edited]
paths-ignore:
- "*.md"
env:
MODULE_NAME: 'blis'
RUN_MYPY: 'false'
jobs:
tests:
name: Test
if: github.repository_owner == 'explosion'
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest, macos-13]
python_version: ["3.9", "3.10", "3.11", "3.12"]
runs-on: ${{ matrix.os }}
steps:
- name: Check out repo
uses: actions/checkout@v3
- name: Configure Python version
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
architecture: x64
- name: Preinstall (Windows)
shell: bash
if: startsWith(matrix.os, 'windows')
run: |
choco install llvm
- name: Install dependencies
run: |
python -m pip install -U build pip setuptools wheel
- name: Build wheel (Windows)
if: startsWith(matrix.os, 'windows')
run: |
set "PATH=C:\Program Files\LLVM\bin;%PATH%"
set "AR=llvm-ar"
set "AS=llvm-as"
set "CC=clang"
set RANLIB=echo
clang --version
python -m build --wheel
- name: Build wheel (Mac)
if: startsWith(matrix.os, 'macos')
run: |
python -m build --wheel
- name: Build wheel (Linux / clang)
if: startsWith(matrix.os, 'ubuntu') && matrix.python_version == '3.6'
run: |
clang --version
CC=clang python -m build --wheel
- name: Build wheel (Linux / gcc-9)
if: startsWith(matrix.os, 'ubuntu') && (matrix.python_version == '3.7' || matrix.python_version == '3.8')
run: |
gcc-9 --version
CC=gcc-9 python -m build --wheel
- name: Build wheel (Linux / gcc-10)
if: startsWith(matrix.os, 'ubuntu') && matrix.python_version == '3.9'
run: |
gcc-10 --version
CC=gcc-10 python -m build --wheel
- name: Build wheel (Linux / clang-13)
if: startsWith(matrix.os, 'ubuntu') && matrix.python_version == '3.10'
run: |
clang-13 --version
CC=clang-13 python -m build --wheel
- name: Build wheel (Linux / gcc)
if: startsWith(matrix.os, 'ubuntu') && (matrix.python_version == '3.11' || matrix.python_version == '3.12')
run: |
gcc --version
CC=gcc python -m build --wheel
# TODO: install mypy from requirements if reenabled
- name: Run mypy
shell: bash
if: ${{ env.RUN_MYPY == 'true' }}
run: |
python -m mypy $MODULE_NAME
- name: Uninstall all packages
run: |
python -m pip freeze > installed.txt
python -m pip uninstall -y -r installed.txt
- name: Install wheel
shell: bash
run: |
python -m pip install dist/*.whl
- name: Delete source directory
shell: bash
run: |
rm -rf $MODULE_NAME
- name: Test import
shell: bash
run: |
python -c "import $MODULE_NAME" -Werror
- name: Install test requirements
run: |
python -m pip install -U -r requirements.txt
- name: Run tests
shell: bash
run: |
python -m pytest --pyargs $MODULE_NAME -Werror