CI #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
# Trigger the workflow manually from the Actions tab | |
workflow_dispatch: | |
inputs: | |
size: | |
type: choice | |
description: "Size of dataset" | |
required: true | |
options: | |
- "300K" | |
- "10M" | |
- "30M" | |
- "100M" | |
ref: | |
description: "Ref (commit hash)" | |
required: false | |
default: "" | |
jobs: | |
test: | |
name: ${{ github.event.inputs.size }} - ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
version: | |
- "1.8" | |
os: | |
- ubuntu-latest | |
arch: | |
- x64 | |
exclude: | |
- os: macOS-latest | |
arch: x86 | |
python-version: ["3.10"] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: "true" | |
fetch-depth: 0 | |
- name: Checkout commit hash ${{ github.event.inputs.ref }} | |
run: git checkout ${{ github.event.inputs.ref }} | |
if: ${{ github.event.inputs.ref != '' }} | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
shell: bash -el {0} | |
run: | | |
conda create -n faiss python=3.10 | |
conda activate faiss | |
conda install -c pytorch faiss-cpu=1.7.4 mkl=2021 blas=1.0=mkl | |
conda install matplotlib scikit-learn | |
pip install h5py | |
- name: Run benchmark (size=${{ github.event.inputs.size }}) | |
shell: bash -el {0} | |
run: | | |
conda activate faiss | |
chmod +x ./run_${{ github.event.inputs.size }}.sh | |
./run_${{ github.event.inputs.size }}.sh | |
python3 eval/eval.py | |
python3 eval/plot.py --size=${{ github.event.inputs.size }} res.csv | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: Results on ${{ github.event.inputs.size }} | |
path: | | |
res.csv | |
result_${{ github.event.inputs.size }}.png |