Skip to content

adding gemm, common solvers, physics helpers, and other extended func… #16

adding gemm, common solvers, physics helpers, and other extended func…

adding gemm, common solvers, physics helpers, and other extended func… #16

Workflow file for this run

# SPDX-FileCopyrightText: Copyright (c) 2025-2026 Igal Alkon
# SPDX-FileCopyrightText: Copyright (c) 2026 ALKONTEK <git@alkontek.com>
# SPDX-License-Identifier: BSD-3-Clause
name: Vecmat CI Workflow
on:
push:
branches:
- master
- 'v*.x'
tags: ['v*']
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name != 'push' || !startsWith(github.ref, 'refs/tags/v') }}
permissions:
contents: read
jobs:
build:
name: ${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.precision }}
runs-on: ${{ matrix.runner }}
defaults:
run:
shell: ${{ matrix.shell }}
strategy:
fail-fast: false
matrix:
include:
# Linux x86_64
- os: linux
arch: x86_64
precision: f32
f64: 'OFF'
run_tests: true
runner: ubuntu-24.04
shell: bash
msystem: ''
msys_packages: ''
- os: linux
arch: x86_64
precision: f64
f64: 'ON'
run_tests: true
runner: ubuntu-24.04
shell: bash
msystem: ''
msys_packages: ''
# Linux aarch64 (native hosted ARM runner)
- os: linux
arch: aarch64
precision: f32
f64: 'OFF'
run_tests: false
runner: ubuntu-24.04-arm
shell: bash
msystem: ''
msys_packages: ''
- os: linux
arch: aarch64
precision: f64
f64: 'ON'
run_tests: false
runner: ubuntu-24.04-arm
shell: bash
msystem: ''
msys_packages: ''
# Windows x86_64 (MinGW: current CMake uses GCC flags and -lm)
- os: windows
arch: x86_64
precision: f32
f64: 'OFF'
run_tests: true
runner: windows-latest
shell: 'msys2 {0}'
msystem: MINGW64
msys_packages: mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja zip
- os: windows
arch: x86_64
precision: f64
f64: 'ON'
run_tests: true
runner: windows-latest
shell: 'msys2 {0}'
msystem: MINGW64
msys_packages: mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja zip
# Windows aarch64
- os: windows
arch: aarch64
precision: f32
f64: 'OFF'
run_tests: false
runner: windows-11-arm
shell: 'msys2 {0}'
msystem: CLANGARM64
msys_packages: mingw-w64-clang-aarch64-clang mingw-w64-clang-aarch64-cmake mingw-w64-clang-aarch64-ninja zip
- os: windows
arch: aarch64
precision: f64
f64: 'ON'
run_tests: false
runner: windows-11-arm
shell: 'msys2 {0}'
msystem: CLANGARM64
msys_packages: mingw-w64-clang-aarch64-clang mingw-w64-clang-aarch64-cmake mingw-w64-clang-aarch64-ninja zip
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set up MSYS2
if: matrix.os == 'windows'
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
update: true
install: ${{ matrix.msys_packages }}
- name: Install Linux packages
if: matrix.os == 'linux'
run: |
sudo apt-get update
sudo apt-get install -y ninja-build cmake build-essential
- name: Configure
run: |
cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DVECMAT_USE_F64=${{ matrix.f64 }} \
-DVECMAT_BUILD_TESTS=${{ matrix.run_tests }} \
-DVECMAT_INSTALL=ON \
-DVECMAT_RUNTIME_DISPATCH=ON
- name: Build shared and static
run: cmake --build build --parallel --target vecmat_shared vecmat_static
- name: Build tests and benchmarks
if: matrix.run_tests
run: cmake --build build --parallel --target vecmat_tests vecmat_benchmarks
- name: Run tests
if: matrix.run_tests
run: ./build/test/vecmat_tests
- name: Run benchmarks
if: matrix.run_tests
run: ./build/test/vecmat_benchmarks
# Version-line branches (v0.2.x, v0.3.x, …) build and test only.
# Install trees and GitHub Releases are produced from v* tags.
- name: Package install tree
if: startsWith(github.ref, 'refs/tags/v')
run: |
set -euo pipefail
PRECISION_SUFFIX=""
if [ "${{ matrix.precision }}" != "f32" ]; then
PRECISION_SUFFIX="-${{ matrix.precision }}"
fi
NAME="vecmat-${GITHUB_REF_NAME}-${{ matrix.os }}-${{ matrix.arch }}${PRECISION_SUFFIX}"
cmake --install build --prefix "${NAME}"
cp LICENSE README.md SPECIAL "${NAME}/"
mkdir -p dist
if [ "${{ matrix.os }}" = "windows" ]; then
zip -r "dist/${NAME}.zip" "${NAME}"
else
tar -czf "dist/${NAME}.tar.gz" "${NAME}"
fi
ls -la dist
- name: Upload release artifact
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v6
with:
name: vecmat-${{ github.ref_name }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.precision == 'f32' && '' || format('-{0}', matrix.precision) }}
path: |
dist/*.tar.gz
dist/*.zip
if-no-files-found: error
release:
name: Release ${{ github.ref_name }}
needs: build
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- name: Download packed libraries
uses: actions/download-artifact@v7
with:
path: release-files
merge-multiple: true
- name: List files
run: find release-files -type f -print
- name: Publish GitHub Release
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
generate_release_notes: true
fail_on_unmatched_files: true
files: |
release-files/*.tar.gz
release-files/*.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}