Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run LLVM install script on Linux runners #146

Merged
merged 6 commits into from
May 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 11 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,23 @@ runs:
run: |
if [[ "${{runner.os}}" == "Linux" ]]; then
sudo apt-get update
sudo apt-get install clang-format-${{ inputs.version }} clang-tidy-${{ inputs.version }} || true
# First try installing from default Ubuntu repositories before trying LLVM script
if ! sudo apt-get install clang-format-${{ inputs.version }} clang-tidy-${{ inputs.version }}; then
# This LLVM script will add the relevant LLVM PPA: https://apt.llvm.org/
wget https://apt.llvm.org/llvm.sh -O $GITHUB_ACTION_PATH/llvm_install.sh
chmod +x $GITHUB_ACTION_PATH/llvm_install.sh
if sudo $GITHUB_ACTION_PATH/llvm_install.sh ${{ inputs.version }}; then
sudo apt-get install clang-format-${{ inputs.version }} clang-tidy-${{ inputs.version }}
fi
fi
fi
if [[ "${{runner.os}}" == "macOS" ]];then
if [[ "${{runner.os}}" == "macOS" ]]; then
python3 -m venv '${{ github.action_path }}/venv'
source '${{ github.action_path }}/venv/bin/activate'
fi
python3 -m pip install -r '${{ github.action_path }}/requirements.txt'
clang-tools -i ${{ inputs.version }} -b

- name: Run cpp-linter
id: cpp-linter
shell: bash
Expand Down