diff --git a/.forgejo/workflows/pr_check.yaml b/.forgejo/workflows/pr_check.yaml index 7d02cb0..91fb7ca 100644 --- a/.forgejo/workflows/pr_check.yaml +++ b/.forgejo/workflows/pr_check.yaml @@ -5,7 +5,7 @@ jobs: on-push-commit-check: runs-on: archlinux-latest steps: - - name: Setup environment + - name: Setup environment - Install pacman packages shell: sh run: | pacman -Syyu --noconfirm @@ -13,6 +13,28 @@ jobs: pacman -S --noconfirm cmake make gcc ninja meson pacman -S --noconfirm gtk4 gtkmm-4.0 boost spdlog fmt libxml++-5.0 + - name: Setup environment - Install LLVM-19.1.1 + run: | + echo "" >> ~/.bashrc + echo "export LLVM_VER='LLVM-19.1.1'" >> ~/.bashrc + source ~/.bashrc + + echo "::group::Download $LLVM_VER" + wget https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.1/LLVM-19.1.1-Linux-X64.tar.xz -O /$LLVM_VER-Linux-X64.tar.xz + echo "::endgroup::" + + echo "::group::Extracting $LLVM_VER" + mkdir -p /home/$LLVM_VER/ + tar -xf /$LLVM_VER-Linux-X64.tar.xz -C "/home/$LLVM_VER/" --strip-components=1 $LLVM_VER-Linux-X64/bin/clang-19 $LLVM_VER-Linux-X64/bin/clang $LLVM_VER-Linux-X64/bin/clang++ $LLVM_VER-Linux-X64/bin/clang-scan-deps $LLVM_VER-Linux-X64/bin/clang-format $LLVM_VER-Linux-X64/bin/clang-tidy $LLVM_VER-Linux-X64/include/ $LLVM_VER-Linux-X64/lib/ $LLVM_VER-Linux-X64/libexec/ $LLVM_VER-Linux-X64/local/ $LLVM_VER-Linux-X64/share/ + rm /$LLVM_VER-Linux-X64.tar.xz + echo "::endgroup::" + + echo "" >> ~/.bashrc + echo "export PATH='/home/$LLVM_VER/bin:${PATH}'" >> ~/.bashrc + + echo "Available LLVM binaries:" + ls -la /home/$LLVM_VER/bin/ + - name: List CI environment variables run: | echo "Runner OS: ${{ runner.os }}" @@ -50,47 +72,25 @@ jobs: #- name: Delete cache # run: | # rm -rf ${{ runner.tool_cache }}/cache-llvm-19-restore - - - name: Try restore LLVM-19 binaries from cache - id: cache-llvm-19-bins-restore - uses: actions/cache@v4 - with: - path: /LLVM-19.1.0-Linux-X64-small.tar.xz - key: LLVM-19.1.0-Linux-X64-small - - - name: Download and unzip LLVM-19 if not in cache - if: steps.cache-llvm-19-bins-restore.outputs.cache-hit != 'true' - run: | - echo "::group::Download LLVM-19.1.0" - wget https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.0/LLVM-19.1.0-Linux-X64.tar.xz -O /LLVM-19.1.0-Linux-X64.tar.xz - echo "::endgroup::" - - echo "::group::Extracting LLVM-19.1.0" - mkdir -p /home/LLVM-19.1.0/ - tar -xf /LLVM-19.1.0-Linux-X64.tar.xz -C "/home/LLVM-19.1.0/" --strip-components=1 LLVM-19.1.0-Linux-X64/bin/clang-19 LLVM-19.1.0-Linux-X64/bin/clang LLVM-19.1.0-Linux-X64/bin/clang++ LLVM-19.1.0-Linux-X64/bin/clang-scan-deps LLVM-19.1.0-Linux-X64/bin/clang-format LLVM-19.1.0-Linux-X64/bin/clang-tidy LLVM-19.1.0-Linux-X64/include/ LLVM-19.1.0-Linux-X64/lib/ LLVM-19.1.0-Linux-X64/libexec/ LLVM-19.1.0-Linux-X64/local/ LLVM-19.1.0-Linux-X64/share/ - rm /LLVM-19.1.0-Linux-X64.tar.xz - echo "::endgroup::" - - tar -cf /LLVM-19.1.0-Linux-X64-small.tar.xz /home/LLVM-19.1.0/ - - - name: Save LLVM-19 to cache - if: steps.cache-llvm-19-bins-restore.outputs.cache-hit != 'true' - id: cache-llvm-19-save - uses: actions/cache/save@v4 - with: - path: /LLVM-19.1.0-Linux-X64-small.tar.xz - key: LLVM-19.1.0-Linux-X64-small - - - name: Install LLVM - run: | - mkdir -p /home/LLVM-19.1.0 - tar -xf /LLVM-19.1.0-Linux-X64-small.tar.xz -C "/home/LLVM-19.1.0/" --strip-components=2 - ls -la /home/LLVM-19.1.0/bin/ - export PATH="/home/LLVM-19.1.0/bin:${PATH}" + # + #- name: Try restore LLVM-19 binaries from cache + # id: cache-llvm-19-bins-restore + # uses: actions/cache@v4 + # with: + # path: /$LLVM_VER-Linux-X64-small.tar.xz + # key: $LLVM_VER-Linux-X64-small + # + #- name: Save LLVM-19 to cache + # if: steps.cache-llvm-19-bins-restore.outputs.cache-hit != 'true' + # id: cache-llvm-19-save + # uses: actions/cache/save@v4 + # with: + # path: /$LLVM_VER-Linux-X64-small.tar.xz + # key: $LLVM_VER-Linux-X64-small - name: Check clang-format run: | - export PATH="/home/LLVM-19.1.0/bin:${PATH}" + export PATH="/home/$LLVM_VER/bin:${PATH}" cd ${{ github.workspace }} find -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.c" -o -name "*.cpp" \) > repo_sources_to_check.txt export REPO_FILES=$(cat repo_sources_to_check.txt) @@ -105,13 +105,13 @@ jobs: - name: Clang build with -fsanitize=address environment: - CC: /home/LLVM-19.1.0/bin/clang - CXX: /home/LLVM-19.1.0/bin/clang++ + CC: /home/$LLVM_VER/bin/clang + CXX: /home/$LLVM_VER/bin/clang++ run: | mkdir -p ${{ github.workspace }}/build_clang cmake -Wno-dev \ - -DCMAKE_C_COMPILER=/home/LLVM-19.1.0/bin/clang \ - -DCMAKE_CXX_COMPILER=/home/LLVM-19.1.0/bin/clang++ \ + -DCMAKE_C_COMPILER=/home/$LLVM_VER/bin/clang \ + -DCMAKE_CXX_COMPILER=/home/$LLVM_VER/bin/clang++ \ -S ${{ github.workspace }} \ -B ${{ github.workspace }}/build_clang \ -GNinja -DCMAKE_BUILD_TYPE=Release \ @@ -124,11 +124,11 @@ jobs: - name: Clang unit tests with -fsanitize=address run: | cd ${{ github.workspace }}/build_clang - ASAN_SYMBOLIZER_PATH=/home/LLVM-19.1.0/bin/llvm-symbolizer ASAN_OPTIONS=detect_stack_use_after_return=1:check_initialization_order=1:detect_leaks=1:atexit=1:abort_on_error=1 ./larra_xmpp_tests + ASAN_SYMBOLIZER_PATH=/home/$LLVM_VER/bin/llvm-symbolizer ASAN_OPTIONS=detect_stack_use_after_return=1:check_initialization_order=1:detect_leaks=1:atexit=1:abort_on_error=1 ./larra_xmpp_tests - name: Check clang-tidy run: | - export PATH="/home/LLVM-19.1.0/bin:${PATH}" + export PATH="/home/$LLVM_VER/bin:${PATH}" wget https://raw.githubusercontent.com/llvm/llvm-project/refs/heads/main/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py python run-clang-tidy.py -use-color -exclude-header-filter .*build.* -header-filter .hpp -p ${{ github.workspace }}/build_clang/ -config-file ${{ github.workspace }}/.clang-tidy ${{ github.workspace }}/examples ${{ github.workspace }}/library/ ${{ github.workspace }}/src/ echo "::warning::TODO Fix warnings and add '-warnings-as-errors' flags to report clang-tidy errors"