How to configure clang-format version in a ubuntu-22.04 and 24.04 runners? #10640
-
Hello, I've found the following links and expected to find an env var or overwrite the
Any tips how to achieve this? cc @Molter73 |
Beta Was this translation helpful? Give feedback.
Answered by
erik-bershel
Sep 18, 2024
Replies: 1 comment 1 reply
-
Hey @SimonBaeumer! Different versions of One of the possible solutions: jobs:
test:
strategy:
matrix:
os: [ ubuntu-22.04, ubuntu-24.04 ]
runs-on: ${{ matrix.os }}
steps:
- name: apt list
run: |
# Extract clang-format versions and store in an array
clang_formats=$(apt list --installed 2>/dev/null | grep clang-format | awk -F/ '{print $1}')
# Loop through each version and run --version
for clangFormat in $clang_formats; do
$clangFormat --version
done Another option: jobs:
test:
strategy:
matrix:
include:
- os: ubuntu-22.04
version: "13"
- os: ubuntu-22.04
version: "14"
- os: ubuntu-22.04
version: "15"
- os: ubuntu-24.04
version: "16"
- os: ubuntu-24.04
version: "17"
- os: ubuntu-24.04
version: "18"
runs-on: ${{ matrix.os }}
steps:
- name: clang-format-${{ matrix.version }}
run: |
clang-format-${{ matrix.version }} --version |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
erik-bershel
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @SimonBaeumer!
Different versions of
clang
and it's tools available viaclang-{tool}-{major_version}
One of the possible solutions:
Another option: