Emscripten #433
Workflow file for this run
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: Build | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.ref }}-${{ github.workflow }} | |
cancel-in-progress: true | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
HOMEBREW_NO_INSTALL_CLEANUP: 1 | |
jobs: | |
build: | |
name: ${{ matrix.name }} | |
runs-on: ${{ matrix.os }} | |
env: | |
CMAKE_PREFIX_PATH: ${{ matrix.cmake_prefix_path }} | |
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macos_target }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- name: Linux-Clang | |
os: ubuntu-24.04 | |
build_type: Release | |
generator: Ninja | |
clang_version: latest | |
cmake_bin: "cmake" | |
cmake_flags: '-D CMAKE_CXX_FLAGS="-march=native" -D NEO_ENABLE_INTEL_IPP=ON -D NEO_ENABLE_INTEL_MKL=ON' | |
cmake_prefix_path: "/opt/intel/oneapi/ipp/latest:/opt/intel/oneapi/mkl/latest" | |
cmake_targets: all | |
macos_target: "" | |
- name: Linux-GCC | |
os: ubuntu-24.04 | |
build_type: Debug | |
generator: Ninja | |
clang_version: "" | |
cmake_bin: "cmake" | |
cmake_flags: '-D CMAKE_CXX_FLAGS="-g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all -march=native" -D NEO_ENABLE_INTEL_IPP=ON -D NEO_ENABLE_INTEL_MKL=ON' | |
cmake_prefix_path: "/opt/intel/oneapi/ipp/latest:/opt/intel/oneapi/mkl/latest" | |
cmake_targets: all | |
macos_target: "" | |
- name: Emscripten | |
os: ubuntu-24.04 | |
build_type: Release | |
generator: Ninja | |
clang_version: "" | |
cmake_bin: "emcmake cmake" | |
cmake_flags: '-D CMAKE_CXX_FLAGS="-msimd128 -msse4.2 -fexceptions" -D NEO_ENABLE_BENCHMARKS=OFF -D NEO_ENABLE_TOOLS=OFF -D NEO_ENABLE_XSIMD=ON' | |
cmake_prefix_path: "" | |
cmake_targets: all | |
macos_target: "" | |
- name: macOS-ARM64 | |
os: macos-14 | |
build_type: Release | |
generator: Ninja | |
clang_version: "" | |
cmake_bin: "cmake" | |
cmake_flags: "" | |
cmake_prefix_path: "" | |
cmake_targets: all | |
macos_target: "11.0" | |
- name: macOS-X64 | |
os: macos-13 | |
build_type: Release | |
generator: Ninja | |
clang_version: "" | |
cmake_bin: "cmake" | |
cmake_flags: "" | |
cmake_prefix_path: "" | |
cmake_targets: all | |
macos_target: "10.15" | |
- name: Windows-Clang | |
os: windows-latest | |
build_type: Release | |
generator: Ninja | |
clang_version: latest | |
cmake_bin: "cmake" | |
cmake_flags: '-D CMAKE_CXX_FLAGS="-march=native" -D NEO_ENABLE_INTEL_IPP=OFF -D NEO_ENABLE_INTEL_MKL=OFF -D NEO_ENABLE_BENCHMARKS=OFF' | |
cmake_prefix_path: C:\Program Files (x86)\Intel\oneAPI\ipp\latest;C:\Program Files (x86)\Intel\oneAPI\mkl\latest | |
cmake_targets: all | |
macos_target: "" | |
- name: Windows-MSVC | |
os: windows-latest | |
build_type: Release | |
generator: Ninja | |
clang_version: "" | |
cmake_bin: "cmake" | |
cmake_flags: '-D CMAKE_CXX_FLAGS="/arch:AVX2 /EHsc" -D NEO_ENABLE_INTEL_IPP=OFF -D NEO_ENABLE_INTEL_MKL=OFF' | |
cmake_prefix_path: C:\Program Files (x86)\Intel\oneAPI\ipp\latest;C:\Program Files (x86)\Intel\oneAPI\mkl\latest | |
cmake_targets: all | |
macos_target: "" | |
- name: Coverage-Native | |
os: ubuntu-22.04 | |
build_type: Debug | |
generator: Ninja | |
clang_version: "" | |
cmake_bin: "cmake" | |
cmake_flags: '-D CMAKE_CXX_FLAGS="--coverage -march=native" -D NEO_ENABLE_INTEL_IPP=ON -D NEO_ENABLE_INTEL_MKL=ON' | |
cmake_prefix_path: "/opt/intel/oneapi/ipp/latest:/opt/intel/oneapi/mkl/latest" | |
cmake_targets: neosonar-neo-tests | |
macos_target: "" | |
- name: Coverage-SSE41 | |
os: ubuntu-22.04 | |
build_type: Debug | |
generator: Ninja | |
clang_version: "" | |
cmake_bin: "cmake" | |
cmake_flags: '-D CMAKE_CXX_FLAGS="--coverage -march=x86-64-v2" -D NEO_ENABLE_INTEL_IPP=ON -D NEO_ENABLE_INTEL_MKL=ON' | |
cmake_prefix_path: "/opt/intel/oneapi/ipp/latest:/opt/intel/oneapi/mkl/latest" | |
cmake_targets: neosonar-neo-tests | |
macos_target: "" | |
- name: Coverage-SSE2 | |
os: ubuntu-22.04 | |
build_type: Debug | |
generator: Ninja | |
clang_version: "" | |
cmake_bin: "cmake" | |
cmake_flags: '-D CMAKE_CXX_FLAGS="--coverage -march=x86-64" -D NEO_ENABLE_INTEL_IPP=ON -D NEO_ENABLE_INTEL_MKL=ON' | |
cmake_prefix_path: "/opt/intel/oneapi/ipp/latest:/opt/intel/oneapi/mkl/latest" | |
cmake_targets: neosonar-neo-tests | |
macos_target: "" | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
lfs: true | |
- name: Install dependencies (Linux) | |
if: runner.os == 'Linux' | |
run: > | |
sudo apt update && | |
sudo apt install | |
libcurl4-openssl-dev | |
libasound2-dev | |
xorg-dev | |
libfreetype6-dev | |
libglu1-mesa-dev | |
xvfb | |
ninja-build | |
gcovr | |
- name: Install dependencies (macOS) | |
if: runner.os == 'macOS' | |
run: brew install ninja osxutils | |
- name: Install dependencies (Windows) | |
if: runner.os == 'Windows' | |
shell: bash | |
run: choco install ninja ccache | |
- name: Install clang | |
if: matrix.clang_version != '' | |
uses: egor-tensin/setup-clang@v1 | |
with: | |
version: ${{ matrix.clang_version }} | |
- name: Install IPP/MKL (Linux) | |
if: contains(matrix.name, 'Linux') || contains(matrix.name, 'Coverage') | |
shell: bash | |
run: | | |
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null | |
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list | |
sudo apt update | |
sudo apt install intel-oneapi-mkl-devel intel-oneapi-ipp-devel | |
# - name: Cache IPP (Windows) | |
# if: runner.os == 'Windows' | |
# id: cache-ipp | |
# uses: actions/cache@v4 | |
# with: | |
# key: ipp-v4 | |
# path: C:\Program Files (x86)\Intel | |
# - name: Install IPP (Windows) | |
# if: (runner.os == 'Windows') && (steps.cache-ipp.outputs.cache-hit != 'true') | |
# shell: bash | |
# run: | | |
# curl --output oneapi.exe https://registrationcenter-download.intel.com/akdlm/IRC_NAS/5cb30fb9-21e9-47e8-82da-a91e00191670/w_BaseKit_p_2024.0.1.45_offline.exe | |
# ./oneapi.exe -s -x -f oneapi | |
# ./oneapi/bootstrapper.exe -s -c --action install --components=intel.oneapi.win.ipp.devel:intel.oneapi.win.mkl.devel --eula=accept -p=NEED_VS2022_INTEGRATION=1 --log-dir=. | |
# - name: Save IPP cache (even on CI fail) | |
# if: runner.os == 'Windows' && (steps.cache-ipp.outputs.cache-hit != 'true') | |
# uses: actions/cache/save@v4 | |
# with: | |
# path: C:\Program Files (x86)\Intel | |
# key: ipp-v4 | |
- name: Setup emsdk | |
if: matrix.name == 'Emscripten' | |
uses: mymindstorm/setup-emsdk@v14 | |
with: | |
version: latest | |
- name: Set up Visual Studio shell | |
if: ${{ matrix.name }} == 'Windows-MSVC' | |
uses: egor-tensin/vs-shell@v2 | |
- name: Install ccache | |
uses: hendrikmuhs/ccache-action@main | |
with: | |
key: "neo-build-${{ matrix.name }}" | |
- name: Print native arch flags (GCC) | |
if: contains(matrix.name, 'Coverage') | |
shell: bash | |
run: gcc -march=native -E -v - </dev/null 2>&1 | grep cc1 | |
- name: CMake configure | |
shell: bash | |
run: > | |
${{ matrix.cmake_bin }} -S . | |
-B build | |
-G "${{ matrix.generator }}" | |
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} | |
-D CMAKE_COMPILE_WARNING_AS_ERROR=OFF | |
${{ matrix.cmake_flags }} | |
- name: CMake build | |
shell: bash | |
run: cmake --build build --config ${{ matrix.build_type }} --target ${{ matrix.cmake_targets }} | |
- name: Test | |
if: matrix.name != 'Emscripten' | |
shell: bash | |
run: ctest --test-dir build -C ${{ matrix.build_type }} --output-on-failure | |
- name: Test (Emscripten) | |
if: matrix.name == 'Emscripten' | |
run: node build/test/neosonar-neo-tests.js -v high | |
- name: Coverage report | |
if: contains(matrix.name, 'Coverage') | |
shell: bash | |
run: > | |
gcovr | |
--xml-pretty | |
-e ".*_test\.cpp" | |
--exclude-unreachable-branches | |
--exclude-throw-branches | |
-r src | |
-s build | |
-o build/coverage.xml | |
- name: Upload coverage report | |
uses: codecov/codecov-action@v4 | |
if: contains(matrix.name, 'Coverage') | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./build/coverage.xml | |
fail_ci_if_error: true |