Skip to content

Commit

Permalink
add unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ElektrikAkar committed Dec 4, 2023
1 parent f68ac9d commit 8b3c4ac
Show file tree
Hide file tree
Showing 3 changed files with 144 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/macos-unit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: macOS unit
# adapted from: https://github.com/trase-cpp/trase/tree/master/.github/workflows
on:
push:
branches:
- master
#- develop
pull_request:
branches:
- '**'

jobs:

build-and-test:
name: macOS unit
runs-on: macos-latest

steps:
- uses: actions/checkout@v3

- name: make build directory
run: mkdir build_dir

- name: cmake configure
run: cmake .. -DCMAKE_BUILD_TYPE=Debug
working-directory: build_dir

- name: cmake build
run: cmake --build . --parallel 2
working-directory: build_dir

- name: cmake test
run: ctest -j2 -C Debug --output-on-failure
working-directory: build_dir
76 changes: 76 additions & 0 deletions .github/workflows/ubuntu-unit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Ubuntu unit
# adapted from: https://github.com/trase-cpp/trase/tree/master/.github/workflows
on:
push:
branches:
- master
#- develop
pull_request:
branches:
- '**'

jobs:

build-and-test:
name: Ubuntu unit ${{matrix.CC}}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- CC: gcc-10
CXX: g++-10
compiler: gcc-10 g++-10
- CC: gcc-11
CXX: g++-11
compiler: gcc-11 g++-11
- CC: gcc-12
CXX: g++-12
compiler: gcc-12 g++-12
- CC: gcc-13
CXX: g++-13
compiler: gcc-13 g++-13
- CC: clang-12
CXX: clang++-12
compiler: clang-12
- CC: clang-13
CXX: clang++-13
compiler: clang-13
- CC: clang-14
CXX: clang++-14
compiler: clang-14
- CC: clang-15
CXX: clang++-15
compiler: clang-15
- CC: clang-16
CXX: clang++-16
compiler: clang-16
- CC: clang-17
CXX: clang++-17
compiler: clang-17
steps:
- uses: actions/checkout@v3

- name: update
run: sudo apt update

- name: install compiler
run: sudo apt install ${{matrix.compiler}}

- name: make build directory
run: mkdir build_dir

- name: cmake configure
run: cmake .. -DCMAKE_BUILD_TYPE=Debug
working-directory: build_dir
env:
CC: ${{matrix.CC}}
CXX: ${{matrix.CXX}}

- name: cmake build
run: cmake --build . --parallel 2
working-directory: build_dir

- name: cmake test
run: ctest -j2 -C Debug --output-on-failure
working-directory: build_dir
34 changes: 34 additions & 0 deletions .github/workflows/windows-unit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Windows unit
# adapted from: https://github.com/trase-cpp/trase/tree/master/.github/workflows
on:
push:
branches:
- master
#- develop
pull_request:
branches:
- '**'

jobs:

build-and-test:
name: Windows unit
runs-on: windows-latest

steps:
- uses: actions/checkout@v3

- name: make build directory
run: mkdir build_dir

- name: cmake configure
run: cmake .. -DCMAKE_BUILD_TYPE=Debug
working-directory: build_dir

- name: cmake build
run: cmake --build . --parallel 2
working-directory: build_dir

- name: cmake test
run: ctest -j1 -C Debug --verbose --output-on-failure
working-directory: build_dir

0 comments on commit 8b3c4ac

Please sign in to comment.