Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pablohoch committed Aug 1, 2023
1 parent a23a3dc commit 7ad1d2c
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 43 deletions.
59 changes: 59 additions & 0 deletions .github/actions/install-llvm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: 'Install LLVM'
description: 'Install LLVM'
inputs:
version:
description: 'LLVM version'
required: false
default: 16
packages:
description: 'Packages to install'
required: false
default: >
clang-16
clang-tools-16
clang-format-16
clang-tidy-16
libc++-16-dev
libc++abi-16-dev
libclang-common-16-dev
libclang-rt-16-dev
libunwind-16-dev
runs:
using: "composite"
steps:
- run: |
sudo apt-get install -qq --no-install-recommends \
apt-transport-https \
ca-certificates \
software-properties-common
wget -nv -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
source /etc/os-release
sudo add-apt-repository "deb http://apt.llvm.org/${VERSION_CODENAME}/ llvm-toolchain-${VERSION_CODENAME}-${{ inputs.version }} main"
sudo apt-get update
shell: bash
env:
DEBIAN_FRONTEND: noninteractive
# workaround for package conflicts
- run: |
sudo apt-get purge --auto-remove \
llvm \
llvm-14 \
python3-lldb-14 \
libc++-dev \
libc++1-14 \
libc++abi-dev \
libc++abi1-14 \
libc++abi-14-dev \
libunwind-14 \
libunwind-14-dev
shell: bash
env:
DEBIAN_FRONTEND: noninteractive
- run: |
sudo apt-get install -y --no-install-recommends \
${{ inputs.packages }}
shell: bash
env:
DEBIAN_FRONTEND: noninteractive
47 changes: 4 additions & 43 deletions .github/workflows/unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,9 @@ jobs:
- uses: actions/checkout@v3

- name: Install clang-format
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
software-properties-common
wget -nv -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main"
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
clang-format-16
uses: ./.github/actions/install-llvm
with:
packages: clang-format-16

- name: Format files
run: find src include -type f -a \( -name "*.cc" -o -name "*.h" \) -print0 | xargs -0 clang-format-16 -i
Expand Down Expand Up @@ -114,37 +105,7 @@ jobs:

- name: Install LLVM
if: matrix.config.os != 'macos-latest' && matrix.config.cc == 'clang-16'
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get install -qq --no-install-recommends \
apt-transport-https \
ca-certificates \
software-properties-common
wget -nv -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main"
sudo apt-get update
sudo apt-get purge --auto-remove \
llvm \
llvm-14 \
python3-lldb-14 \
libc++-dev \
libc++1-14 \
libc++abi-dev \
libc++abi1-14 \
libc++abi-14-dev \
libunwind-14 \
libunwind-14-dev
sudo apt-get install -y --no-install-recommends \
clang-16 \
clang-tools-16 \
clang-format-16 \
clang-tidy-16 \
libc++-16-dev \
libc++abi-16-dev \
libclang-common-16-dev \
libclang-rt-16-dev \
libunwind-16-dev
uses: ./.github/actions/install-llvm

- name: Install ninja (Ubuntu)
if: matrix.config.os != 'macos-latest'
Expand Down

0 comments on commit 7ad1d2c

Please sign in to comment.