changes how install_prerequisites.py
is tested
#36
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: Test new_cxx_project | |
on: | |
push: | |
pull_request: | |
workflow_run: | |
workflows: [CMake] | |
types: | |
- completed | |
jobs: | |
build: | |
name: ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-24.04] | |
env: | |
LLVM_VERSION: 19 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
repository: cjdb/new_cxx_project.git | |
ref: main | |
submodules: recursive | |
- name: Install tools | |
id: install_tools | |
run: | | |
sudo apt-get update | |
sudo apt-get dist-upgrade -y | |
sudo apt-get update | |
sudo apt-get install -y software-properties-common | |
sudo add-apt-repository universe | |
sudo apt-get update | |
sudo apt-get install -y gcc-14 g++-14 wget lsb-release | |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | |
sudo apt-get remove -y '*clang*' '*llvm*' | |
sudo apt-get autoremove -y | |
yes | sudo python3 install_prerequisites.py | |
sudo apt-add-repository "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-${LLVM_VERSION} main" | |
sudo apt-get update | |
sudo apt-get install -y \ | |
libllvm${LLVM_VERSION} \ | |
llvm-${LLVM_VERSION} \ | |
llvm-${LLVM_VERSION}-dev \ | |
llvm-${LLVM_VERSION}-runtime \ | |
clang-${LLVM_VERSION} \ | |
clang-tools-${LLVM_VERSION} \ | |
libclang-common-${LLVM_VERSION}-dev \ | |
libclang-${LLVM_VERSION}-dev \ | |
libclang1-${LLVM_VERSION} \ | |
clang-format-${LLVM_VERSION} \ | |
python3-clang-${LLVM_VERSION} \ | |
clang-tidy-${LLVM_VERSION} \ | |
libclang-rt-${LLVM_VERSION}-dev \ | |
libfuzzer-${LLVM_VERSION}-dev \ | |
lld-${LLVM_VERSION} \ | |
libc++-${LLVM_VERSION}-dev \ | |
libc++abi-${LLVM_VERSION}-dev \ | |
libunwind-${LLVM_VERSION}-dev \ | |
libllvmlibc-${LLVM_VERSION}-dev | |
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${LLVM_VERSION} 100 | |
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${LLVM_VERSION} 100 | |
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-${LLVM_VERSION} 100 | |
sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-${LLVM_VERSION} 100 | |
sudo update-alternatives --install /usr/bin/llvm-ar llvm-ar /usr/bin/llvm-ar-${LLVM_VERSION} 100 | |
sudo update-alternatives --install /usr/bin/llvm-rc llvm-rc /usr/bin/llvm-rc-${LLVM_VERSION} 100 | |
sudo update-alternatives --install /usr/bin/llvm-ranlib llvm-ranlib /usr/bin/llvm-ranlib-${LLVM_VERSION} 100 | |
sudo update-alternatives --install /usr/bin/FileCheck FileCheck /usr/bin/FileCheck-${LLVM_VERSION} 100 | |
sudo update-alternatives --install /usr/bin/lit lit /usr/lib/llvm-${LLVM_VERSION}/build/utils/lit/lit.py 100 | |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100 | |
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100 | |
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-14 100 | |
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-14 100 | |
- name: Configure | |
id: configure | |
run: cmake -GNinja -B build -S . | |
- name: Test | |
id: test | |
working-directory: build | |
run: /usr/lib/llvm-${LLVM_VERSION}/build/utils/lit/lit.py -sv test |