Skip to content

Update nuclear subtree #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nuclearnet.js",
"version": "1.7.1",
"version": "1.7.2",
"description": "Node.js module for interacting with the NUClear network",
"main": "index.js",
"types": "index.d.ts",
Expand Down
12 changes: 7 additions & 5 deletions src/nuclear/.clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Checks: >
clang-diagnostic-*,
clang-analyzer-*,
cppcoreguidelines-*,
-cppcoreguidelines-avoid-const-or-ref-data-members,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-owning-memory,
Expand All @@ -26,7 +27,9 @@ Checks: >
-misc-non-private-member-variables-in-classes,
-misc-no-recursion,
performance-*,
-performance-avoid-endl,
readability-*,
-readability-avoid-nested-conditional-operator,
-readability-function-cognitive-complexity,
-readability-function-size,
-readability-identifier-length,
Expand All @@ -37,7 +40,6 @@ Checks: >
-modernize-use-emplace
WarningsAsErrors: ""
HeaderFilterRegex: ".*"
AnalyzeTemporaryDtors: false
FormatStyle: file
CheckOptions:
- key: cppcoreguidelines-avoid-magic-numbers.IgnoredFloatingPointValues
Expand All @@ -49,9 +51,9 @@ CheckOptions:
- key: readability-magic-numbers.IgnoredIntegerValues
value: "1;2;3;4;"
- key: llvm-namespace-comment.ShortNamespaceLines
value: '1'
value: "1"
- key: llvm-namespace-comment.SpacesBeforeComments
value: '2'
value: "2"
- key: misc-move-constructor-init.IncludeStyle
value: google
- key: modernize-loop-convert.NamingStyle
Expand All @@ -61,10 +63,10 @@ CheckOptions:
- key: modernize-replace-auto-ptr.IncludeStyle
value: google
- key: performance-for-range-copy.WarnOnAllAutoCopies
value: '1'
value: "1"
- key: performance-type-promotion-in-math-fn.IncludeStyle
value: google
- key: performance-unnecessary-value-param.IncludeStyle
value: google
- key: readability-braces-around-statements.ShortStatementLines
value: '1'
value: "1"
5 changes: 1 addition & 4 deletions src/nuclear/.cmake-format.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
with section("parse"):

# Specify structure for custom cmake functions
additional_commands = {
"HeaderLibrary": {"kwargs": {"NAME": "*", "HEADER": "*", "PATH_SUFFIX": "*", "URL": "*"}},
}
additional_commands = {}

# Specify variable tags.
vartags = []
Expand Down Expand Up @@ -213,6 +211,5 @@
# A dictionary containing any per-command configuration overrides. Currently
# only `command_case` is supported.
per_command = {
"HeaderLibrary": {"command_case": "unchanged"},
"ToolchainLibraryFinder": {"command_case": "unchanged"},
}
24 changes: 14 additions & 10 deletions src/nuclear/.github/workflows/gcc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ jobs:
version: "8"
- container: ubuntu:20.04
version: "7"
- container: ubuntu:18.04
version: "6"
- container: ubuntu:18.04
version: "5"

name: Linux GCC-${{ matrix.toolchain.version }}
runs-on: ubuntu-latest
Expand All @@ -48,12 +44,12 @@ jobs:

steps:
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4

# Update for all the actions that need to install stuff
- run: |
apt-get update
apt-get install -y software-properties-common
apt-get install -y software-properties-common unzip

- name: Install GCC
run: |
Expand Down Expand Up @@ -95,7 +91,15 @@ jobs:
run: ccache --show-stats

- name: Test
timeout-minutes: 10
run: |
build/tests/test_nuclear
for f in build/tests/individual/*; do echo "Testing $f"; ./$f; done
timeout-minutes: 2
working-directory: build/tests
run: ctest --output-on-failure -E "dsl/UDP"

- name: Upload Traces
if: always()
uses: actions/upload-artifact@v4
with:
name: traces-gcc-${{ matrix.toolchain.version }}
path: build/tests/**/*.trace
retention-days: 1 # This sets the artifact TTL to 1 day (minimum is 1 day)
overwrite: true
38 changes: 34 additions & 4 deletions src/nuclear/.github/workflows/linting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

steps:
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install clang-tidy-15
run: |
Expand All @@ -48,6 +48,34 @@ jobs:
key: ${{ github.job }}
max-size: 100M

# Install ctcache
- name: Install ctcache
shell: bash
run: |
CTCACHE_REF=debfea68152c5221d8f409cbef85dc5d0f98071d
curl --location https://raw.githubusercontent.com/matus-chochlik/ctcache/${CTCACHE_REF}/clang-tidy-cache | sudo tee /usr/local/bin/clang-tidy-cache > /dev/null

echo #!/bin/bash | sudo tee /usr/local/bin/clang-tidy > /dev/null
echo /usr/local/bin/clang-tidy-cache '"${CTCACHE_CLANG_TIDY}"' '"$@"' | sudo tee -a /usr/local/bin/clang-tidy > /dev/null

sudo chmod +x /usr/local/bin/clang-tidy-cache /usr/local/bin/clang-tidy

mkdir -p ${{ github.workspace }}/.ctcache

