@@ -31,48 +31,58 @@ jobs:
31
31
runs-on : ${{ matrix.platform.os }}
32
32
needs : [lint, check-msrv, linalg-example]
33
33
strategy :
34
- max-parallel : 16
34
+ fail-fast : false
35
35
matrix :
36
- python-version : [3.6, 3. 7, 3.8, 3.9]
36
+ python-version : [3.7, 3.8, 3.9]
37
37
platform : [
38
38
{ os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" },
39
39
{ os: "macOS-latest", python-architecture: "x64", rust-target: "x86_64-apple-darwin" },
40
40
{ os: "windows-latest", python-architecture: "x64", rust-target: "x86_64-pc-windows-msvc" },
41
41
{ os: "windows-latest", python-architecture: "x86", rust-target: "i686-pc-windows-msvc" },
42
42
]
43
+ include :
44
+ # PyPy and NumPy on macOS and Windows is too slow and brittle
45
+ - python-version : pypy-3.7
46
+ platform : { os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" }
47
+ - python-version : pypy-3.8
48
+ platform : { os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" }
43
49
steps :
44
50
- uses : actions/checkout@v2
45
51
- name : Set up Python ${{ matrix.python-version }}
46
52
uses : actions/setup-python@v2
47
53
with :
48
54
python-version : ${{ matrix.python-version }}
55
+ architecture : ${{ matrix.platform.python-architecture }}
49
56
- name : Install Rust
50
57
uses : actions-rs/toolchain@v1
51
58
with :
52
59
toolchain : stable
60
+ profile : minimal
61
+ target : ${{ matrix.platform.rust-target }}
53
62
default : true
54
- - run : rustup set default-host ${{ matrix.platform.rust-target }}
63
+ - name : Enable Cargo resolver v2 to avoid PyO3 features missing in PyPy
64
+ run : echo 'resolver = "2"' >> Cargo.toml
55
65
- name : Build without default features
56
- run : cargo build --no-default-features --verbose
66
+ run : cargo build --no-default-features
57
67
- name : Build with default features
58
- run : cargo build --verbose
59
- - name : Install test dependencies
60
- run : |
61
- python -m pip install --upgrade pip
62
- pip install maturin numpy poetry
68
+ run : cargo build
63
69
- name : Run cargo test
64
- run : cargo test --verbose
65
- - name : Test Examples
66
70
run : |
67
- for example_dir in 'examples/simple-extension'; do
68
- pushd $example_dir && \
69
- poetry install && \
70
- poetry run maturin develop && \
71
- poetry run pytest && \
72
- popd
73
- done
74
- shell : bash
71
+ pip install numpy
72
+ cargo test
73
+ # Not on PyPy, because no embedding API
74
+ if : ${{ !startsWith(matrix.python-version, 'pypy') }}
75
+ - name : Install poetry
76
+ run : pip install poetry
77
+ - name : Test example
78
+ run : |
79
+ poetry install
80
+ poetry run maturin develop
81
+ poetry run pytest
82
+ working-directory : examples/simple-extension
75
83
env :
84
+ CARGO_TERM_VERBOSE : true
85
+ CARGO_BUILD_TARGET : ${{ matrix.platform.rust-target }}
76
86
RUST_BACKTRACE : 1
77
87
78
88
check-msrv :
93
103
with :
94
104
working-directory : examples/simple-extension
95
105
continue-on-error : true
96
- - name : Install maturin, poetry, and toml
97
- run : pip install maturin poetry toml
106
+ - name : Install toml and poetry
107
+ run : pip install toml poetry
98
108
- name : Edit Cargo.toml and detach from workspace
99
109
run : |
100
110
import toml
@@ -111,11 +121,12 @@ jobs:
111
121
cargo generate-lockfile
112
122
cargo update -p $(cargo pkgid -p ndarray 2>&1 >/dev/null | grep 0.15 | sed -e 's/^[ \t]*//') --precise 0.13.1
113
123
working-directory : examples/simple-extension
114
- - name : Test Example
124
+ - name : Test example
115
125
run : |
116
- poetry install && poetry run maturin develop && poetry run pytest
126
+ poetry install
127
+ poetry run maturin develop
128
+ poetry run pytest
117
129
working-directory : examples/simple-extension
118
- shell : bash
119
130
120
131
linalg-example :
121
132
runs-on : ubuntu-latest
@@ -134,11 +145,11 @@ jobs:
134
145
toolchain : stable
135
146
- uses : Swatinem/rust-cache@v1
136
147
continue-on-error : true
137
- - name : Install maturin and poetry
138
- run : pip install maturin poetry
139
- - name : Test Examples
148
+ - name : Install poetry
149
+ run : pip install poetry
150
+ - name : Test example
140
151
run : |
141
- cd examples/linalg && \
142
- poetry install && \
143
- poetry run maturin develop && \
152
+ poetry install
153
+ poetry run maturin develop
144
154
poetry run pytest
155
+ working-directory : examples/linalg
0 commit comments