Skip to content

How to configure clang-format version in a ubuntu-22.04 and 24.04 runners? #10640

Discussion options

You must be logged in to vote

Hey @SimonBaeumer!

Different versions of clang and it's tools available via clang-{tool}-{major_version}

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:…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@SimonBaeumer
Comment options

Answer selected by erik-bershel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants