Skip to content

Commit

Permalink
Merge branch 'main' into feature/add-support-to-resolve-mac-address
Browse files Browse the repository at this point in the history
  • Loading branch information
cassio-lazaro authored Jan 13, 2025
2 parents 7e513fb + 758529a commit 7de7bb7
Show file tree
Hide file tree
Showing 18 changed files with 86 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM ghcr.io/philips-software/amp-devcontainer-cpp:v5.5.1@sha256:d4c3ac71b832a967d5de37fa115679fc1c9f22313deac2d2bf8d8f575be85062
FROM ghcr.io/philips-software/amp-devcontainer-cpp:v5.5.4@sha256:b572465f19d9f6c638bde27df34948ce7a88dcfbf2e83f1db796062520a5485c

HEALTHCHECK NONE
35 changes: 27 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,21 @@ jobs:
- uses: hendrikmuhs/ccache-action@ed74d11c0b343532753ecead8a951bb09bb34bc9 # v1.2.14
with:
key: ${{ github.job }}-ubuntu-latest
variant: sccache
- uses: seanmiddleditch/gha-setup-ninja@96bed6edff20d1dd61ecff9b75cc519d516e6401 # v5
- uses: lukka/run-cmake@af1be47fd7c933593f687731bc6fdbee024d3ff4 # v10.8
with:
configurePreset: "host"
buildPreset: "host-Debug-WithPackage"
testPreset: "host"
configurePresetAdditionalArgs: "['-DCMAKE_C_COMPILER_LAUNCHER=sccache', '-DCMAKE_CXX_COMPILER_LAUNCHER=sccache']"
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
configurePresetAdditionalArgs: "['-DCMAKE_C_COMPILER_LAUNCHER=ccache', '-DCMAKE_CXX_COMPILER_LAUNCHER=ccache']"
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: hal_st
path: build/host/hal_st-*-Linux.tar.gz
if-no-files-found: error
- name: Upload test logs
if: ${{ failure() }}
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: test-logs
path: build/host/Testing/Temporary/
Expand All @@ -53,19 +52,39 @@ jobs:
- uses: hendrikmuhs/ccache-action@ed74d11c0b343532753ecead8a951bb09bb34bc9 # v1.2.14
with:
key: ${{ github.job }}-${{ matrix.os }}
variant: sccache
- uses: lukka/run-cmake@af1be47fd7c933593f687731bc6fdbee024d3ff4 # v10.8
with:
configurePreset: "host-single-Debug"
buildPreset: "host-single-Debug"
testPreset: "host-single-Debug"
configurePresetAdditionalArgs: "['-DCMAKE_C_COMPILER_LAUNCHER=sccache', '-DCMAKE_CXX_COMPILER_LAUNCHER=sccache']"
configurePresetAdditionalArgs: "['-DCMAKE_C_COMPILER_LAUNCHER=ccache', '-DCMAKE_CXX_COMPILER_LAUNCHER=ccache']"
- name: Upload test logs
if: ${{ failure() }}
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: test-logs
path: build/host/Testing/Temporary/
host_build_clang_msvc:
name: Windows Host Build from Devcontainer
runs-on: [ubuntu-latest]
container: ghcr.io/philips-software/amp-devcontainer-cpp:5.2.0@sha256:c47fcc83b59fb08f3a3a6e591b18bad49b3862acc35770fca6cec9ad0adb9cb2 # v5.2.0
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
id: cache-winsdk
with:
path: /winsdk
key: cache-winsdk
- if: ${{ steps.cache-winsdk.outputs.cache-hit != 'true' }}
run: xwin --accept-license --manifest-version 17 splat --preserve-ms-arch-notation --include-debug-libs && mv .xwin-cache/splat/ /winsdk
- uses: hendrikmuhs/ccache-action@ed74d11c0b343532753ecead8a951bb09bb34bc9 # v1.2.14
with:
key: ${{ github.job }}
- uses: lukka/run-cmake@af1be47fd7c933593f687731bc6fdbee024d3ff4 # v10.8
with:
configurePreset: "Windows"
buildPreset: "Windows-Release"
configurePresetAdditionalArgs: "['-DCMAKE_C_COMPILER_LAUNCHER=ccache', '-DCMAKE_CXX_COMPILER_LAUNCHER=ccache']"
embedded_build:
name: Embedded Build
runs-on: ubuntu-latest
Expand Down Expand Up @@ -99,7 +118,7 @@ jobs:
with:
persist-credentials: false
- name: Install GNU Arm Embedded Toolchain ${{ matrix.gcc }}
uses: carlosperate/arm-none-eabi-gcc-action@0cc83a7330501be1848887e2966aaceb49a4bb12 # v1.9.1
uses: carlosperate/arm-none-eabi-gcc-action@f3be82dce0d93e59bb84bbc1ad67c74068e35507 # v1.10.0
with:
release: ${{ matrix.gcc }}
- run: sudo apt-get update && sudo apt-get install ninja-build xsltproc
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/linting-formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ jobs:
VALIDATE_ALL_CODEBASE: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: git diff
- uses: github/codeql-action/upload-sarif@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6
- uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
if: ${{ success() || failure() }}
with:
sarif_file: megalinter-reports/megalinter-report.sarif
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
if: ${{ success() || failure() }}
with:
name: linter
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
name: Create Release
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
- uses: actions/create-github-app-token@c1a285145b9d317df6ced56c09f525b5c2b6f755 # v1.11.1
id: token
with:
app-id: ${{ vars.FOREST_RELEASER_APP_ID }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ jobs:
results_format: sarif
repo_token: ${{ secrets.SCORECARD_READ_TOKEN }}
publish_results: true
- uses: github/codeql-action/upload-sarif@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6
- uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
with:
sarif_file: scorecards.sarif
6 changes: 5 additions & 1 deletion .github/workflows/social-interaction.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
---
name: Social Interaction

on: [pull_request, issues]
on:
pull_request:
types: [opened]
issues:
types: [opened]

permissions:
contents: read
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-emil-git-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ jobs:
sed -i 's/${{ steps.pull_head.outputs.current_hash }}/${{ steps.pull_head.outputs.latest_hash }}/g' CMakeLists.txt
rm -rf ninja-build
- uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
- uses: actions/create-github-app-token@c1a285145b9d317df6ced56c09f525b5c2b6f755 # v1.11.1
id: token
with:
app-id: ${{ vars.FOREST_RELEASER_APP_ID }}
private-key: ${{ secrets.FOREST_RELEASER_APP_PRIVATE_KEY }}

- uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
- uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6
if: ${{ steps.pull_head.outputs.current_hash != steps.pull_head.outputs.latest_hash }}
with:
token: ${{ steps.token.outputs.token }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.cache
.vs/
.vscode/.cortex-debug*
.xwin-cache
build/
out/
megalinter-reports/
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if (HALST_STANDALONE)
FetchContent_Declare(
cucumber-cpp-runner
GIT_REPOSITORY https://github.com/philips-software/amp-cucumber-cpp-runner.git
GIT_TAG 70c424e53f532f520d96a303b6586272d3efc5f5 # unreleased
GIT_TAG 08d653fe47d31d7e070195f7536d4f32e03180e6 # unreleased
)

FetchContent_MakeAvailable(cucumber-cpp-runner)
Expand Down
22 changes: 21 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,22 @@
{
"name": "stm32h573",
"inherits": "stm32",
"toolchainFile": "${sourceDir}/build/${presetName}/_deps/emil-src/cmake//toolchain-arm-gcc-m33-fpv5-sp-d16.cmake",
"toolchainFile": "${sourceDir}/build/${presetName}/_deps/emil-src/cmake/toolchain-arm-gcc-m33-fpv5-sp-d16.cmake",
"cacheVariables": {
"TARGET_CORTEX": "m33",
"TARGET_MCU_FAMILY": "stm32h5xx",
"TARGET_MCU": "stm32h573"
}
},
{
"name": "Windows",
"inherits": "defaults",
"toolchainFile": "${sourceDir}/build/${presetName}/_deps/emil-src/cmake/toolchain-clang-x86_64-pc-windows-msvc.cmake",
"environment": {
"CCACHE_DEPEND": "true",
"CCACHE_COMPILERTYPE": "clang-cl"
},
"generator": "Ninja Multi-Config"
}
],
"buildPresets": [
Expand Down Expand Up @@ -292,6 +302,16 @@
"name": "stm32h573-MinSizeRel",
"configuration": "MinSizeRel",
"configurePreset": "stm32h573"
},
{
"name": "Windows-Release",
"configuration": "Release",
"configurePreset": "Windows"
},
{
"name": "Windows-RelWithDebInfo",
"configuration": "RelWithDebInfo",
"configurePreset": "Windows"
}
],
"testPresets": [
Expand Down
9 changes: 4 additions & 5 deletions hal_st/stm32fxxx/DigitalToAnalogPinStm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ namespace hal
public:
#if defined(DAC_CHIPCONNECT_BOTH)
// clang-format off
static const struct Internal{} internal;
static const struct External{} external;
static const struct Both{} both;

static constexpr struct Internal{} internal{};
static constexpr struct External{} external{};
static constexpr struct Both{} both{};
// clang-format on

enum struct Channel : uint32_t
Expand Down Expand Up @@ -66,7 +65,7 @@ namespace hal
friend class DigitalToAnalogPinImplStm;

uint8_t index;
DAC_HandleTypeDef handle;
DAC_HandleTypeDef handle{};
};
}

