Skip to content

Commit

Permalink
Merge pull request #392 from unum-cloud/main-dev
Browse files Browse the repository at this point in the history
Improve CI Pipeline
  • Loading branch information
ashvardanian authored Apr 10, 2024
2 parents 333c988 + d39777a commit dfa6ef1
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 45 deletions.
118 changes: 76 additions & 42 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install --save-dev --prefix ./package-ci @semantic-release/exec @semantic-release/git conventional-changelog-eslint semantic-release && npx --prefix ./package-ci semantic-release
- name: Set up Cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Bump version
run: npm install --save-dev --prefix ./package-ci @semantic-release/exec @semantic-release/git conventional-changelog-eslint semantic-release && npx --prefix ./package-ci semantic-release

rebase:
name: Rebase Dev. Branch
Expand Down Expand Up @@ -75,10 +81,12 @@ jobs:
target: aarch64-linux-gnu

steps:
- uses: actions/checkout@v4
- name: Check out refreshed version
uses: actions/checkout@v4
with:
ref: "main"
- run: git submodule update --init --recursive
- name: Pull Git submodules
run: git submodule update --init --recursive

- name: Get version
id: set_version
Expand Down Expand Up @@ -137,15 +145,18 @@ jobs:
matrix:
arch: [x64, x86]
steps:
- uses: actions/checkout@v4
- name: Check out refreshed version
uses: actions/checkout@v4
with:
ref: "main"
- run: git submodule update --init --recursive
- name: Pull Git submodules
run: git submodule update --init --recursive

- name: Setup CMake
uses: jwlawson/actions-setup-cmake@v1.13

- uses: actions/setup-go@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "^1.19.0"

Expand Down Expand Up @@ -185,12 +196,15 @@ jobs:
matrix:
arch: [arm64, x86_64]
steps:
- uses: actions/checkout@v4
- name: Check out refreshed version
uses: actions/checkout@v4
with:
ref: "main"
- run: git submodule update --init --recursive
- name: Pull Git submodules
run: git submodule update --init --recursive

- uses: actions/setup-go@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "^1.21.0"

Expand Down Expand Up @@ -238,10 +252,12 @@ jobs:
matrix:
os: [ubuntu-22.04, macOS-11, windows-2022]
steps:
- uses: actions/checkout@v4
- name: Check out refreshed version
uses: actions/checkout@v4
with:
ref: "main"
- run: git submodule update --init --recursive
- name: Pull Git submodules
run: git submodule update --init --recursive

- name: Get version
id: set_version
Expand All @@ -252,12 +268,9 @@ jobs:

- name: Build library on Ubuntu
run: |
export WASI_VERSION=20
export WASI_VERSION_FULL=${WASI_VERSION}.0
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_VERSION}/wasi-sdk-${WASI_VERSION_FULL}-linux.tar.gz
tar xf wasi-sdk-${WASI_VERSION_FULL}-linux.tar.gz
rm -rf wasi-sdk-${WASI_VERSION_FULL}-linux.tar.gz
export WASI_SDK_PATH=/home/runner/work/usearch/usearch/wasi-sdk-${WASI_VERSION_FULL}
archs=("x86_64" "arm64")
cd ./c
for arch in "${archs[@]}"
Expand Down Expand Up @@ -333,8 +346,8 @@ jobs:
"https://api.github.com/repos/${{ github.repository }}/releases/latest")
echo "last_release_id=$(echo "$response" | jq -r '.id')" >> $GITHUB_OUTPUT
- uses: robinraju/release-downloader@v1.8
name: Download release assets
- name: Download release assets
uses: robinraju/release-downloader@v1.8
with:
latest: true
fileName: "*"
Expand Down Expand Up @@ -388,7 +401,8 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["37", "38", "39", "310", "311", "312"]
steps:
- uses: actions/checkout@v4
- name: Check out refreshed version
uses: actions/checkout@v4
with:
ref: "main"
- name: Setup Docker
Expand Down Expand Up @@ -451,13 +465,13 @@ jobs:
- x86
os:
- macos-latest
- ubuntu-22.04
- ubuntu-latest
- windows-latest
exclude:
- arch: x86
os: macos-latest
- arch: x86
os: ubuntu-22.04
os: ubuntu-latest
runs-on: ${{ matrix.os }}
env:
CC: gcc-12
Expand All @@ -468,7 +482,8 @@ jobs:
uses: actions/checkout@v4
with:
ref: "main"
- run: git submodule update --init --recursive
- name: Pull Git submodules
run: git submodule update --init --recursive

- name: Set up Node.js
uses: actions/setup-node@v4
Expand All @@ -477,13 +492,14 @@ jobs:
architecture: ${{ matrix.arch }}

