1
1
name : CI
2
- on :
3
- pull_request : {}
4
- push : {}
2
+ on : [push]
5
3
6
4
jobs :
7
- test :
8
- runs-on : ${{ matrix.os }}
5
+ build :
6
+ name : ${{ matrix.python-version }} ${{ matrix.platform.os }}-${{ matrix.platform.python-architecture }}
7
+ runs-on : ${{ matrix.platform.os }}
9
8
strategy :
9
+ fail-fast : false # If one platform fails, allow the rest to keep testing.
10
10
matrix :
11
- os : [ubuntu-latest, macos-latest, windows-latest]
12
- python-version : [3.5, 3.6, 3.7, 3.8, 3.9, pypy3]
11
+ python-version : [3.6, 3.7, 3.8, 3.9, pypy3]
12
+ platform : [
13
+ { os: "macOS-latest", python-architecture: "x64", rust-target: "x86_64-apple-darwin" },
14
+ { os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" },
15
+ { os: "windows-latest", python-architecture: "x64", rust-target: "x86_64-pc-windows-msvc" },
16
+ { os: "windows-latest", python-architecture: "x86", rust-target: "i686-pc-windows-msvc" },
17
+ ]
18
+ exclude :
19
+ # No 64-bit pypy on windows
20
+ - python-version : pypy3
21
+ platform : { os: "windows-latest", python-architecture: "x64" }
22
+ # Example rust_with_cffi broken on Python 3.5 for Windows, never mind!
23
+ - python-version : 3.5
24
+ platform : { os: "windows-latest" }
25
+
13
26
steps :
14
- - uses : actions/checkout@master
15
- - name : Setup python
27
+ - uses : actions/checkout@v2
28
+
29
+ - name : Set up Python ${{ matrix.python-version }}
16
30
uses : actions/setup-python@v2
17
31
with :
18
32
python-version : ${{ matrix.python-version }}
33
+ architecture : ${{ matrix.platform.python-architecture }}
19
34
20
- - uses : actions-rs/toolchain@v1
21
- with :
22
- profile : minimal
23
- toolchain : stable
24
- override : true
25
-
26
- # Install 32-bit windows target for pypy3
27
- - if : matrix.os == 'windows-latest' && matrix.python-version == 'pypy3'
28
- name : Install 32-bit Rust target
35
+ - name : Install Rust toolchain
29
36
uses : actions-rs/toolchain@v1
30
37
with :
31
- profile : minimal
32
38
toolchain : stable
33
- override : true
34
- target : i686-pc-windows-msvc
39
+ target : ${{ matrix.platform.rust-target }}
40
+ profile : minimal
41
+ default : true
42
+
43
+ - name : Install test dependencies
44
+ run : pip install --upgrade tox setuptools
35
45
36
46
- name : Build package
37
47
run : pip install -e .
38
48
39
- - name : Test tomlgen_rust
49
+ - name : Test examples
50
+ if : matrix.python-version != 'pypy3'
40
51
shell : bash
52
+ env :
53
+ PYTHON : ${{ matrix.python-version }}
41
54
run : |
42
- pip install wheel
43
- cd example_tomlgen
44
- python setup.py tomlgen_rust -w build
45
-
46
- # Install lxml build dependencies on ubuntu for pypy
47
- - if : matrix.os == 'ubuntu-latest' && matrix.python-version == 'pypy3'
48
- name : Install lxml build dependencies
49
- run : sudo apt-get install -y libxml2-dev libxslt-dev
55
+ for example_dir in examples/*; do
56
+ tox -c $example_dir -e py
57
+ done
50
58
51
- # Can't test easily on windows pypy because have to build lxml from source!
52
- - name : Test html-py-ever
53
- if : ${{ !( matrix.os == 'windows-latest ' && matrix.python-version == 'pypy3') }}
59
+ - name : Test examples ( pypy)
60
+ # FIXME: issues with tox + pypy + windows
61
+ if : matrix.python-version == 'pypy3 ' && matrix.platform.os != 'windows-latest'
54
62
shell : bash
55
63
run : |
56
- pip install tox
57
- tox -c html-py-ever -e py
64
+ for example_dir in examples/*; do
65
+ if [[ $example_dir = "examples/html-py-ever" ]]; then
66
+ echo "skipping html-py-ever on pypy3 - lxml is hard to build from source"
67
+ continue
68
+ fi
69
+
70
+ tox -c $example_dir -e py
71
+ done
58
72
59
- - name : Test other examples
60
- shell : bash
61
- run : |
62
- cd examples/
63
- # PEP517 build isolation means we don't use the setuptools-rust locally,
64
- # instead it installs from PyPI!
65
- pip install --no-use-pep517 -e rust_with_cffi/
66
- pip install -r rust_with_cffi/requirements-dev.txt
67
- pytest rust_with_cffi/tests.py
68
73
test-abi3 :
69
74
runs-on : ${{ matrix.os }}
70
75
strategy :
@@ -91,11 +96,12 @@ jobs:
91
96
run : |
92
97
cd examples/rust_with_cffi/
93
98
python --version
99
+ pip install wheel
94
100
python setup.py bdist_wheel --py-limited-api=cp35
95
101
ls -la dist/
96
102
97
103
# Now we switch to a differnet Python version and ensure we can install
98
- # the wheel we just buitl .
104
+ # the wheel we just built .
99
105
- name : Setup python
100
106
uses : actions/setup-python@v2
101
107
with :
0 commit comments