From a3e82e15e8b36ce5cd9eec5decb0bd9981900d58 Mon Sep 17 00:00:00 2001 From: Masaki Waga Date: Mon, 31 Jul 2023 17:39:52 +0900 Subject: [PATCH] Set up CI for UnitTest and doxygen --- .github/workflows/boosttest.yml | 129 ++++++++++++++++++++++++++++++++ .github/workflows/doxygen.yml | 33 ++++++++ README.md | 5 +- src/warshall_froid.hh | 2 + test/bellman_ford_test.cc | 3 + test/dbm_test.cc | 61 --------------- test/timed_automaton_test.cc | 3 + test/warshall_froid_test.cc | 3 + wercker.yml | 45 ----------- 9 files changed, 176 insertions(+), 108 deletions(-) create mode 100644 .github/workflows/boosttest.yml create mode 100644 .github/workflows/doxygen.yml delete mode 100644 wercker.yml diff --git a/.github/workflows/boosttest.yml b/.github/workflows/boosttest.yml new file mode 100644 index 0000000..dc733ed --- /dev/null +++ b/.github/workflows/boosttest.yml @@ -0,0 +1,129 @@ +name: Boost.Test + +on: + push: + +jobs: + build: + runs-on: ubuntu-latest + container: maswag/monaa-test-env + strategy: + max-parallel: 4 + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: default build + run: | + mkdir -p build + cd build && cmake .. && make + + gcc_unit_test: + runs-on: ubuntu-latest + container: maswag/monaa-test-env + strategy: + max-parallel: 4 + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: set gcc env + run: | + export CC=/usr/bin/gcc + export CXX=/usr/bin/g++ + - name: build and test + run: | + mkdir -p gcc_build + cd gcc_build && cmake .. && make unit_test && make test + + clang_unit_test: + runs-on: ubuntu-latest + container: maswag/monaa-test-env + strategy: + max-parallel: 4 + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: set clang env + run: | + export CC=/usr/bin/clang + export CXX=/usr/bin/clang++ + - name: build and test + run: | + mkdir -p clang_build + cd clang_build && cmake .. && make unit_test && make test + + ubuntu_focal: + runs-on: ubuntu-20.04 + strategy: + max-parallel: 4 + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Install required packages + run: sudo apt-get update && sudo apt-get install cmake libeigen3-dev libboost-all-dev -y + - name: build and test + run: | + mkdir -p build + cd build && cmake .. && make unit_test && make test + + ubuntu_jammy: + runs-on: ubuntu-22.04 + strategy: + max-parallel: 4 + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Install required packages + run: sudo apt-get update && sudo apt-get install build-essential cmake libeigen3-dev libboost-all-dev -y + - name: build and test + run: | + mkdir -p build + cd build && cmake .. && make unit_test && make test + + macOS_BigSur: + runs-on: macos-11 + strategy: + max-parallel: 4 + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Install required packages + run: brew install eigen boost + - name: build and test + run: | + mkdir -p build + cd build && cmake .. && make unit_test && ./unit_test + + macOS_Monterey: + runs-on: macos-12 + strategy: + max-parallel: 4 + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Install required packages + run: brew install eigen boost + - name: build and test + run: | + mkdir -p build + cd build && cmake .. && make unit_test && ./unit_test + + arch_linux: + runs-on: ubuntu-latest + container: archlinux:base-devel + strategy: + max-parallel: 4 + steps: + - uses: actions/checkout@v3 + - name: Install required packages + run: pacman -Syu cmake eigen boost tbb doxygen --noconfirm + - name: build and test + run: | + mkdir -p build + cd build && cmake .. && make unit_test && ./unit_test diff --git a/.github/workflows/doxygen.yml b/.github/workflows/doxygen.yml new file mode 100644 index 0000000..a326c75 --- /dev/null +++ b/.github/workflows/doxygen.yml @@ -0,0 +1,33 @@ +name: Update Doxygen + +on: + push: + branches: + - master + paths-ignore: + - '.github/workflows/boosttest.yml' + - 'doc/*' + - 'examples/*' + +jobs: + doxygen: + runs-on: ubuntu-latest + strategy: + max-parallel: 4 + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: install_dependencies + run: sudo apt-get update -y && sudo apt-get install build-essential libeigen3-dev libboost-all-dev cmake doxygen graphviz -y + - name: build_doxygen + run: | + mkdir -p /tmp/build && cd /tmp/build + cmake $OLDPWD && make doc + - name: Deploy + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_branch: gh-pages + publish_dir: /tmp/build/doc/html + destination_dir: doxygen diff --git a/README.md b/README.md index c4bd2e7..42518f5 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ Quantitative Timed Pattern Matching =================================== -[![wercker status](https://app.wercker.com/status/f1121fad1e4e172db519adf0da6d07f4/s/master "wercker status")](https://app.wercker.com/project/byKey/f1121fad1e4e172db519adf0da6d07f4) +[![Boost.Test](https://github.com/MasWag/qtpm/actions/workflows/boosttest.yml/badge.svg?branch=master)](https://github.com/MasWag/qtpm/actions/workflows/boosttest.yml) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](./LICENSE) +![Doxygen](https://img.shields.io/badge/docs-Doxygen-deepgreen.svg)](https://maswag.github.io/qtpm/doxygen/index.html) This is our experimental implementation of *Quantitative Timed Pattern Matching*. See [FORMATS2019.md](./experiments/README.md) for the experiments in our FORMATS 2019 paper. @@ -32,7 +33,7 @@ Usage Installation ------------ -This software is tested on Arch Linux and Mac OSX 10.13.5 +This software is tested on Ubuntu 20.04, Ubuntu 22.04, macOS 11, macOS 12, macOS 13, and Arch Linux. ### Requirements diff --git a/src/warshall_froid.hh b/src/warshall_froid.hh index 9f31848..b9249c2 100644 --- a/src/warshall_froid.hh +++ b/src/warshall_froid.hh @@ -1,5 +1,7 @@ #include +#include + #include "weighted_graph.hh" /*! diff --git a/test/bellman_ford_test.cc b/test/bellman_ford_test.cc index 40c2c70..15a7421 100644 --- a/test/bellman_ford_test.cc +++ b/test/bellman_ford_test.cc @@ -1,7 +1,10 @@ +#include #include #include + #include #include + #include "../src/bellman_ford.hh" BOOST_AUTO_TEST_SUITE(BellmanFordTest) diff --git a/test/dbm_test.cc b/test/dbm_test.cc index de266e5..a123100 100644 --- a/test/dbm_test.cc +++ b/test/dbm_test.cc @@ -191,65 +191,4 @@ BOOST_AUTO_TEST_CASE( MergeTest ) BOOST_TEST((B.toTuple() == Bold.toTuple())); } -// BOOST_AUTO_TEST_CASE( findDurationTest ) -// { -// DBM orig, guard; -// orig = DBM::zero(3); -// guard = DBM::zero(3); - -// // 1 \le x \le 2 -// // 3 \le y \le 4 -// orig.value << \ -// Bounds(0, true), Bounds(-1, true), Bounds(-3,true), \ -// Bounds(2, true), Bounds(0, true), Bounds(std::numeric_limits::infinity(), false), \ -// Bounds(4, true), Bounds(std::numeric_limits::infinity(), false), Bounds(0, true); - -// // 7 \le x \le 8 -// // 9 \le y \le 10 -// guard.value << \ -// Bounds(0, true), Bounds(-7, true), Bounds(-9,true), \ -// Bounds(8, true), Bounds(0, true), Bounds(std::numeric_limits::infinity(), false), \ -// Bounds(10, true), Bounds(std::numeric_limits::infinity(), false), Bounds(0, true); - -// Bounds lower, upper; -// orig.findDuration(guard, lower, upper); - -// BOOST_CHECK_EQUAL(lower.first, -5); -// BOOST_CHECK_EQUAL(lower.second, true); -// BOOST_CHECK_EQUAL(upper.first, 7); -// BOOST_CHECK_EQUAL(upper.second, true); -// } - -// BOOST_AUTO_TEST_CASE( findDurationTest2 ) -// { -// DBM orig, guard; -// orig = DBM::zero(2); -// guard = DBM::zero(2); - -// // 3 < x < 5 -// orig.value << Bounds(0, true), Bounds(-3, false), Bounds(5, false), Bounds(0, true); - -// // 4 < x < 6 -// guard.value << Bounds(0, true), Bounds(-4, false), Bounds(6, false), Bounds(0, true); - -// Bounds lower, upper; -// orig.findDuration(guard, lower, upper); - -// BOOST_CHECK_EQUAL(lower.first, 0); -// BOOST_CHECK_EQUAL(lower.second, false); -// BOOST_CHECK_EQUAL(upper.first, 3); -// BOOST_CHECK_EQUAL(upper.second, false); -// } - -// BOOST_AUTO_TEST_CASE( constraintToDBMTest ) -// { -// DBM guard; -// guard = DBM::zero(2); - -// constraintsToDBM({TimedAutomaton::X(0) < 10}, guard); - -// BOOST_CHECK_EQUAL(guard.value(1, 0).first, 10); -// BOOST_CHECK_EQUAL(guard.value(1, 0).second, false); -// } - BOOST_AUTO_TEST_SUITE_END() diff --git a/test/timed_automaton_test.cc b/test/timed_automaton_test.cc index d83e5bf..0230f6d 100644 --- a/test/timed_automaton_test.cc +++ b/test/timed_automaton_test.cc @@ -1,4 +1,7 @@ +#include + #include + #include "../src/timed_automaton.hh" BOOST_AUTO_TEST_SUITE(timedAutomatonParserTests) diff --git a/test/warshall_froid_test.cc b/test/warshall_froid_test.cc index 7fe3fc0..29d1a3a 100644 --- a/test/warshall_froid_test.cc +++ b/test/warshall_froid_test.cc @@ -1,6 +1,9 @@ +#include #include + #include #include + #include "../src/warshall_froid.hh" BOOST_AUTO_TEST_SUITE(WarshallFroidTest) diff --git a/wercker.yml b/wercker.yml deleted file mode 100644 index 1406b92..0000000 --- a/wercker.yml +++ /dev/null @@ -1,45 +0,0 @@ -box: maswag/monaa-test-env - -build: - steps: - - script: - name: default_build - code: | - mkdir build - cd build && cmake .. && make - - script: - name: clean - code: | - rm -rf build -gcc_unit_test: - steps: - - script: - name: set_gcc_env - code: | - export CC=/usr/bin/gcc - export CXX=/usr/bin/g++ - - script: - name: build_and_test - code: | - mkdir build - cd build && cmake .. && make && make test - - script: - name: clean - code: | - rm -rf build -clang_unit_test: - steps: - - script: - name: set_clang_env - code: | - export CC=/usr/bin/clang - export CXX=/usr/bin/clang++ - - script: - name: build_and_test - code: | - mkdir build - cd build && cmake .. && make && make test - - script: - name: clean - code: | - rm -rf build