Skip to content

Commit 1df2ed7

Browse files
committed
further CI fixes
1 parent 9291ae9 commit 1df2ed7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+98
-63
lines changed

.github/workflows/ci.yml

Lines changed: 51 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,75 @@
11
name: CI
2-
on:
3-
pull_request: {}
4-
push: {}
2+
on: [push]
53

64
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 }}
98
strategy:
9+
fail-fast: false # If one platform fails, allow the rest to keep testing.
1010
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+
1326
steps:
14-
- uses: actions/checkout@master
15-
- name: Setup python
27+
- uses: actions/checkout@v2
28+
29+
- name: Set up Python ${{ matrix.python-version }}
1630
uses: actions/setup-python@v2
1731
with:
1832
python-version: ${{ matrix.python-version }}
33+
architecture: ${{ matrix.platform.python-architecture }}
1934

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
2936
uses: actions-rs/toolchain@v1
3037
with:
31-
profile: minimal
3238
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
3545

3646
- name: Build package
3747
run: pip install -e .
3848

39-
- name: Test tomlgen_rust
49+
- name: Test examples
50+
if: matrix.python-version != 'pypy3'
4051
shell: bash
52+
env:
53+
PYTHON: ${{ matrix.python-version }}
4154
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
5058
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'
5462
shell: bash
5563
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
5872
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
6873
test-abi3:
6974
runs-on: ${{ matrix.os }}
7075
strategy:
@@ -91,11 +96,12 @@ jobs:
9196
run: |
9297
cd examples/rust_with_cffi/
9398
python --version
99+
pip install wheel
94100
python setup.py bdist_wheel --py-limited-api=cp35
95101
ls -la dist/
96102
97103
# 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.
99105
- name: Setup python
100106
uses: actions/setup-python@v2
101107
with:

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)