Skip to content

Commit

Permalink
* modified gpp and clang forkflows to set both cxx and c compilers co…
Browse files Browse the repository at this point in the history
…rrectly

* modified the install_clang_format_17.sh script to install both
  clang-17 and clang-format-17
* Modified the clang forkflow to use the new
  install_clang_17_toolchain.sh script and use clang-17 to build the
  project
  • Loading branch information
SpectraL519 committed Mar 12, 2024
1 parent 290c2d6 commit b9248b3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/clang.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,20 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Prepare
shell: bash
run: |
sudo bash ./scripts/env/install_clang_format_17_toolchain.sh
continue-on-error: false

- name: Build
shell: bash
env:
CC: clang-14
CXX: clang++-14
CC: clang-17
CXX: clang++-17
run: |
cd example
cmake -B build -DCMAKE_CXX_COMPILER=clang++-14
cmake -B build -DCMAKE_CXX_COMPILER=clang++-17 -DCMAKE_C_COMPILER=clang-17
cd build
make
continue-on-error: false
2 changes: 1 addition & 1 deletion .github/workflows/format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Prepare
shell: bash
run: |
sudo bash ./scripts/env/install_clang_format_17.sh
sudo bash ./scripts/env/install_clang_format_17_toolchain.sh
continue-on-error: false

- name: Test formatting
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gpp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
CXX: g++-11
run: |
cd example
cmake -B build -DCMAKE_CXX_COMPILER=g++-11
cmake -B build -DCMAKE_CXX_COMPILER=g++-11 -DCMAKE_C_COMPILER=gcc-11
cd build
make
continue-on-error: false
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

if command -v clang-format-17 &>/dev/null; then
echo "clang-format-17 is already installed."
if command -v clang-17 &>/dev/null && command -v clang-format-17 &>/dev/null; then
echo "clang-17 toolchain already installed!"
exit 0
fi

Expand All @@ -12,6 +12,6 @@ echo | sudo add-apt-repository "deb http://apt.llvm.org/$(lsb_release -sc)/ llvm
echo "Updating package list"
sudo apt update &>/dev/null 2>&1

echo "Installing clang-format-17"
sudo apt install clang-format-17 -y &>/dev/null 2>&1
echo "Installing clang-17 toolchain"
sudo apt install clang-17 clang-format-17 -y &>/dev/null 2>&1
echo "Success!"

0 comments on commit b9248b3

Please sign in to comment.