Skip to content

Commit

Permalink
Merge pull request #69 from Enet4/chore/ci/build-static
Browse files Browse the repository at this point in the history
[CI] add build-static job
  • Loading branch information
Enet4 authored Aug 25, 2023
2 parents c2838b8 + d8eaf48 commit 374800f
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 7 deletions.
54 changes: 48 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,68 @@ 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@v2
- uses: actions/checkout@v3
- name: Cache Faiss shared objects
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.faiss_c
key: ${{ runner.os }}-build-${{ env.cache-name }}1
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/
- name: Build
run: cargo build --verbose
- 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@v3
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@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
components: clippy
cache: true
- run: cargo clippy
env:
RUSTFLAGS: -W warnings
2 changes: 1 addition & 1 deletion faiss-sys/faiss
Submodule faiss updated 2062 files

0 comments on commit 374800f

Please sign in to comment.