| 1 |
on: |
| 2 |
push: |
| 3 |
branches: [ master ] |
| 4 |
pull_request: |
| 5 |
branches: [ master ] |
| 6 |
|
| 7 |
name: Continuous integration |
| 8 |
|
| 9 |
env: |
| 10 |
CARGO_TERM_COLOR: always |
| 11 |
CARGO_INCREMENTAL: 0 |
| 12 |
MATMUL_NUM_THREADS: 4 |
| 13 |
RUST_BACKTRACE: full |
| 14 |
|
| 15 |
jobs: |
| 16 |
tests: |
| 17 |
runs-on: ${{ matrix.os }} |
| 18 |
continue-on-error: ${{ matrix.experimental }} |
| 19 |
strategy: |
| 20 |
matrix: |
| 21 |
include: |
| 22 |
- rust: 1.41.1 |
| 23 |
experimental: false |
| 24 |
os: ubuntu-latest |
| 25 |
target: x86_64-unknown-linux-gnu |
| 26 |
features: cgemm |
| 27 |
- rust: stable |
| 28 |
experimental: false |
| 29 |
os: ubuntu-latest |
| 30 |
target: x86_64-unknown-linux-gnu |
| 31 |
features: threading cgemm |
| 32 |
test_examples: yes_examples |
| 33 |
test_benchmark: yes_bench |
| 34 |
- rust: nightly |
| 35 |
experimental: false |
| 36 |
os: ubuntu-latest |
| 37 |
target: x86_64-unknown-linux-gnu |
| 38 |
mmtest_feature: avx |
| 39 |
- rust: nightly |
| 40 |
os: ubuntu-latest |
| 41 |
target: x86_64-unknown-linux-gnu |
| 42 |
features: threading cgemm |
| 43 |
mmtest_feature: fma |
| 44 |
experimental: false |
| 45 |
- rust: nightly |
| 46 |
os: ubuntu-latest |
| 47 |
target: i686-unknown-linux-gnu |
| 48 |
features: cgemm |
| 49 |
install_deps: | |
| 50 |
sudo apt-get update |
| 51 |
sudo apt-get install -y gcc-multilib |
| 52 |
experimental: false |
| 53 |
- rust: stable |
| 54 |
experimental: false |
| 55 |
os: macos-latest |
| 56 |
target: x86_64-apple-darwin |
| 57 |
features: threading cgemm |
| 58 |
test_examples: yes_examples |
| 59 |
|
| 60 |
name: tests/${{ matrix.target }}/${{ matrix.rust }} |
| 61 |
steps: |
| 62 |
- uses: actions/checkout@v4 |
| 63 |
- uses: dtolnay/rust-toolchain@stable |
| 64 |
with: |
| 65 |
toolchain: ${{ matrix.rust }} |
| 66 |
targets: ${{ matrix.target }} |
| 67 |
- name: Install dependencies |
| 68 |
if: matrix.install_deps |
| 69 |
run: ${{ matrix.install_deps }} |
| 70 |
- name: Cargo deps locks |
| 71 |
if: ${{ matrix.rust == '1.41.1' }} |
| 72 |
run: |
| 73 |
cargo update -p either --precise 1.13.0 |
| 74 |
- name: Tests |
| 75 |
run: | |
| 76 |
rustc -C target-cpu=native --print cfg |
| 77 |
cargo build -v --features "${{ matrix.features }}" --target "${{ matrix.target }}" |
| 78 |
cargo test -v --tests --lib --no-fail-fast --features "${{ matrix.features }}" --target "${{ matrix.target }}" |
| 79 |
cargo test -v --tests --lib --release --no-fail-fast --features "${{ matrix.features }}" --target "${{ matrix.target }}" |
| 80 |
- name: Test examples |
| 81 |
if: matrix.test_examples |
| 82 |
run: | |
| 83 |
cargo test -v --examples --features "${{ matrix.features }}" --target "${{ matrix.target }}" |
| 84 |
- name: Test benchmark |
| 85 |
if: matrix.test_benchmark |
| 86 |
run: | |
| 87 |
cargo bench --no-run -v --features "${{ matrix.features }}" --target "${{ matrix.target }}" |
| 88 |
python3 ./benches/benchloop.py -t f32 f64 c32 c64 --mc 32 -s 32 64 | tee bench.csv |
| 89 |
cat bench.csv |
| 90 |
- name: Test specific feature |
| 91 |
if: matrix.mmtest_feature |
| 92 |
env: |
| 93 |
MMTEST_FEATURE: ${{ matrix.mmtest_feature }} |
| 94 |
MMTEST_ENSUREFEATURE: 1 |
| 95 |
run: | |
| 96 |
cargo test -v --no-fail-fast |
| 97 |
|
| 98 |
nostd-build: |
| 99 |
runs-on: ubuntu-latest |
| 100 |
continue-on-error: ${{ matrix.experimental }} |
| 101 |
strategy: |
| 102 |
matrix: |
| 103 |
include: |
| 104 |
- rust: 1.41.1 |
| 105 |
experimental: false |
| 106 |
target: thumbv6m-none-eabi |
| 107 |
- rust: stable |
| 108 |
experimental: false |
| 109 |
target: thumbv6m-none-eabi |
| 110 |
|
| 111 |
name: nostd-build/${{ matrix.target }}/${{ matrix.rust }} |
| 112 |
steps: |
| 113 |
- uses: actions/checkout@v4 |
| 114 |
- uses: dtolnay/rust-toolchain@stable |
| 115 |
with: |
| 116 |
toolchain: ${{ matrix.rust }} |
| 117 |
targets: ${{ matrix.target }} |
| 118 |
- name: Tests |
| 119 |
run: | |
| 120 |
cargo rustc "--target=${{ matrix.target }}" --manifest-path=ensure_no_std/Cargo.toml |
| 121 |
|
| 122 |
cross_test: |
| 123 |
runs-on: ubuntu-latest |
| 124 |
strategy: |
| 125 |
matrix: |
| 126 |
include: |
| 127 |
- rust: stable |
| 128 |
target: s390x-unknown-linux-gnu |
| 129 |
features: constconf cgemm threading |
| 130 |
- rust: stable |
| 131 |
target: aarch64-unknown-linux-gnu |
| 132 |
features: constconf cgemm threading |
| 133 |
- rust: 1.65.0 |
| 134 |
target: aarch64-unknown-linux-gnu |
| 135 |
features: cgemm |
| 136 |
|
| 137 |
name: cross_test/${{ matrix.target }}/${{ matrix.rust }} |
| 138 |
steps: |
| 139 |
- uses: actions/checkout@v4 |
| 140 |
- uses: dtolnay/rust-toolchain@stable |
| 141 |
with: |
| 142 |
profile: minimal |
| 143 |
targets: ${{ matrix.target }} |
| 144 |
- name: Cache cargo plugins |
| 145 |
uses: Swatinem/rust-cache@v2 |
| 146 |
- name: Install cross |
| 147 |
if: steps.cache.outputs.cache-hit != 'true' |
| 148 |
run: cargo install cross |
| 149 |
- name: Tests |
| 150 |
run: cross test --target "${{ matrix.target }}" --features "${{ matrix.features }}" |
| 151 |
env: |
| 152 |
MMTEST_FAST_TEST: 1 |
| 153 |
- name: Tests (Release) |
| 154 |
run: cross test --release --target "${{ matrix.target }}" --features "${{ matrix.features }}" |
| 155 |
env: |
| 156 |
MMTEST_FAST_TEST: 1 |
| 157 |
|
| 158 |
|
| 159 |
cargo-careful: |
| 160 |
runs-on: ubuntu-latest |
| 161 |
name: cargo-careful |
| 162 |
steps: |
| 163 |
- uses: actions/checkout@v4 |
| 164 |
- uses: dtolnay/rust-toolchain@stable |
| 165 |
with: |
| 166 |
toolchain: nightly |
| 167 |
- uses: Swatinem/rust-cache@v2 |
| 168 |
- name: Install cargo-careful |
| 169 |
run: cargo install cargo-careful |
| 170 |
- run: cargo careful test -Zcareful-sanitizer=thread --features=threading,cgemm |
| 171 |
|
| 172 |
miri: |
| 173 |
runs-on: ubuntu-latest |
| 174 |
steps: |
| 175 |
- uses: actions/checkout@v4 |
| 176 |
- name: Miri |
| 177 |
run: ci/miri.sh --features cgemm |
| 178 |
|