echo CTCACHE_CLANG_TIDY='/usr/bin/clang-tidy-15' >> "$GITHUB_ENV"
echo CTCACHE_LOCAL=1 >> "$GITHUB_ENV"
echo CTCACHE_SAVE_OUTPUT=1 >> "$GITHUB_ENV"
echo CTCACHE_DIR='${{github.workspace}}/.ctcache' >> "$GITHUB_ENV"
echo "CTCACHE_NOW=$(date -u +"%Y-%m-%dT%H:%M:%S.%3NZ")" >> $GITHUB_ENV

- name: Setup caching for ctcache
uses: actions/cache@v4
with:
key: ctcache-${{ github.workflow }}-${{ github.job }}-${{ env.CTCACHE_NOW }}
path: ${{ env.CTCACHE_DIR }}
restore-keys: ctcache-${{ github.workflow }}-${{ github.job }}-
save-always: true

- name: Configure CMake
run: |
cmake -E make_directory build
Expand All @@ -56,14 +84,16 @@ jobs:
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DBUILD_TESTS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_BUILD_TYPE=Debug \
-DCI_BUILD=ON \
-DENABLE_CLANG_TIDY=ON

- name: Build
timeout-minutes: 30
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build build --config Release --parallel 2
run: cmake --build build --config Debug --parallel 2

- name: CCache Stats
run: ccache --show-stats

- name: CTCache Stats
run: clang-tidy-cache --show-stats
20 changes: 15 additions & 5 deletions src/nuclear/.github/workflows/macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

steps:
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup CCache
uses: hendrikmuhs/ccache-action@v1.2
Expand All @@ -38,6 +38,8 @@ jobs:
ninjaVersion: 1.11.1

- name: Configure CMake
env:
CXXFLAGS: -DNUCLEAR_TEST_TIME_UNIT_DEN=10
run: |
cmake -E make_directory build
cmake -S . -B build \
Expand All @@ -57,7 +59,15 @@ jobs:
run: ccache --show-stats

- name: Test
timeout-minutes: 10
run: |
build/tests/test_nuclear
for f in build/tests/individual/*; do echo "Testing $f"; ./$f; done
timeout-minutes: 5
working-directory: build/tests
run: ctest --output-on-failure

- name: Upload Traces
if: always()
uses: actions/upload-artifact@v4
with:
name: traces-macos
path: build/tests/**/*.trace
retention-days: 1 # This sets the artifact TTL to 1 day (minimum is 1 day)
overwrite: true
30 changes: 20 additions & 10 deletions src/nuclear/.github/workflows/sonarcloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ jobs:
env:
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Install gcovr
run: pip install gcovr==6.0
run: pip install gcovr==7.2

- name: Install sonar-scanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@v2
uses: SonarSource/sonarcloud-github-c-cpp@v3

- name: Install CMake
uses: lukka/get-cmake@latest
Expand All @@ -57,24 +57,34 @@ jobs:
-DCI_BUILD=ON \
-DENABLE_CLANG_TIDY=OFF

- name: Build with Sonar Wrapper
- name: Build the code in debug mode
timeout-minutes: 30
run: build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build/ --config Debug
run: cmake --build build/ --config Debug

- name: Run tests to generate coverage statistics
timeout-minutes: 10
run: |
build/tests/test_nuclear
for f in build/tests/individual/*; do echo "Testing $f"; ./$f; done
working-directory: build/tests
run: ctest --output-on-failure

- name: Collect coverage into one XML report
run: gcovr --exclude-unreachable-branches --exclude-noncode-lines --sonarqube > coverage.xml
if: always()
run: gcovr --gcov-ignore-parse-errors=negative_hits.warn_once_per_file --exclude-unreachable-branches --exclude-noncode-lines --sonarqube > coverage.xml

- name: Run sonar-scanner
if: always()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner \
--define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" \
--define sonar.cfamily.compile-commands=build/compile_commands.json \
--define sonar.coverageReportPaths=coverage.xml

- name: Upload Traces
if: always()
uses: actions/upload-artifact@v4
with:
name: traces-sonar
path: build/tests/**/*.trace
retention-days: 1 # This sets the artifact TTL to 1 day (minimum is 1 day)
overwrite: true
21 changes: 15 additions & 6 deletions src/nuclear/.github/workflows/windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:

steps:
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup CCache
uses: hendrikmuhs/ccache-action@v1.2
Expand All @@ -56,6 +56,8 @@ jobs:
uses: ilammy/msvc-dev-cmd@v1

- name: Configure CMake
env:
CXXFLAGS: -DNUCLEAR_TEST_TIME_UNIT_DEN=10
shell: cmd
run: |
cmake -E make_directory build
Expand All @@ -78,8 +80,15 @@ jobs:
run: sccache --show-stats

- name: Test
timeout-minutes: 10
shell: bash
run: |
build/tests/test_nuclear.exe
for f in build/tests/individual/*; do echo "Testing $f"; ./$f; done
timeout-minutes: 5
working-directory: build/tests
run: ctest --output-on-failure

- name: Upload Traces
if: always()
uses: actions/upload-artifact@v4
with:
name: traces-windows-${{ matrix.toolchain.name }}
path: build/tests/**/*.trace
retention-days: 1 # This sets the artifact TTL to 1 day (minimum is 1 day)
overwrite: true
Loading
Loading