Skip to content

Blaze

Blaze #64

Workflow file for this run

name: Blaze
on:
schedule:
# Once per day, Monday to Friday
- cron: '0 19 * * 1-5'
push:
branches:
- main
pull_request:
jobs:
test:
strategy:
fail-fast: false
matrix:
platform:
- os: macos-latest
cc: clang
cxx: clang++
type: static
shell: sh
benchmark: macos/llvm
- os: macos-latest
cc: clang
cxx: clang++
type: shared
shell: sh
- os: macos-latest
cc: gcc-13
cxx: g++-13
type: static
shell: sh
benchmark: macos/gcc
- os: ubuntu-latest
cc: clang
cxx: clang++
type: static
shell: sh
benchmark: linux/llvm
- os: ubuntu-latest
cc: gcc
cxx: g++
type: static
shell: sh
benchmark: linux/gcc
- os: ubuntu-latest
cc: clang
cxx: clang++
type: shared
shell: sh
- os: ubuntu-latest
cc: gcc
cxx: g++
type: shared
shell: sh
- os: windows-latest
type: static
shell: pwsh
benchmark: windows/msvc
- os: windows-latest
type: shared
shell: pwsh
# Sanitizers
- os: ubuntu-latest
cc: clang
cxx: clang++
type: static
shell: sh
options: -DBLAZE_ADDRESS_SANITIZER:BOOL=ON
- os: ubuntu-latest
cc: clang
cxx: clang++
type: static
shell: sh
options: -DBLAZE_UNDEFINED_SANITIZER:BOOL=ON
defaults:
run:
shell: ${{ matrix.platform.shell }}
runs-on: ${{ matrix.platform.os }}
env:
CC: ${{ matrix.platform.cc }}
CXX: ${{ matrix.platform.cxx }}
steps:
- name: Install ClangFormat
run: pipx install clang-format==19.1.0
- uses: actions/checkout@v4
- name: Install dependencies (macOS)
if: runner.os == 'macos'
run: brew bundle
env:
HOMEBREW_NO_ANALYTICS: 1
HOMEBREW_NO_AUTO_UPDATE: 1
- run: cmake --version
- name: Configure Blaze (static)
if: matrix.platform.type == 'static'
run: >
cmake -S . -B ./build
-DCMAKE_BUILD_TYPE:STRING=Release
-DBLAZE_TESTS:BOOL=ON
-DBLAZE_BENCHMARK:BOOL=ON
-DBLAZE_DOCS:BOOL=OFF
-DBUILD_SHARED_LIBS:BOOL=OFF
-DCMAKE_COMPILE_WARNING_AS_ERROR:BOOL=ON
${{ matrix.platform.options }}
- name: Configure Blaze (shared)
if: matrix.platform.type == 'shared'
run: >
cmake -S . -B ./build
-DCMAKE_BUILD_TYPE:STRING=Release
-DBLAZE_TESTS:BOOL=ON
-DBLAZE_BENCHMARK:BOOL=ON
-DBLAZE_DOCS:BOOL=OFF
-DBUILD_SHARED_LIBS:BOOL=ON
-DCMAKE_COMPILE_WARNING_AS_ERROR:BOOL=ON
${{ matrix.platform.options }}
- run: cmake --build ./build --config Release --target clang_format_test
- run: cmake --build ./build --config Release --parallel 4
- run: >
cmake --install ./build --prefix ./build/dist --config Release --verbose
--component sourcemeta_jsontoolkit
- run: >
cmake --install ./build --prefix ./build/dist --config Release --verbose
--component sourcemeta_jsontoolkit_dev
- run: >
cmake --install ./build --prefix ./build/dist --config Release --verbose
--component sourcemeta_blaze
- run: >
cmake --install ./build --prefix ./build/dist --config Release --verbose
--component sourcemeta_blaze_dev
# Not every CTest version supports the --test-dir option. If such option
# is not recognized, `ctest` will successfully exit finding no tests.
# Better to be sure and `cd` all the time here.
- run: cd ./build && ctest --build-config Release --output-on-failure --parallel
env:
# See https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
UBSAN_OPTIONS: print_stacktrace=1
- run: cmake --build ./build --config Release --verbose --target benchmark_all
if: matrix.platform.benchmark
- run: cmake --build ./build --config Release --verbose --target benchmark_json
if: matrix.platform.benchmark
- uses: benchmark-action/github-action-benchmark@v1
if: matrix.platform.benchmark
with:
name: Benchmark (${{ matrix.platform.benchmark }})
tool: googlecpp
output-file-path: build/benchmark.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: ${{ github.event_name != 'pull_request' }}
benchmark-data-dir-path: benchmark/${{ matrix.platform.benchmark }}
alert-threshold: '5%'
comment-always: true
fail-on-alert: false
bindings:
strategy:
fail-fast: false
matrix:
binding:
- name: nodejs
env:
EMSDK_VERSION: 3.1.58
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
git clone --depth 1 https://github.com/emscripten-core/emsdk.git
./emsdk/emsdk install ${{ env.EMSDK_VERSION }}
./emsdk/emsdk activate ${{ env.EMSDK_VERSION }}
rm -rf emsdk/upstream/emscripten/cmake
echo "$(pwd)/emsdk/upstream/emscripten" >> $GITHUB_PATH
if: matrix.binding.name == 'nodejs'
- run: make -C bindings/${{ matrix.binding.name }} compile
- run: make -C bindings/${{ matrix.binding.name }} test