Skip to content

Make: Use newer image for Arm CI #680

Make: Use newer image for Arm CI

Make: Use newer image for Arm CI #680

Workflow file for this run

name: Pre-Release
on:
push:
branches: ["main-*"]
pull_request:
branches: ["main-*"]
env:
BUILD_TYPE: Release
GH_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
SWIFT_VERSION: 5.9
PYTHONUTF8: 1
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
jobs:
versioning:
name: Update Version
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Run TinySemVer
uses: ashvardanian/[email protected]
with:
verbose: "true"
version-file: "VERSION"
update-version-in: |
Cargo.toml:^version = "(\d+\.\d+\.\d+)"
package.json:"version": "(\d+\.\d+\.\d+)"
CMakeLists.txt:VERSION (\d+\.\d+\.\d+)
update-major-version-in: |
include/simsimd/simsimd.h:^#define SIMSIMD_VERSION_MAJOR (\d+)
update-minor-version-in: |
include/simsimd/simsimd.h:^#define SIMSIMD_VERSION_MINOR (\d+)
update-patch-version-in: |
include/simsimd/simsimd.h:^#define SIMSIMD_VERSION_PATCH (\d+)
dry-run: "true"
test_c:
name: Test C
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y cmake build-essential libjemalloc-dev libomp-dev libopenblas-dev
- name: Build locally
run: |
cmake -D CMAKE_BUILD_TYPE=Release -D SIMSIMD_BUILD_TESTS=1 -D SIMSIMD_BUILD_BENCHMARKS=1 -D SIMSIMD_BUILD_BENCHMARKS_WITH_CBLAS=1 -B build_release
cmake --build build_release --config Release
- name: Test
run: build_release/simsimd_test_run_time
test_python:
name: Test Python ${{ matrix.python-version }} on ${{ matrix.architecture }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macOS-14, windows-2022]
python-version: ["3.13", "3.8"]
architecture: [x64, arm64]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --no-cache-dir --upgrade pip
pip install --no-cache-dir py-cpuinfo pytest pytest-repeat numpy scipy tabulate
python -c "from cpuinfo import get_cpu_info; print(get_cpu_info())"
- name: Build locally on Ubuntu
run: |
sudo apt-get update
sudo apt-get install gcc-12 -y
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12
sudo update-alternatives --config gcc
gcc --version
python -m pip install .
if: ${{ matrix.os == 'ubuntu-22.04' }}
- name: Build locally on other OS
run: python -m pip install .
if: ${{ matrix.os != 'ubuntu-22.04' }}
- name: Test with PyTest
run: |
python -c "import simsimd; print(simsimd.get_capabilities())"
pytest scripts/test.py -s -x -Wd -v
test_nodejs:
name: Test Node.js
runs-on: ubuntu-22.04
env:
CC: gcc-12
CXX: g++-12
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update compilers
run: |
sudo apt update
sudo apt install -y cmake build-essential libjemalloc-dev libomp-dev gcc-12 g++-12
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Build and Test
run: |
npm ci --ignore-scripts
npm run install
npm run build-js
npm test
test_deno:
name: Test Deno
runs-on: ubuntu-22.04
env:
CC: gcc-12
CXX: g++-12
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update compilers
run: |
sudo apt update
sudo apt install -y cmake build-essential libjemalloc-dev libomp-dev gcc-12 g++-12
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Build and Test with Node
run: |
npm ci --ignore-scripts
npm run install
npm run build-js
npm test
- name: Set up Deno
uses: denoland/setup-deno@v1
with:
deno-version: vx.x.x
- name: Test with Deno
run: deno test --allow-read
test_rust:
name: Test Rust
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: moonrepo/setup-rust@v1
- name: Build and Test
run: cargo test
# Temporary workaround to run Swift tests on Linux
# Based on: https://github.com/swift-actions/setup-swift/issues/591#issuecomment-1685710678
test_ubuntu_swift:
name: Swift on Linux
runs-on: ubuntu-22.04
container: swift:5.9
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Test Swift
run: swift test
# Compiling Python images is a nightmare, assuming the number of platforms we support
# To minimize cross-compilation we use separate runners for each platform
# https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
# https://cibuildwheel.pypa.io/en/stable/#what-does-it-do
# Available Linux images: https://cibuildwheel.pypa.io/en/stable/options/#linux-image
build_wheels_linux_x86:
name: Build Python Wheels (Linux x86)
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["37", "38", "39", "310", "311", "312", "313"]
needs: [test_python]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install Toolchain
run: |
python -m pip install cibuildwheel
cibuildwheel --output-dir wheelhouse
env:
# Matches: `cp37-manylinux_x86_64` and `cp38-musllinux_x86_64`
CIBW_BUILD: cp${{ matrix.python-version }}-*
CIBW_PLATFORM: linux
CIBW_ARCHS: x86_64
build_wheels_linux_arm:
name: Build Python Wheels (Linux ARM)
runs-on: ubuntu-24.04-arm64 # These are maintained by Arm, not GitHub
strategy:
matrix:
python-version: ["37", "38", "39", "310", "311", "312", "313"]
needs: [test_python]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install Toolchain
run: |
python -m pip install cibuildwheel
cibuildwheel --output-dir wheelhouse
env:
# Matches: `cp37-manylinux_aarch64` and `cp38-musllinux_aarch64`
CIBW_BUILD: cp${{ matrix.python-version }}-*
CIBW_PLATFORM: linux
CIBW_ARCHS: aarch64
build_wheels_macos_x86:
name: Build Python Wheels (macOS x86)
runs-on: macos-13
strategy:
matrix:
python-version: ["37", "38", "39", "310", "311", "312", "313"]
needs: [test_python]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install Toolchain
run: |
python -m pip install cibuildwheel
cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: cp${{ matrix.python-version }}-*
CIBW_PLATFORM: macos
CIBW_ARCHS: x86_64
build_wheels_macos_arm:
name: Build Python Wheels (macOS ARM)
runs-on: macos-14
strategy:
matrix:
python-version: ["38", "39", "310", "311", "312", "313"] #! Python 3.7 isn't supported on ARM macOS
needs: [test_python]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install Toolchain
run: |
python -m pip install cibuildwheel
cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: cp${{ matrix.python-version }}-*
CIBW_PLATFORM: macos
CIBW_ARCHS: arm64
build_wheels_windows:
name: Build Python Wheels (Windows)
runs-on: windows-2022
strategy:
matrix:
python-version: ["37", "38", "39", "310", "311", "312", "313"]
architecture: [AMD64, x86] # List ARM64 separately
#! ARM64 isn't supported for Python 3.7 and 3.8
include:
- python-version: "39"
architecture: ARM64
- python-version: "310"
architecture: ARM64
- python-version: "311"
architecture: ARM64
- python-version: "312"
architecture: ARM64
- python-version: "313"
architecture: ARM64
needs: [test_python]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Setup MSVC
uses: microsoft/setup-msbuild@v2
with:
vs-version: "17.10"
- name: Install Toolchain
run: |
python -m pip install cibuildwheel
cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: cp${{ matrix.python-version }}-win_${{ matrix.architecture }}
CIBW_PLATFORM: windows
build_wheels_other:
name: Build Python Wheels (Other Platforms)
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["37", "38", "39", "310", "311", "312", "313"]
needs: [test_python]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Install Toolchain
run: |
python -m pip install cibuildwheel
cibuildwheel --output-dir wheelhouse
env:
# https://cibuildwheel.pypa.io/en/stable/options/#archs
CIBW_BUILD: cp${{ matrix.python-version }}-*
CIBW_PLATFORM: linux
CIBW_ARCHS: ppc64le s390x i686 #! `armv7l` not worth the trouble