- name: Update compilers
if: matrix.os == 'ubuntu-22.04'
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install -y cmake build-essential libjemalloc-dev libomp-dev gcc-12 g++-12
sudo apt install -y gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu g++-aarch64-linux-gnu
- run: npm ci --ignore-scripts
- name: Install dependencies
run: npm ci --ignore-scripts
- run: npm run prebuild-single
if: matrix.os != 'macos-latest'
- run: npm run prebuild-darwin-x64+arm64
Expand All @@ -493,8 +509,8 @@ jobs:
if: matrix.os == 'macos-latest'
- run: file prebuilds/*/*
if: matrix.os == 'macos-latest'
- name: Extra for cross build
if: matrix.os == 'ubuntu-22.04'
- name: Build (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
export CC=aarch64-linux-gnu-gcc
export CXX=aarch64-linux-gnu-g++
Expand All @@ -504,7 +520,8 @@ jobs:
export STRIP=aarch64-linux-gnu-strip
npm run prebuild-arm64
aarch64-linux-gnu-strip prebuilds/linux-arm64/*node
- uses: actions/upload-artifact@v3
- name: Upload prebuilds
uses: actions/upload-artifact@v3
with:
name: prebuilds
path: prebuilds
Expand All @@ -516,17 +533,20 @@ jobs:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
- name: Check out refreshed version
uses: actions/checkout@v4
with:
ref: "main"
- run: git submodule update --init --recursive
- name: Pull Git submodules
run: git submodule update --init --recursive

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- uses: actions/download-artifact@v3
- name: Download prebuilds
uses: actions/download-artifact@v3

- name: Look for links
run: find . -type f -links +1
Expand Down Expand Up @@ -554,15 +574,18 @@ jobs:
needs: versioning
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Check out refreshed version
uses: actions/checkout@v4
with:
ref: "main"
- run: git submodule update --init --recursive
- name: Pull Git submodules
run: git submodule update --init --recursive
- name: Hide submodule Crates
run: |
mv simsimd/Cargo.toml simsimd/Cargo.toml.bak
mv stringzilla/Cargo.toml stringzilla/Cargo.toml.bak
- uses: actions-rs/toolchain@v1
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
Expand All @@ -585,11 +608,14 @@ jobs:
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }}

steps:
- uses: actions/checkout@v4
- name: Check out refreshed version
uses: actions/checkout@v4
with:
ref: "main"
- run: git submodule update --init --recursive
- uses: actions/setup-java@v3
- name: Pull Git submodules
run: git submodule update --init --recursive
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: "11"
distribution: "adopt"
Expand All @@ -605,10 +631,12 @@ jobs:
needs: versioning
runs-on: macos-12
steps:
- uses: actions/checkout@v4
- name: Check out refreshed version
uses: actions/checkout@v4
with:
ref: "main"
- run: git submodule update --init --recursive
- name: Pull Git submodules
run: git submodule update --init --recursive
- name: Build
run: swift build
- name: Run tests
Expand All @@ -624,10 +652,12 @@ jobs:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Check out refreshed version
uses: actions/checkout@v4
with:
ref: "main"
- run: git submodule update --init --recursive
- name: Pull Git submodules
run: git submodule update --init --recursive
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
Expand Down Expand Up @@ -669,10 +699,12 @@ jobs:
shell: bash

steps:
- uses: actions/checkout@v4
- name: Check out refreshed version
uses: actions/checkout@v4
with:
ref: "main"
- run: git submodule update --init --recursive
- name: Pull Git submodules
run: git submodule update --init --recursive

- name: Build C library for Linux
if: matrix.os == 'ubuntu-22.04'
Expand Down Expand Up @@ -723,10 +755,12 @@ jobs:
NUGET_SOURCE: https://api.nuget.org/v3/index.json
GITHUB_PACKAGES_SOURCE: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
steps:
- uses: actions/checkout@v4
- name: Check out refreshed version
uses: actions/checkout@v4
with:
ref: "main"
- run: git submodule update --init --recursive
- name: Pull Git submodules
run: git submodule update --init --recursive

- name: Download usearch libs artifact
uses: actions/download-artifact@v3
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/update_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ echo $1 > VERSION &&
sed -i "s/>[0-9]\+\.[0-9]\+\.[0-9]\+<\/Version>/>$1<\/Version>/" ./csharp/nuget/nuget-package.props &&
sed -i "s/VERSION [0-9]\+\.[0-9]\+\.[0-9]\+/VERSION $1/" CMakeLists.txt &&
sed -i "s/version=\".*\"/version=\"$1\"/" wasmer.toml

# Update the version in the Cargo.lock file, but don't report an error if it fails...
# as `cargo` may not be available in the current environment.
cargo update || true
3 changes: 2 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ fn main() {
if cfg!(feature = "simsimd") {
build
.define("USEARCH_USE_SIMSIMD", "1")
.define("SIMSIMD_DYNAMIC_DISPATCH", "1");
.define("SIMSIMD_DYNAMIC_DISPATCH", "1")
.define("SIMSIMD_NATIVE_F16", "0");
} else {
build.define("USEARCH_USE_SIMSIMD", "0");
}
Expand Down
2 changes: 2 additions & 0 deletions include/usearch/index_plugins.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@

#if USEARCH_USE_SIMSIMD
// Propagate the `f16` settings
#if !defined(SIMSIMD_NATIVE_F16)
#define SIMSIMD_NATIVE_F16 !USEARCH_USE_FP16LIB
#endif
#define SIMSIMD_DYNAMIC_DISPATCH 0
// No problem, if some of the functions are unused or undefined
#pragma GCC diagnostic push
Expand Down
2 changes: 1 addition & 1 deletion simsimd

0 comments on commit dfa6ef1

Please sign in to comment.