Expand Down
2 changes: 1 addition & 1 deletion integration_test/runner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ target_sources(integration_test.runner PRIVATE

target_link_libraries(integration_test.runner PRIVATE
args
cucumber-cpp
cucumber_cpp.library
integration_test.logic
hal.generic
gtest
Expand Down
2 changes: 1 addition & 1 deletion integration_test/runner/Hooks.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "cucumber-cpp/Hooks.hpp"
#include "cucumber_cpp/library/Hooks.hpp"
#include "generated/echo/Testing.pb.hpp"
#include "hal/generic/TimerServiceGeneric.hpp"
#include "infra/timer/Waiting.hpp"
Expand Down
5 changes: 3 additions & 2 deletions integration_test/runner/Main.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#include "cucumber-cpp/Application.hpp"

#include "cucumber_cpp/library/Application.hpp"

int main(int argc, char** argv)
{
cucumber_cpp::Application application{};
cucumber_cpp::library::Application application{};

application.CliParser().add_option("--target", *application.ProgramContext().EmplaceAt<std::string>("target"), "COM port or hostname (ws://<host>/path or tcp://<host>) of the amp-hal-st integration test board")->required();

Expand Down
2 changes: 1 addition & 1 deletion integration_test/runner/StepsGpio.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "cucumber-cpp/Steps.hpp"
#include "cucumber_cpp/library/Steps.hpp"
#include "generated/echo/Testing.pb.hpp"
#include "infra/timer/Waiting.hpp"
#include "integration_test/logic/Tested.hpp"
Expand Down
2 changes: 1 addition & 1 deletion integration_test/runner/StepsUart.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "cucumber-cpp/Steps.hpp"
#include "cucumber_cpp/library/Steps.hpp"
#include "generated/echo/Testing.pb.hpp"
#include "infra/timer/Waiting.hpp"
#include "integration_test/logic/Tested.hpp"
Expand Down
10 changes: 5 additions & 5 deletions integration_test/runner/Waiting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace infra
{
bool WaitUntilDone(cucumber_cpp::Context& context, const std::function<void(const std::function<void()>&)>& action, infra::Duration timeout)
bool WaitUntilDone(cucumber_cpp::library::Context& context, const std::function<void(const std::function<void()>&)>& action, infra::Duration timeout)
{
bool done{ false };
bool timedOut{ false };
Expand All @@ -29,7 +29,7 @@ namespace infra
return !timedOut;
}

bool WaitFor(cucumber_cpp::Context& context, const std::function<bool()>& pred, infra::Duration timeout)
bool WaitFor(cucumber_cpp::library::Context& context, const std::function<bool()>& pred, infra::Duration timeout)
{
bool timedOut{ false };

Expand All @@ -46,7 +46,7 @@ namespace infra
return !timedOut;
}

void WaitFor(cucumber_cpp::Context& context, infra::Duration timeout)
void WaitFor(cucumber_cpp::library::Context& context, infra::Duration timeout)
{
bool done{ false };

Expand All @@ -61,14 +61,14 @@ namespace infra
});
}

Async::Async(cucumber_cpp::Context& context)
Async::Async(cucumber_cpp::library::Context& context)
: Async{ context, [this]()
{
return notified;
} }
{}

Async::Async(cucumber_cpp::Context& context, std::function<bool()> func)
Async::Async(cucumber_cpp::library::Context& context, std::function<bool()> func)
: context{ context }
, func{ std::move(func) }
{}
Expand Down
16 changes: 8 additions & 8 deletions integration_test/runner/Waiting.hpp
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#ifndef INTEGRATION_TEST_WAITING_HPP
#define INTEGRATION_TEST_WAITING_HPP

#include "cucumber-cpp/Context.hpp"
#include "cucumber_cpp/library/Context.hpp"
#include "infra/timer/Timer.hpp"

namespace infra
{
constexpr inline infra::Duration defaultTimeout{ std::chrono::seconds{ 1 } };

bool WaitUntilDone(cucumber_cpp::Context& context, const std::function<void(const std::function<void()>&)>& action, infra::Duration timeout = defaultTimeout);
bool WaitFor(cucumber_cpp::Context& context, const std::function<bool()>& pred, infra::Duration timeout = defaultTimeout);
void WaitFor(cucumber_cpp::Context& context, infra::Duration timeout);
bool WaitUntilDone(cucumber_cpp::library::Context& context, const std::function<void(const std::function<void()>&)>& action, infra::Duration timeout = defaultTimeout);
bool WaitFor(cucumber_cpp::library::Context& context, const std::function<bool()>& pred, infra::Duration timeout = defaultTimeout);
void WaitFor(cucumber_cpp::library::Context& context, infra::Duration timeout);

template<class Obj, class T, class... Arg, class Proj = std::identity>
bool WaitForValue(cucumber_cpp::Context& context, const Obj& obj, const T& value, Proj proj = {}, Arg&&... args, infra::Duration timeout = defaultTimeout)
bool WaitForValue(cucumber_cpp::library::Context& context, const Obj& obj, const T& value, Proj proj = {}, Arg&&... args, infra::Duration timeout = defaultTimeout)
{
return WaitFor(
context, [&proj, &obj, &args..., &value]()
Expand All @@ -25,8 +25,8 @@ namespace infra

struct Async
{
explicit Async(cucumber_cpp::Context& context);
Async(cucumber_cpp::Context& context, std::function<bool()> func);
explicit Async(cucumber_cpp::library::Context& context);
Async(cucumber_cpp::library::Context& context, std::function<bool()> func);

operator infra::Function<void()>();

Expand All @@ -35,7 +35,7 @@ namespace infra
[[nodiscard]] bool Wait(infra::Duration timeout = defaultTimeout) const;

private:
cucumber_cpp::Context& context;
cucumber_cpp::library::Context& context;
std::function<bool()> func;
bool notified{ false };
};
Expand Down

0 comments on commit 7de7bb7

Please sign in to comment.