name: Build & Test (Arch) on: [push, pull_request, workflow_dispatch] jobs: asan: name: "gcc build / ASan tests" runs-on: ubuntu-latest container: image: archlinux steps: - name: Checkout repository actions uses: actions/checkout@v4 with: sparse-checkout: .github/actions - name: Get required pkgs run: | sed -i 's/SigLevel = Required DatabaseOptional/SigLevel = Optional TrustAll/' /etc/pacman.conf pacman --noconfirm --noprogressbar -Syyu pacman --noconfirm --noprogressbar -Sy gcc base-devel cmake clang git pixman - name: Get hyprutils-git run: | git clone https://github.com/hyprwm/hyprutils && cd hyprutils && cmake -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -B build && cmake --build build --target hyprutils && cmake --install build - name: Build with gcc run: | CXXFLAGS="-fsanitize=address" CC="/usr/bin/gcc" CXX="/usr/bin/g++" cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build CXXFLAGS="-fsanitize=address" CC="/usr/bin/gcc" CXX="/usr/bin/g++" cmake --build ./build --config Release --target all -j`nproc 2>/dev/null || getconf NPROCESSORS_CONF` cmake --install ./build - name: Run tests run: | cd ./build && ctest --output-on-failure ubsan: name: "gcc build / UBSan tests" runs-on: ubuntu-latest container: image: archlinux steps: - name: Checkout repository actions uses: actions/checkout@v4 with: sparse-checkout: .github/actions - name: Get required pkgs run: | sed -i 's/SigLevel = Required DatabaseOptional/SigLevel = Optional TrustAll/' /etc/pacman.conf pacman --noconfirm --noprogressbar -Syyu pacman --noconfirm --noprogressbar -Sy gcc base-devel cmake clang git pixman - name: Get hyprutils-git run: | git clone https://github.com/hyprwm/hyprutils && cd hyprutils && cmake -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -B build && cmake --build build --target hyprutils && cmake --install build - name: Build with gcc run: | CXXFLAGS="-fsanitize=undefined" CC="/usr/bin/gcc" CXX="/usr/bin/g++" cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build CXXFLAGS="-fsanitize=undefined" CC="/usr/bin/gcc" CXX="/usr/bin/g++" cmake --build ./build --config Release --target all -j`nproc 2>/dev/null || getconf NPROCESSORS_CONF` cmake --install ./build - name: Run tests run: | cd ./build && ctest --output-on-failure msan: name: "gcc build / MSan tests" runs-on: ubuntu-latest container: image: archlinux steps: - name: Checkout repository actions uses: actions/checkout@v4 with: sparse-checkout: .github/actions - name: Get required pkgs run: | sed -i 's/SigLevel = Required DatabaseOptional/SigLevel = Optional TrustAll/' /etc/pacman.conf pacman --noconfirm --noprogressbar -Syyu pacman --noconfirm --noprogressbar -Sy gcc base-devel cmake clang git pixman - name: Get hyprutils-git run: | git clone https://github.com/hyprwm/hyprutils && cd hyprutils && cmake -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -B build && cmake --build build --target hyprutils && cmake --install build - name: Build with gcc run: | CXXFLAGS="-fsanitize=leak" CC="/usr/bin/gcc" CXX="/usr/bin/g++" cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build CXXFLAGS="-fsanitize=leak" CC="/usr/bin/gcc" CXX="/usr/bin/g++" cmake --build ./build --config Release --target all -j`nproc 2>/dev/null || getconf NPROCESSORS_CONF` cmake --install ./build - name: Run tests run: | cd ./build && ctest --output-on-failure clang: name: "clang build / gcc test" runs-on: ubuntu-latest container: image: archlinux steps: - name: Checkout repository actions uses: actions/checkout@v4 with: sparse-checkout: .github/actions - name: Get required pkgs run: | sed -i 's/SigLevel = Required DatabaseOptional/SigLevel = Optional TrustAll/' /etc/pacman.conf pacman --noconfirm --noprogressbar -Syyu pacman --noconfirm --noprogressbar -Sy gcc base-devel cmake clang libc++ git pixman - name: Get hyprutils-git run: | git clone https://github.com/hyprwm/hyprutils && cd hyprutils && cmake -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -B build && cmake --build build --target hyprutils && cmake --install build - name: Build hyprlang with clang run: | CC="/usr/bin/clang" CXX="/usr/bin/clang++" cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_CXX_FLAGS="-stdlib=libc++" -S . -B ./build CC="/usr/bin/clang" CXX="/usr/bin/clang++" cmake --build ./build --config Release --target hyprlang -j`nproc 2>/dev/null || getconf NPROCESSORS_CONF` cmake --install ./build - name: Build tests with gcc run: | rm -rf ./build CC="/usr/bin/gcc" CXX="/usr/bin/g++" cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build CC="/usr/bin/gcc" CXX="/usr/bin/g++" cmake --build ./build --config Release --target tests -j`nproc 2>/dev/null || getconf NPROCESSORS_CONF` - name: Run tests run: | cd ./build && ctest --output-on-failure doxygen: name: "Deploy docs" runs-on: ubuntu-latest if: github.ref == 'refs/heads/main' container: image: archlinux steps: - name: Checkout repository actions uses: actions/checkout@v4 with: sparse-checkout: .github/actions - name: Get required pkgs run: | sed -i 's/SigLevel = Required DatabaseOptional/SigLevel = Optional TrustAll/' /etc/pacman.conf pacman --noconfirm --noprogressbar -Syyu pacman --noconfirm --noprogressbar -Sy gcc base-devel cmake clang doxygen git openssh - name: Get doxygen theme run: | git clone https://github.com/jothepro/doxygen-awesome-css cd doxygen-awesome-css && git checkout v2.3.1 && cd .. - name: Build doxygen site run: | doxygen hyprlang-docs - name: Deploy env: PK: ${{ secrets.UPDATE_DOCS_PK }} PT: ${{ secrets.DEPLOY_PORT5 }} AD: ${{ secrets.DEPLOY_USER }} PH: ${{ secrets.DEPLOY_PATH }} run: | echo "$PK" > ./pk chmod 400 ./pk eval $(ssh-agent -s) && ssh-add ./pk 2>&1 > /dev/null scp -O -o "StrictHostKeyChecking=no" -q -o "LogLevel=QUIET" -P $PT -r ./doxygen/html/* $AD:.$PH 2>&1 > /dev/null