-
Notifications
You must be signed in to change notification settings - Fork 37
132 lines (111 loc) · 3.52 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
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-latest]
python_version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12.0-rc.2"]
include:
- os: windows-2019
python_version: "3.6"
- os: ubuntu-20.04
python_version: "3.6"
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-12)
if: startsWith(matrix.os, 'ubuntu') && matrix.python_version == '3.10'
run: |
clang-12 --version
CC=clang-12 python -m build --wheel
- name: Build wheel (Linux / gcc)
if: startsWith(matrix.os, 'ubuntu') && (matrix.python_version == '3.11' || matrix.python_version == '3.12.0-rc.2')
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