-
Notifications
You must be signed in to change notification settings - Fork 36
77 lines (72 loc) · 1.85 KB
/
ci.yml
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
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
env:
CARGO_TERM_COLOR: always
jobs:
# test `faiss` crates after installing libfaiss_c.so
build:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
steps:
- uses: actions/checkout@v4
- name: Cache Faiss shared objects
uses: actions/cache@v3
with:
path: ~/.faiss_c
key: ${{ runner.os }}-build-${{ env.cache-name }}-libfaiss
- name: Install CMake
uses: lukka/get-cmake@latest
- name: Download and build Faiss
run: ./faiss-sys/ci/install_faiss_c.sh
- name: Install Faiss
run: sudo cp $HOME/.faiss_c/lib*.so /usr/lib/
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
cache: true
# Build and run tests
- name: Run tests
run: cargo test --verbose
# test `faiss` crates with static linking
build-static:
runs-on: ubuntu-22.04
strategy:
matrix:
rust:
- stable
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
cache: true
- name: Install CMake
uses: lukka/get-cmake@latest
- run: gcc -v
- run: cmake --version
# Build everything and run tests
- name: Run tests
run: cargo test --verbose --features static
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
components: clippy
cache: true
- run: cargo clippy
env:
RUSTFLAGS: -W warnings