Skip to content

Commit

Permalink
[eclipse-iceoryx#264] Install clang-format and clang-tidy 18
Browse files Browse the repository at this point in the history
  • Loading branch information
elfenpiff committed Jul 12, 2024
1 parent 7408ceb commit acfa4f2
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
19 changes: 19 additions & 0 deletions .github/actions/install-iceoryx-deps-and-clang/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Install iceoryx dependencies and clang-tidy'
runs:
using: "composite"
steps:
- name: Install iceoryx dependencies and clang-tidy
shell: bash
run: |
sudo wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-18 main"
sudo apt-get update
sudo apt-get install -y clang-format-18 clang-tidy-18 clang-tools-18 clang-18 lld
sudo rm /usr/bin/clang
sudo rm /usr/bin/clang++
sudo rm /usr/bin/clang-tidy
sudo rm /usr/bin/clang-format
sudo ln -s /usr/bin/clang-18 /usr/bin/clang
sudo ln -s /usr/bin/clang++-18 /usr/bin/clang++
sudo ln -s /usr/bin/clang-tidy-18 /usr/bin/clang-tidy
sudo ln -s /usr/bin/clang-format-18 /usr/bin/clang-format
3 changes: 3 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install clang-tidy and clang-format
uses: ./.github/actions/install-iceoryx-deps-and-clang

- name: clang-format and clang-tidy versions
run: |
clang-format --version
Expand Down
2 changes: 1 addition & 1 deletion examples/cxx/publish_subscribe/src/transmission_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct TransmissionData {
double funky;
};

inline auto operator<<(std::ostream& stream, const TransmissionData& value) -> std::ostream& {
inline auto operator<<(std::ostream& stream, const TransmissionData& value) -> std::ostream& {
std::cout << "TransmissionData { x: " << value.x << ", y: " << value.y << ", funky: " << value.funky << "}";
return stream;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct CustomHeader {
uint64_t timestamp;
};

inline auto operator<<(std::ostream& stream, const CustomHeader& value) -> std::ostream& {
inline auto operator<<(std::ostream& stream, const CustomHeader& value) -> std::ostream& {
std::cout << "CustomHeader { version: " << value.version << ", timestamp: " << value.timestamp << "}";
return stream;
}
Expand Down

0 comments on commit acfa4f2

Please sign in to comment.