Adding action.yml #10
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: LLVM Clang Build | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Install CMake | |
run: | | |
sudo apt-get update | |
sudo apt install cmake | |
cmake --version | |
echo "CMake installé" | |
- name: Build & Install Ninja | |
run: | | |
shopt -s expand_aliases # Active l'utilisation des alias | |
alias fetch='git fetch --all --tags && git remote update origin --prune' | |
alias pull='fetch && git pull' | |
git clone https://github.com/ninja-build/ninja.git | |
pushd ninja || exit | |
git checkout release | |
pull | |
if ! [ -d build ]; then | |
mkdir build | |
fi | |
cmake -Bbuild | |
cmake --build build | |
if ! [ -e build/ninja ]; then | |
echo "Error during Ninja installation" | |
exit 1 | |
fi | |
sudo cp build/ninja /usr/bin/ninja | |
popd || exit | |
ninja --version | |
echo "Ninja installé" | |
- name: Build & Install LLVM | |
run: | | |
shopt -s expand_aliases # Active l'utilisation des alias | |
alias fetch='git fetch --all --tags && git remote update origin --prune' | |
alias pull='fetch && git pull' | |
mkdir llvm | |
pushd llvm || exit | |
git clone https://github.com/llvm/llvm-project.git | |
pushd llvm-project || exit | |
pull | |
popd || exit | |
if ! [ -d build ]; then | |
mkdir build | |
fi | |
if ! [ -d install ]; then | |
mkdir install | |
fi | |
pushd build || exit | |
cmake -G Ninja ../llvm-project/llvm \ | |
-DCMAKE_BUILD_TYPE:STRING=Release \ | |
-DLLVM_ENABLE_PROJECTS:STRING="clang;clang-tools-extra;lld;lldb" \ | |
-DLLVM_ENABLE_RUNTIMES:STRING="compiler-rt;libcxx;libcxxabi;libunwind" \ | |
-DLLVM_ENABLE_WARNINGS:BOOL=OFF -DLLVM_ENABLE_ASSERTIONS:BOOL=OFF \ | |
-DLLVM_OPTIMIZED_TABLEGEN:BOOL=ON -DLLVM_CCACHE_BUILD:BOOL=OFF \ | |
-DLLVM_ENABLE_DOXYGEN:BOOL=OFF \ | |
-DLLVM_BUILD_TESTS:BOOL=OFF \ | |
-DLIBCXX_ENABLE_INCOMPLETE_FEATURES:BOOL=ON \ | |
-DLIBCXX_HARDENING_MODE:STRING="none" \ | |
-DLIBCXX_ENABLE_MODULES:BOOL=ON \ | |
-DLIBCXX_ENABLE_STD_MODULES=ON \ | |
-DLIBCXX_INSTALL_MODULES=ON \ | |
-DLLVM_INSTALL_UTILS=ON | |
cmake --build . --parallel 4 | |
cmake --install . --prefix $GITHUB_WORKSPACE/llvm/install | |
popd || exit | |
pushd install || exit | |
pwd | |
ls | |
popd || exit | |
popd || exit | |
export PATH=$PATH:$GITHUB_WORKSPACE/llvm/install/bin | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/llvm/install/lib/x86_64-unknown-linux-gnu | |
clang --version | |
clang++ --version | |
- name: Test LLVM Clang installation | |
run: | | |
clang++ -o test test.cpp | |
./test | |
- name: Upload LLVM as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: llvm-clang-precompiled | |
path: ${{ github.workspace }}/llvm/install | |
overwrite: true |