1
1
name : Test
2
2
3
- on : [push, pull_request]
3
+ on :
4
+ push :
5
+ branches :
6
+ - master
7
+ pull_request :
4
8
5
9
jobs :
6
10
@@ -13,16 +17,16 @@ jobs:
13
17
toolchain : stable
14
18
profile : minimal
15
19
components : rustfmt, clippy
16
- - run :
17
- cargo fmt --all -- check
20
+ - run : |
21
+ cargo fmt --all -- -- check
18
22
cargo clippy --tests
19
23
for example in examples/*; do (cd $example/; cargo clippy) || exit 1; done
20
24
21
- build :
25
+ test :
22
26
name : python${{ matrix.python-version }}-${{ matrix.platform.python-architecture }} ${{ matrix.platform.os }}
23
27
runs-on : ${{ matrix.platform.os }}
24
28
strategy :
25
- max-parallel : 12
29
+ max-parallel : 16
26
30
matrix :
27
31
python-version : [3.6, 3.7, 3.8, 3.9]
28
32
platform : [
@@ -47,12 +51,50 @@ jobs:
47
51
run : cargo build --no-default-features --verbose
48
52
- name : Build with default features
49
53
run : cargo build --verbose
50
- - name : Install test dependencies
54
+ - name : Install numpy and poetry
55
+ run : pip install numpy poetry
56
+ - name : Run cargo test
57
+ run : cargo test --verbose
58
+ - name : Test Examples
51
59
run : |
52
- python -m pip install -U pip setuptools
53
- pip install setuptools-rust pytest pytest-benchmark tox tox-venv numpy
54
- - name : Test
55
- run : ci/actions/test.sh
60
+ for example_dir in examples/*; do
61
+ if [ $example != 'examples/linalg' ]; then
62
+ pushd $example_dir
63
+ poetry install
64
+ poetry run maturin develop
65
+ poetry run pytest
66
+ popd
67
+ fi
68
+ done
56
69
shell : bash
57
70
env :
58
71
RUST_BACKTRACE : 1
72
+
73
+ linalg-example :
74
+ runs-on : ubuntu-latest
75
+ steps :
76
+ - uses : actions/checkout@v2
77
+ - name : Set up Python
78
+ uses : actions/setup-python@v2
79
+ with :
80
+ python-version : 3.8
81
+ - name : Install gfortran
82
+ run : |
83
+ apt update
84
+ apt install -y gfortran
85
+ - name : Install Rust
86
+ uses : actions-rs/toolchain@v1
87
+ with :
88
+ toolchain : stable
89
+ default : true
90
+ - run : rustup set default-host ${{ matrix.platform.rust-target }}
91
+ - name : Install numpy and poetry
92
+ run : pip install numpy poetry
93
+ - name : Test Examples
94
+ run : |
95
+ cd examples/ndarray-linalg
96
+ poetry install
97
+ poetry run maturin develop
98
+ poetry run pytest
99
+ env :
100
+ RUST_BACKTRACE : 1
0 commit comments