Skip to content

Commit

Permalink
Add .github/workflows/ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Nov 11, 2024
1 parent 9577509 commit b2f44b8
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 0 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: CI

on:
pull_request:
push:
branches:
- master
- develop
- feature/**

env:
UBSAN_OPTIONS: print_stacktrace=1

jobs:

posix-cmake-test:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, macos-13, macos-14, macos-15 ]
variant: [ Debug, Release ]

runs-on: ${{matrix.os}}

steps:
- uses: actions/checkout@v4

- name: Configure
run: |
mkdir __build__ && cd __build__
cmake -DCMAKE_BUILD_TYPE=${{matrix.variant}} ..
- name: Build tests
run: |
cmake --build __build__
- name: Run tests
run: |
ctest --test-dir __build__ --output-on-failure --no-tests=error
windows-cmake-test:
strategy:
fail-fast: false
matrix:
os: [ windows-2019, windows-2022 ]

runs-on: ${{matrix.os}}

steps:
- uses: actions/checkout@v4

- name: Configure
shell: cmd
run: |
mkdir __build__ && cd __build__
cmake ..
- name: Build tests (Debug)
shell: cmd
run: |
cmake --build __build__ --config Debug
- name: Run tests (Debug)
shell: cmd
run: |
ctest --test-dir __build__ --output-on-failure --no-tests=error -C Debug
- name: Build tests (Release)
shell: cmd
run: |
cmake --build __build__ --config Release
- name: Run tests (Release)
shell: cmd
run: |
ctest --test-dir __build__ --output-on-failure --no-tests=error -C Release
21 changes: 21 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2023, 2024 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt

cmake_minimum_required(VERSION 3.14...3.25)

project(mulxp_test LANGUAGES CXX)

include(CTest)

function(mulxp_add_test name)

add_executable(${name} ${name}.cpp)
add_test(${name} ${name})

endfunction()

mulxp_add_test(mulxp1_test)
mulxp_add_test(mulxp3_test)
mulxp_add_test(mulxp1_32_test)
mulxp_add_test(mulxp3_32_test)

0 comments on commit b2f44b8

Please sign in to comment.