Skip to content

LLVM version support #4

LLVM version support

LLVM version support #4

Workflow file for this run

name: IRPrinter-CI
on:
push:
branches: [ master, devel ]
pull_request:
env:
CXX: clang++
CC: clang
jobs:
format-check:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Format source code
run: |
find demo lib test \
-type f \
-a \( -name "*.c" -o -name "*.cpp" -o -name "*.h" \) \
-print0 \
| xargs -0 clang-format-14 -i
- name: Format check
run: |
git status --porcelain --untracked-files=no
git status --porcelain --untracked-files=no | xargs -o -I {} test -z \"{}\"
codespell:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: codespell-project/actions-codespell@v2
build-project:
strategy:
fail-fast: false
matrix:
include:
- llvm-version: 12
os: ubuntu-20.04
preset: develop
- llvm-version: 14
os: ubuntu-22.04
preset: develop
- llvm-version: 18
os: ubuntu-24.04
preset: develop
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Update apt
run: sudo apt-get update
- name: Install LLVM
run: sudo apt-get install libllvm${{ matrix.llvm-version }} llvm-${{ matrix.llvm-version }} llvm-${{ matrix.llvm-version }}-dev
- name: Install Clang
run: sudo apt-get install clang-${{ matrix.llvm-version }} clang-tidy-${{ matrix.llvm-version }} clang-tools-${{ matrix.llvm-version }} libclang-${{ matrix.llvm-version }}-dev libclang-cpp${{ matrix.llvm-version }}-dev libedit-dev
- name: Setup env
run: |
sudo ln -f -s /usr/bin/clang-${{ matrix.llvm-version }} /usr/bin/clang
sudo ln -f -s /usr/bin/clang++-${{ matrix.llvm-version }} /usr/bin/clang++
echo "LLVM_CMAKE_DIR=/usr/lib/llvm-${{ matrix.llvm-version }}/cmake" >> $GITHUB_ENV
echo "CLANG_CMAKE_DIR=/usr/lib/llvm-${{ matrix.llvm-version }}/lib/cmake/clang" >> $GITHUB_ENV
echo "EXTERNAL_LIT=/usr/lib/llvm-${{ matrix.llvm-version }}/build/utils/lit/lit.py" >> $GITHUB_ENV
- name: Build IRPrinter
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Debug -DLLVM_DIR=${LLVM_CMAKE_DIR} -DClang_DIR=${CLANG_CMAKE_DIR}
cmake --build build --parallel
- name: Build IRPrinter release
run: |
cmake -B build_rel -DCMAKE_BUILD_TYPE=Release -DLLVM_DIR=${LLVM_CMAKE_DIR} -DClang_DIR=${CLANG_CMAKE_DIR}
cmake --build build_rel --parallel --target install