27
27
run : black --check .
28
28
- name : Check rust formatting (rustfmt)
29
29
run : cargo fmt --all -- --check
30
-
30
+
31
31
clippy :
32
32
runs-on : ubuntu-latest
33
33
steps :
@@ -38,38 +38,80 @@ jobs:
38
38
profile : minimal
39
39
components : clippy
40
40
- run : make clippy
41
-
41
+
42
42
build :
43
43
needs : [fmt] # don't wait for clippy as fails rarely and takes longer
44
44
name : python${{ matrix.python-version }}-${{ matrix.platform.python-architecture }} ${{ matrix.platform.os }} ${{ matrix.msrv }}
45
45
runs-on : ${{ matrix.platform.os }}
46
46
strategy :
47
- fail-fast : false # If one platform fails, allow the rest to keep testing.
47
+ fail-fast : false # If one platform fails, allow the rest to keep testing.
48
48
matrix :
49
49
rust : [stable]
50
- python-version : [3.6, 3.7, 3.8, 3.9, 3.10-dev, pypy-3.6]
51
- platform : [
52
- { os: "macOS-latest", python-architecture: "x64", rust-target: "x86_64-apple-darwin" },
53
- { os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" },
54
- { os: "windows-latest", python-architecture: "x64", rust-target: "x86_64-pc-windows-msvc" },
55
- { os: "windows-latest", python-architecture: "x86", rust-target: "i686-pc-windows-msvc" },
56
- ]
50
+ python-version :
51
+ [
52
+ " 3.7" ,
53
+ " 3.8" ,
54
+ " 3.9" ,
55
+ " 3.10" ,
56
+ " 3.11-dev" ,
57
+ " pypy-3.7" ,
58
+ " pypy-3.8" ,
59
+ " pypy-3.9" ,
60
+ ]
61
+ platform :
62
+ [
63
+ {
64
+ os : " macOS-latest" ,
65
+ python-architecture : " x64" ,
66
+ rust-target : " x86_64-apple-darwin" ,
67
+ },
68
+ {
69
+ os : " ubuntu-latest" ,
70
+ python-architecture : " x64" ,
71
+ rust-target : " x86_64-unknown-linux-gnu" ,
72
+ },
73
+ {
74
+ os : " windows-latest" ,
75
+ python-architecture : " x64" ,
76
+ rust-target : " x86_64-pc-windows-msvc" ,
77
+ },
78
+ {
79
+ os : " windows-latest" ,
80
+ python-architecture : " x86" ,
81
+ rust-target : " i686-pc-windows-msvc" ,
82
+ },
83
+ ]
57
84
exclude :
58
- # There is no 64-bit pypy on windows
59
- - python-version : pypy-3.6
60
- platform : { os: "windows-latest", python-architecture: "x64" }
85
+ # PyPy doesn't release 32-bit Windows builds any more
86
+ - python-version : pypy-3.7
87
+ platform : { os: "windows-latest", python-architecture: "x86" }
88
+ - python-version : pypy-3.8
89
+ platform : { os: "windows-latest", python-architecture: "x86" }
90
+ - python-version : pypy-3.9
91
+ platform : { os: "windows-latest", python-architecture: "x86" }
61
92
include :
62
- # Test minimal supported Rust version (no async-std)
63
- - rust : 1.45 .0
64
- python-version : 3.9
65
- platform : { os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" }
66
- msrv : " MSRV "
67
- # Test minimal supported Rust version (with async-std)
68
- - rust : 1.46.0
69
- python-version : 3.9
70
- platform : { os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" }
93
+ # Test minimal supported Rust version
94
+ - rust : 1.48 .0
95
+ python-version : " 3.10 "
96
+ platform :
97
+ {
98
+ os : " ubuntu-latest " ,
99
+ python-architecture : " x64 " ,
100
+ rust-target : " x86_64-unknown-linux-gnu " ,
101
+ }
71
102
msrv : " MSRV"
72
103
104
+ # Test the `nightly` feature
105
+ - rust : nightly
106
+ python-version : " 3.10"
107
+ platform :
108
+ {
109
+ os : " ubuntu-latest" ,
110
+ python-architecture : " x64" ,
111
+ rust-target : " x86_64-unknown-linux-gnu" ,
112
+ }
113
+ extra_features : " nightly"
114
+
73
115
steps :
74
116
- uses : actions/checkout@v2
75
117
@@ -94,28 +136,15 @@ jobs:
94
136
- name : Build (no features)
95
137
run : cargo build --no-default-features --verbose --target ${{ matrix.platform.rust-target }}
96
138
97
- # Omit async-std-runtime and testing features from MSRV 1.45.0 (See README for details)
98
- - if : matrix.rust == '1.45.0'
99
- name : Prepare 1.45.0 features
100
- run : echo features=attributes,tokio-runtime >> $GITHUB_ENV
101
-
102
- # Use all features for MSRV 1.46.0 and above
103
- - if : matrix.rust != '1.45.0'
104
- name : Prepare all features
105
- run : echo features=testing,attributes,tokio-runtime,async-std-runtime >> $GITHUB_ENV
106
-
107
139
- name : Build
108
140
run : cargo build --features=${{env.features}} --verbose --target ${{ matrix.platform.rust-target }}
109
141
110
- - if : matrix.platform.os != 'windows-latest'
142
+ # uvloop doesn't compile under Windows, Python 3.11-dev, and PyPy
143
+ - if : ${{ matrix.platform.os != 'windows-latest' && matrix.python-version != '3.11-dev' && !startsWith(matrix.python-version, 'pypy') }}
111
144
name : Install pyo3-asyncio test dependencies
112
145
run : |
113
146
python -m pip install -U uvloop
114
147
115
- # Run tests (except on PyPy, because no embedding API).
116
- - if : matrix.python-version != 'pypy-3.6'
117
- name : Test
118
- run : cargo test --features=${{env.features}} --target ${{ matrix.platform.rust-target }}
119
148
env :
120
149
RUST_BACKTRACE : 1
121
150
RUSTFLAGS : " -D warnings"
@@ -138,7 +167,7 @@ jobs:
138
167
python -m pip install -U uvloop
139
168
- uses : actions-rs/cargo@v1
140
169
with :
141
- command : test
170
+ command : test
142
171
args : --all-features
143
172
env :
144
173
CARGO_INCREMENTAL : 0
@@ -148,4 +177,4 @@ jobs:
148
177
id : coverage
149
178
- uses : codecov/codecov-action@v1
150
179
with :
151
- file : ${{ steps.coverage.outputs.report }}
180
+ file : ${{ steps.coverage.outputs.report }}
0 commit comments