Skip to content

Add MSVC-specific AVX2 optimization flags to bits_bench compilation #17

Add MSVC-specific AVX2 optimization flags to bits_bench compilation

Add MSVC-specific AVX2 optimization flags to bits_bench compilation #17

Workflow file for this run

# Copyright (c) 2025 ttldtor.
# SPDX-License-Identifier: BSL-1.0
name: ci
on:
pull_request:
workflow_dispatch:
jobs:
build:
strategy:
matrix:
config:
- name: win-vs2022
image: windows-latest
os: windows
cores: 4
cc: 'cl'
cxx: 'cl'
- name: macos-13-xcode-15
image: macos-13
os: macos
cores: 4
xcode: '15.0'
cc: 'clang'
cxx: 'clang++'
- name: ubuntu-24.04-clang-18
image: ubuntu-24.04
os: linux
cores: 4
cc: 'clang-18'
cxx: 'clang++-18'
- name: ubuntu-24.04-gcc-14
image: ubuntu-24.04
os: linux
cores: 4
cc: 'gcc-14'
cxx: 'g++-14'
- name: ubuntu-24.04-arm-gcc-14
image: ubuntu-24.04-arm
os: linux
cores: 4
cc: 'gcc-14'
cxx: 'g++-14'
- name: ubuntu-24.04-gcc-12
image: ubuntu-24.04
os: linux
cores: 4
cc: 'gcc-12'
cxx: 'g++-12'
- name: ubuntu-22.04-gcc-11
image: ubuntu-22.04
os: linux
cores: 4
cc: 'gcc-11'
cxx: 'g++-11'
- name: macos-14-xcode-15
image: macos-14
os: macos
cores: 3
xcode: '15.0'
cc: 'clang'
cxx: 'clang++'
buildType: [ Release, Debug ]
name: "${{ matrix.config.name }}-${{matrix.buildType}}"
runs-on: ${{ matrix.config.image }}
steps:
- uses: actions/checkout@v4
- name: Select Xcode version
if: ${{ contains(matrix.config.os, 'macos') }}
run: sudo xcode-select -s '/Applications/Xcode_${{matrix.config.xcode}}.app/Contents/Developer'
- name: Prepare build
run: |
ls
mkdir ${{github.workspace}}/build
- name: Prepare build (Rosetta test)
if: ${{ matrix.config.image == 'macos-14' }}
run: |
ls
mkdir ${{github.workspace}}/build_x64
- name: Configure CMake
if: ${{ contains(matrix.config.os, 'mac') }}
run: >
cmake -B ${{github.workspace}}/build
-DCMAKE_BUILD_TYPE=${{matrix.buildType}}
-DCMAKE_C_COMPILER=${{matrix.config.cc}}
-DCMAKE_CXX_COMPILER=${{matrix.config.cxx}}
- name: Configure CMake (Rosetta test)
if: ${{ matrix.config.image == 'macos-14' }}
run: >
cmake -B ${{github.workspace}}/build_x64
-DCMAKE_BUILD_TYPE=${{matrix.buildType}}
-DCMAKE_C_COMPILER=${{matrix.config.cc}}
-DCMAKE_CXX_COMPILER=${{matrix.config.cxx}}
-DCMAKE_OSX_ARCHITECTURES=x86_64
- name: Configure CMake
if: ${{ contains(matrix.config.os, 'linux') }}
run: >
cmake -B ${{github.workspace}}/build
-DCMAKE_BUILD_TYPE=${{matrix.buildType}}
-DCMAKE_C_COMPILER=${{matrix.config.cc}}
-DCMAKE_CXX_COMPILER=${{matrix.config.cxx}}
- name: Configure CMake
if: ${{ contains(matrix.config.os, 'win') }}
run: >
cmake -B ${{github.workspace}}/build
-DCMAKE_BUILD_TYPE=${{matrix.buildType}}
- name: Build
if: ${{ !contains(matrix.config.os, 'win') }}
run: >
cmake --build ${{github.workspace}}/build --config ${{matrix.buildType}} -j ${{matrix.config.cores}}
- name: Build
if: ${{ contains(matrix.config.os, 'win') }}
run: >
cmake --build ${{github.workspace}}/build --config ${{matrix.buildType}} -j ${{matrix.config.cores}}
--
/p:CL_MPCount=${{matrix.config.cores}}
- name: Build x86_64 binary (Rosetta test)
if: ${{ matrix.config.image == 'macos-14' }}
run: |
cmake --build ${{github.workspace}}/build_x64 --config ${{matrix.buildType}} -j ${{matrix.config.cores}}
- name: Test under Rosetta (x86_64)
if: ${{ matrix.config.image == 'macos-14' && !cancelled() }}
working-directory: ${{github.workspace}}/build_x64
run: |
echo "=== Running tests via Rosetta (x86_64) ==="
for t in $(ctest --show-only=json-v1 | jq -r '.tests[] | .command[0]'); do
echo "--- Running $t ---"
arch -x86_64 "$t" || exit 1
done
- name: Test
if: ${{ ! cancelled() }}
continue-on-error: true
working-directory: ${{github.workspace}}/build
run: ctest -C ${{matrix.buildType}} --extra-verbose --output-on-failure --parallel ${{matrix.config.cores}}