x86-Ubuntu #1680
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: x86-Ubuntu | |
on: | |
push: | |
pull_request: | |
branches: [ main ] | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
compiler: | |
- { compiler: GNU, CC: gcc-10, CXX: g++-10 } | |
- { compiler: LLVM, CC: clang-10, CXX: clang++-10 } | |
type: [Debug, Release] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Dependencies | |
run: | | |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | |
sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-18 main" | |
sudo apt-get update | |
sudo apt-get install -y llvm-18 llvm-18-dev libllvm18 clang-18 libclang-common-18-dev libclang-18-dev llvm-18-tools | |
sudo apt-get install python3-setuptools | |
sudo apt-get install ${{ matrix.compiler.CXX }} | |
sudo pip3 install lit | |
- name: Build HelloWorld | |
env: | |
CC: ${{ matrix.compiler.CC }} | |
CXX: ${{ matrix.compiler.CXX }} | |
run: | | |
cd HelloWorld | |
mkdir build && cd build | |
# HelloWorld only supports CT_Clang_INSTALL_DIR | |
cmake -DCT_Clang_INSTALL_DIR=/usr/lib/llvm-18/ -DCMAKE_BUILD_TYPE=${{ matrix.type }} ../ | |
make -j2 | |
/usr/lib/llvm-18/bin/clang -cc1 -load ./libHelloWorld.so -plugin hello-world $GITHUB_WORKSPACE/test/HelloWorld-basic.cpp | |
- name: Build clang-tutor + run tests | |
env: | |
CC: ${{ matrix.compiler.CC }} | |
CXX: ${{ matrix.compiler.CXX }} | |
run: | | |
cd $GITHUB_WORKSPACE | |
mkdir build && cd build | |
# Test with Clang_ROOT | |
cmake -DClang_ROOT=/usr/lib/llvm-18/lib/cmake/clang/ -DCMAKE_BUILD_TYPE=${{ matrix.type }} ../ | |
make -j2 | |
lit test/ |