Skip to content

Commit

Permalink
Add a tests yaml for github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
hit9 committed Oct 10, 2023
1 parent bfb2381 commit dc047df
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: compile_time_regexp.h tests

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

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

strategy:
fail-fast: false

matrix:
build_type: [Debug]
os: [ubuntu-latest]
cpp_compiler: [g++, clang++]
include:
- os: ubuntu-latest
c_compiler: gcc
cpp_compiler: g++
- os: ubuntu-latest
c_compiler: clang
cpp_compiler: clang++
steps:
- uses: actions/checkout@v3

- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build

- name: Configure CMake
working-directory: ${{runner.workspace}}/build
run: >
cmake -B . -S ${{ github.workspace }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DBUILD_TESTS=1
- name: Build Test
working-directory: ${{runner.workspace}}/build
run: cmake --build . --config ${{ matrix.build_type }} --target tests

- name: Run mTest
working-directory: ${{runner.workspace}}/build
run: ctest --test-dir tests --config ${{ matrix.build_type }}

0 comments on commit dc047df

Please sign in to comment.