From 7868d6f775e457bac930c2529e7bd48461e834c4 Mon Sep 17 00:00:00 2001 From: kkitayam <45088311+kkitayam@users.noreply.github.com> Date: Fri, 5 Jan 2024 21:55:45 +0900 Subject: [PATCH 1/4] Add a action for unit testing --- .github/workflows/ut.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/ut.yml diff --git a/.github/workflows/ut.yml b/.github/workflows/ut.yml new file mode 100644 index 0000000..8e309de --- /dev/null +++ b/.github/workflows/ut.yml @@ -0,0 +1,26 @@ +name: Unit test + +on: + workflow_dispatch: + push: + pull_request: + branches: [ main ] + paths: + - 'src/**' + - 'tests/**' + - '.github/workflows/ut.yml' +jobs: + class: + runs-on: "ubuntu-22.04" + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - name: Install gMock and Ninja + run: sudo apt-get install -y libgmock-dev ninja-build + + - name: Run tests + run: | + cmake -G Ninja -S tests -B build-tests + ctest --test-dir build-tests From 1b6e072ad1c12cdc65f4d28113f7bd4ac2e04bbb Mon Sep 17 00:00:00 2001 From: kkitayam <45088311+kkitayam@users.noreply.github.com> Date: Fri, 5 Jan 2024 22:04:08 +0900 Subject: [PATCH 2/4] Change an array to a sequence --- .github/workflows/ut.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ut.yml b/.github/workflows/ut.yml index 8e309de..8c00940 100644 --- a/.github/workflows/ut.yml +++ b/.github/workflows/ut.yml @@ -4,7 +4,8 @@ on: workflow_dispatch: push: pull_request: - branches: [ main ] + branches: + - main paths: - 'src/**' - 'tests/**' From f4899a94dfc5550a26bc5d3e539c5ee4e6263094 Mon Sep 17 00:00:00 2001 From: kkitayam <45088311+kkitayam@users.noreply.github.com> Date: Fri, 5 Jan 2024 22:16:30 +0900 Subject: [PATCH 3/4] Fix ctest command line argument --- .github/workflows/ut.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ut.yml b/.github/workflows/ut.yml index 8c00940..3459d07 100644 --- a/.github/workflows/ut.yml +++ b/.github/workflows/ut.yml @@ -24,4 +24,4 @@ jobs: - name: Run tests run: | cmake -G Ninja -S tests -B build-tests - ctest --test-dir build-tests + ctest --test-dir build-tests --build-and-test From 940837ddee841629f6b1ce580477fe7c80a9ba8a Mon Sep 17 00:00:00 2001 From: kkitayam <45088311+kkitayam@users.noreply.github.com> Date: Fri, 5 Jan 2024 22:23:57 +0900 Subject: [PATCH 4/4] Fix test script --- .github/workflows/ut.yml | 54 ++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ut.yml b/.github/workflows/ut.yml index 3459d07..3e90b63 100644 --- a/.github/workflows/ut.yml +++ b/.github/workflows/ut.yml @@ -1,27 +1,27 @@ -name: Unit test - -on: - workflow_dispatch: - push: - pull_request: - branches: - - main - paths: - - 'src/**' - - 'tests/**' - - '.github/workflows/ut.yml' -jobs: - class: - runs-on: "ubuntu-22.04" - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - - name: Install gMock and Ninja - run: sudo apt-get install -y libgmock-dev ninja-build - - - name: Run tests - run: | - cmake -G Ninja -S tests -B build-tests - ctest --test-dir build-tests --build-and-test +name: Unit test + +on: + workflow_dispatch: + pull_request: + branches: + - main + paths: + - 'src/**' + - 'tests/**' + - '.github/workflows/ut.yml' +jobs: + class: + runs-on: "ubuntu-22.04" + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - name: Install gMock and Ninja + run: sudo apt-get install -y libgmock-dev ninja-build + + - name: Run tests + run: | + cmake -G Ninja -S tests -B build-tests + cmake --build build-tests + ctest --test-dir build-tests