-
Notifications
You must be signed in to change notification settings - Fork 5
99 lines (91 loc) · 2.99 KB
/
build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Build
on:
push:
branches:
- main
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: actions/checkout@v4
- uses: dprint/[email protected]
- uses: pre-commit/[email protected]
build-macos:
strategy:
fail-fast: false
matrix:
os: [macos-13, macos-14]
feature: [ruy, accelerate]
runs-on: ${{ matrix.os }}
steps:
- name: Install OpenBLAS
if: ${{ matrix.feature == 'openblas' }}
run: |
brew install openblas
PREFIX=$(brew --prefix openblas)
echo "LIBRARY_PATH=$PREFIX/lib:$LIBRARY_PATH" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "CMAKE_PREFIX_PATH=$PREFIX:$CMAKE_PREFIX_PATH" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build -vv --no-default-features -F "${{ matrix.feature }}"
- name: Run tests
run: cargo test -vv --no-default-features -F "${{ matrix.feature }}"
build-linux:
strategy:
fail-fast: false
matrix:
feature: [ruy, mkl, openblas]
runs-on: ubuntu-latest
env:
LIBRARY_PATH: /usr/lib/x86_64-linux-gnu
steps:
- name: Install MKL
if: ${{ matrix.feature == 'mkl' }}
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo sh -c 'echo deb https://apt.repos.intel.com/mkl all main > /etc/apt/sources.list.d/intel-mkl.list'
sudo apt-get update
sudo apt-get install -y intel-mkl-64bit-2020.4-912
echo "LD_LIBRARY_PATH=/opt/intel/lib/intel64:$LD_LIBRARY_PATH" >> $GITHUB_ENV
- name: Install OpenBLAS
if: ${{ matrix.feature == 'openblas' }}
run: |
sudo apt-get update
sudo apt-get install -y cmake libclang-dev libopenblas-dev
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build -vv --no-default-features -F "${{ matrix.feature }}"
- name: Run tests
run: cargo test -vv --no-default-features -F "${{ matrix.feature }}"
build-windows:
strategy:
fail-fast: false
matrix:
feature: [ruy]
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build -vv --no-default-features -F "${{ matrix.feature }}"
- name: Run tests
run: cargo test -vv --no-default-features -F "${{ matrix.feature }}"