From 6df7e22e2661838170932ad713a1a42b61a08688 Mon Sep 17 00:00:00 2001 From: Steph Prince <40640337+stephprince@users.noreply.github.com> Date: Mon, 1 Apr 2024 11:12:44 -0700 Subject: [PATCH 01/14] update gh workflows --- .github/workflows/codespell.yml | 21 +++++++++ .github/workflows/lint.yml | 21 +++++++++ .github/workflows/{ci.yml => tests.yml} | 62 ++++++++++++++----------- 3 files changed, 76 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/codespell.yml create mode 100644 .github/workflows/lint.yml rename .github/workflows/{ci.yml => tests.yml} (50%) diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 00000000..2648f684 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,21 @@ +name: Codespell + +on: + push: + branches: + - main + + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Codespell + uses: codespell-project/actions-codespell@v2 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..87149c11 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,21 @@ +name: Linter + +on: + push: + branches: + - main + + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + lint: + name: Run linter + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Lint + run: cmake -D FORMAT_COMMAND=clang-format-14 -P cmake/lint.cmake diff --git a/.github/workflows/ci.yml b/.github/workflows/tests.yml similarity index 50% rename from .github/workflows/ci.yml rename to .github/workflows/tests.yml index 84234a19..4d07d482 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: Continuous Integration +name: Run tests on: push: @@ -11,39 +11,45 @@ on: workflow_dispatch: jobs: - lint: - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-python@v4 - with: { python-version: "3.8" } - - - name: Install codespell - run: pip3 install codespell - - - name: Lint - run: cmake -D FORMAT_COMMAND=clang-format-14 -P cmake/lint.cmake - - - name: Spell check - if: always() - run: cmake -P cmake/spell.cmake - - test: - needs: [lint] - + tests: + defaults: + run: + shell: bash + concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }} + cancel-in-progress: true strategy: + fail-fast: false matrix: - os: [macos-12, ubuntu-22.04, windows-2022] - + os: [macos-latest, ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install dependencies - ubuntu + if: matrix.os == 'ubuntu-latest' + run: >- + sudo apt-get update + sudo apt-get install -y libhdf5-dev + + - name: Install dependencies - macos + if: matrix.os == 'macos-latest' + run: brew install hdf5 + + - name: Install dependencies - windows + if: matrix.os == 'windows-latest' + run: | + git clone https://github.com/Microsoft/vcpkg.git + cd vcpkg + ./bootstrap-vcpkg.bat + ./vcpkg integrate install + ./vcpkg install hdf5 - name: Install static analyzers - if: matrix.os == 'ubuntu-22.04' + if: matrix.os == 'ubuntu-latest' run: >- sudo apt-get install clang-tidy-14 cppcheck -y -q @@ -52,7 +58,7 @@ jobs: /usr/bin/clang-tidy-14 140 - name: Setup MultiToolTask - if: matrix.os == 'windows-2022' + if: matrix.os == 'windows-latest' run: | Add-Content "$env:GITHUB_ENV" 'UseMultiToolTask=true' Add-Content "$env:GITHUB_ENV" 'EnforceProcessCountAcrossBuilds=true' From fdfdc05218b9bcfaddca735cb920e6423790c454 Mon Sep 17 00:00:00 2001 From: Steph Prince <40640337+stephprince@users.noreply.github.com> Date: Mon, 1 Apr 2024 11:23:32 -0700 Subject: [PATCH 02/14] add boost dependency install --- .github/workflows/tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4d07d482..81f75fc3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,13 +31,13 @@ jobs: - name: Install dependencies - ubuntu if: matrix.os == 'ubuntu-latest' - run: >- + run: | sudo apt-get update - sudo apt-get install -y libhdf5-dev + sudo apt-get install -y libhdf5-dev libboost-all-dev - name: Install dependencies - macos if: matrix.os == 'macos-latest' - run: brew install hdf5 + run: brew install hdf5 boost - name: Install dependencies - windows if: matrix.os == 'windows-latest' @@ -46,7 +46,7 @@ jobs: cd vcpkg ./bootstrap-vcpkg.bat ./vcpkg integrate install - ./vcpkg install hdf5 + ./vcpkg install hdf5 boost - name: Install static analyzers if: matrix.os == 'ubuntu-latest' From 31cd1d0578982a1d04d1795b0d3912796921ac11 Mon Sep 17 00:00:00 2001 From: Steph Prince <40640337+stephprince@users.noreply.github.com> Date: Mon, 1 Apr 2024 11:24:02 -0700 Subject: [PATCH 03/14] remove windows multitool task --- .github/workflows/tests.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 81f75fc3..09c3ca9f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -57,12 +57,6 @@ jobs: /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-14 140 - - name: Setup MultiToolTask - if: matrix.os == 'windows-latest' - run: | - Add-Content "$env:GITHUB_ENV" 'UseMultiToolTask=true' - Add-Content "$env:GITHUB_ENV" 'EnforceProcessCountAcrossBuilds=true' - - name: Configure shell: pwsh run: cmake "--preset=ci-$("${{ matrix.os }}".split("-")[0])" From 1236a8e5d5045840f6ada261dff367375f3050dd Mon Sep 17 00:00:00 2001 From: Steph Prince <40640337+stephprince@users.noreply.github.com> Date: Mon, 1 Apr 2024 11:38:15 -0700 Subject: [PATCH 04/14] add catch2 installation --- .github/workflows/tests.yml | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 09c3ca9f..ad28366f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,20 +33,11 @@ jobs: if: matrix.os == 'ubuntu-latest' run: | sudo apt-get update - sudo apt-get install -y libhdf5-dev libboost-all-dev + sudo apt-get install -y libhdf5-dev libboost-all-dev catch2 - name: Install dependencies - macos if: matrix.os == 'macos-latest' - run: brew install hdf5 boost - - - name: Install dependencies - windows - if: matrix.os == 'windows-latest' - run: | - git clone https://github.com/Microsoft/vcpkg.git - cd vcpkg - ./bootstrap-vcpkg.bat - ./vcpkg integrate install - ./vcpkg install hdf5 boost + run: brew install hdf5 boost catch2 - name: Install static analyzers if: matrix.os == 'ubuntu-latest' From a6d110a0b8fe27b538e43c6ec64a55bbf9aba80f Mon Sep 17 00:00:00 2001 From: Steph Prince <40640337+stephprince@users.noreply.github.com> Date: Mon, 1 Apr 2024 11:42:06 -0700 Subject: [PATCH 05/14] add doxygen install --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ad28366f..b63fefcb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,11 +33,11 @@ jobs: if: matrix.os == 'ubuntu-latest' run: | sudo apt-get update - sudo apt-get install -y libhdf5-dev libboost-all-dev catch2 + sudo apt-get install -y libhdf5-dev libboost-all-dev catch2 doxygen - name: Install dependencies - macos if: matrix.os == 'macos-latest' - run: brew install hdf5 boost catch2 + run: brew install hdf5 boost catch2 doxygen - name: Install static analyzers if: matrix.os == 'ubuntu-latest' From 623c4aedae4bc90536edea847c35ee6114b6998a Mon Sep 17 00:00:00 2001 From: Steph Prince <40640337+stephprince@users.noreply.github.com> Date: Mon, 1 Apr 2024 12:03:00 -0700 Subject: [PATCH 06/14] add windows dependency installation --- .github/workflows/tests.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b63fefcb..b0955e1c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,6 +39,15 @@ jobs: if: matrix.os == 'macos-latest' run: brew install hdf5 boost catch2 doxygen + - name: Install dependencies - windows + if: matrix.os == 'windows-latest' + run: | + git clone https://github.com/Microsoft/vcpkg.git + cd vcpkg + ./bootstrap-vcpkg.bat + ./vcpkg integrate install + ./vcpkg install hdf5 boost catch2 doxygen + - name: Install static analyzers if: matrix.os == 'ubuntu-latest' run: >- @@ -47,7 +56,7 @@ jobs: sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-14 140 - + - name: Configure shell: pwsh run: cmake "--preset=ci-$("${{ matrix.os }}".split("-")[0])" From 2ac344d5422bc344e586c197feb377e3539874f5 Mon Sep 17 00:00:00 2001 From: Steph Prince <40640337+stephprince@users.noreply.github.com> Date: Mon, 1 Apr 2024 12:03:47 -0700 Subject: [PATCH 07/14] update clang-tidy install to latest version --- .github/workflows/tests.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b0955e1c..98d5ea8b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -51,12 +51,8 @@ jobs: - name: Install static analyzers if: matrix.os == 'ubuntu-latest' run: >- - sudo apt-get install clang-tidy-14 cppcheck -y -q + sudo apt-get install clang-tidy cppcheck -y -q - sudo update-alternatives --install - /usr/bin/clang-tidy clang-tidy - /usr/bin/clang-tidy-14 140 - - name: Configure shell: pwsh run: cmake "--preset=ci-$("${{ matrix.os }}".split("-")[0])" From eca06f74a218295dee32081475979cbf528f471b Mon Sep 17 00:00:00 2001 From: Steph Prince <40640337+stephprince@users.noreply.github.com> Date: Mon, 1 Apr 2024 13:07:33 -0700 Subject: [PATCH 08/14] add missing include --- src/BaseIO.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/BaseIO.hpp b/src/BaseIO.hpp index e7b0ffb3..5fcaea0a 100644 --- a/src/BaseIO.hpp +++ b/src/BaseIO.hpp @@ -1,6 +1,7 @@ #pragma once #include +#include #define DEFAULT_STR_SIZE 256 #define DEFAULT_ARRAY_SIZE 1 From 821a43ac90b21727cc9d122f69844731c046aa5c Mon Sep 17 00:00:00 2001 From: Steph Prince <40640337+stephprince@users.noreply.github.com> Date: Mon, 1 Apr 2024 13:22:10 -0700 Subject: [PATCH 09/14] include stdint for uint32_t identifier --- src/BaseIO.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/BaseIO.hpp b/src/BaseIO.hpp index 5fcaea0a..2dd6c9d3 100644 --- a/src/BaseIO.hpp +++ b/src/BaseIO.hpp @@ -2,6 +2,7 @@ #include #include +#include #define DEFAULT_STR_SIZE 256 #define DEFAULT_ARRAY_SIZE 1 From ae34de65636c00e1a9aa9f32288380a2b0c1888b Mon Sep 17 00:00:00 2001 From: Steph Prince <40640337+stephprince@users.noreply.github.com> Date: Mon, 1 Apr 2024 13:44:10 -0700 Subject: [PATCH 10/14] remove doxygen req from tests runner --- .github/workflows/tests.yml | 6 +++--- cmake/dev-mode.cmake | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 98d5ea8b..5eefa12d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,11 +33,11 @@ jobs: if: matrix.os == 'ubuntu-latest' run: | sudo apt-get update - sudo apt-get install -y libhdf5-dev libboost-all-dev catch2 doxygen + sudo apt-get install -y libhdf5-dev libboost-all-dev catch2 - name: Install dependencies - macos if: matrix.os == 'macos-latest' - run: brew install hdf5 boost catch2 doxygen + run: brew install hdf5 boost catch2 - name: Install dependencies - windows if: matrix.os == 'windows-latest' @@ -46,7 +46,7 @@ jobs: cd vcpkg ./bootstrap-vcpkg.bat ./vcpkg integrate install - ./vcpkg install hdf5 boost catch2 doxygen + ./vcpkg install hdf5 boost catch2 - name: Install static analyzers if: matrix.os == 'ubuntu-latest' diff --git a/cmake/dev-mode.cmake b/cmake/dev-mode.cmake index aef9c748..39d12651 100644 --- a/cmake/dev-mode.cmake +++ b/cmake/dev-mode.cmake @@ -12,7 +12,7 @@ add_custom_target( ) add_dependencies(run-exe aq-nwb_exe) -option(BUILD_DOCS "Build documentation using Doxygen" ON) +option(BUILD_DOCS "Build documentation using Doxygen" OFF) if(BUILD_DOCS) include(cmake/docs.cmake) endif() From 0615a31e8a6c994d4334e0cc766191f5c23cb039 Mon Sep 17 00:00:00 2001 From: Steph Prince <40640337+stephprince@users.noreply.github.com> Date: Mon, 1 Apr 2024 13:52:16 -0700 Subject: [PATCH 11/14] fix formatting --- src/BaseIO.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BaseIO.hpp b/src/BaseIO.hpp index 2dd6c9d3..31249c23 100644 --- a/src/BaseIO.hpp +++ b/src/BaseIO.hpp @@ -1,8 +1,8 @@ #pragma once +#include #include #include -#include #define DEFAULT_STR_SIZE 256 #define DEFAULT_ARRAY_SIZE 1 From 8629552713764d4168bfdaec4ca990493894edf1 Mon Sep 17 00:00:00 2001 From: Steph Prince <40640337+stephprince@users.noreply.github.com> Date: Mon, 1 Apr 2024 14:46:55 -0700 Subject: [PATCH 12/14] remove clang-tidy check from ubuntu tests --- .github/workflows/tests.yml | 5 ----- CMakePresets.json | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5eefa12d..9394562f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,11 +48,6 @@ jobs: ./vcpkg integrate install ./vcpkg install hdf5 boost catch2 - - name: Install static analyzers - if: matrix.os == 'ubuntu-latest' - run: >- - sudo apt-get install clang-tidy cppcheck -y -q - - name: Configure shell: pwsh run: cmake "--preset=ci-$("${{ matrix.os }}".split("-")[0])" diff --git a/CMakePresets.json b/CMakePresets.json index 5de357f9..dc9249ea 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -144,7 +144,7 @@ }, { "name": "ci-ubuntu", - "inherits": ["ci-build", "ci-linux", "clang-tidy", "cppcheck", "dev-mode"] + "inherits": ["ci-build", "ci-linux", "dev-mode"] }, { "name": "ci-windows", From 72b991f1f42fa6c19d427dcc721f9c65c6550a5d Mon Sep 17 00:00:00 2001 From: Steph Prince <40640337+stephprince@users.noreply.github.com> Date: Mon, 1 Apr 2024 15:21:03 -0700 Subject: [PATCH 13/14] remove windows install from tests --- .github/workflows/tests.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9394562f..e35eb085 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,7 +21,7 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-latest, ubuntu-latest, windows-latest] + os: [macos-latest, ubuntu-latest] runs-on: ${{ matrix.os }} @@ -39,15 +39,6 @@ jobs: if: matrix.os == 'macos-latest' run: brew install hdf5 boost catch2 - - name: Install dependencies - windows - if: matrix.os == 'windows-latest' - run: | - git clone https://github.com/Microsoft/vcpkg.git - cd vcpkg - ./bootstrap-vcpkg.bat - ./vcpkg integrate install - ./vcpkg install hdf5 boost catch2 - - name: Configure shell: pwsh run: cmake "--preset=ci-$("${{ matrix.os }}".split("-")[0])" From de0f770fb114fa3077ee40e97e528a607651175c Mon Sep 17 00:00:00 2001 From: Steph Prince <40640337+stephprince@users.noreply.github.com> Date: Mon, 1 Apr 2024 15:41:45 -0700 Subject: [PATCH 14/14] update ubuntu catch installation --- .github/workflows/tests.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e35eb085..fb2c89bc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,7 +33,12 @@ jobs: if: matrix.os == 'ubuntu-latest' run: | sudo apt-get update - sudo apt-get install -y libhdf5-dev libboost-all-dev catch2 + sudo apt-get install -y libhdf5-dev libboost-all-dev + git clone https://github.com/catchorg/Catch2.git + cd Catch2 + git checkout "v3.5.3" + cmake -Bbuild -H. -DBUILD_TESTING=OFF + sudo cmake --build build/ --target install - name: Install dependencies - macos if: matrix.os == 'macos-latest'