2727 run : black --check .
2828 - name : Check rust formatting (rustfmt)
2929 run : cargo fmt --all -- --check
30-
30+
3131 clippy :
3232 runs-on : ubuntu-latest
3333 steps :
@@ -38,38 +38,80 @@ jobs:
3838 profile : minimal
3939 components : clippy
4040 - run : make clippy
41-
41+
4242 build :
4343 needs : [fmt] # don't wait for clippy as fails rarely and takes longer
4444 name : python${{ matrix.python-version }}-${{ matrix.platform.python-architecture }} ${{ matrix.platform.os }} ${{ matrix.msrv }}
4545 runs-on : ${{ matrix.platform.os }}
4646 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.
4848 matrix :
4949 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+ ]
5784 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" }
6192 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+ }
71102 msrv : " MSRV"
72103
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+
73115 steps :
74116 - uses : actions/checkout@v2
75117
@@ -94,28 +136,15 @@ jobs:
94136 - name : Build (no features)
95137 run : cargo build --no-default-features --verbose --target ${{ matrix.platform.rust-target }}
96138
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-
107139 - name : Build
108140 run : cargo build --features=${{env.features}} --verbose --target ${{ matrix.platform.rust-target }}
109141
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') }}
111144 name : Install pyo3-asyncio test dependencies
112145 run : |
113146 python -m pip install -U uvloop
114147
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 }}
119148 env :
120149 RUST_BACKTRACE : 1
121150 RUSTFLAGS : " -D warnings"
@@ -138,7 +167,7 @@ jobs:
138167 python -m pip install -U uvloop
139168 - uses : actions-rs/cargo@v1
140169 with :
141- command : test
170+ command : test
142171 args : --all-features
143172 env :
144173 CARGO_INCREMENTAL : 0
@@ -148,4 +177,4 @@ jobs:
148177 id : coverage
149178 - uses : codecov/codecov-action@v1
150179 with :
151- file : ${{ steps.coverage.outputs.report }}
180+ file : ${{ steps.coverage.outputs.report }}
0 commit comments