diff --git a/.github/workflows/arch.yml b/.github/workflows/arch.yml new file mode 100644 index 0000000..f013def --- /dev/null +++ b/.github/workflows/arch.yml @@ -0,0 +1,57 @@ +name: Build & Test (Arch) + +on: [push, pull_request, workflow_dispatch] +jobs: + gcc: + name: "Arch: Build and Test (gcc)" + 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++ pixman + + - name: Build hyprgraphics with gcc + run: | + 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 all -j`nproc 2>/dev/null || getconf NPROCESSORS_CONF` + cmake --install ./build + + - name: Run tests + run: | + cd ./build && ctest --output-on-failure + + clang: + name: "Arch: Build and Test (clang)" + 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++ pixman + + - name: Build hyprgraphics 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 -S . -B ./build + CC="/usr/bin/clang" CXX="/usr/bin/clang++" 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 diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml new file mode 100644 index 0000000..ebdacb5 --- /dev/null +++ b/.github/workflows/nix.yml @@ -0,0 +1,27 @@ +name: Build & Test + +on: [push, pull_request, workflow_dispatch] +jobs: + nix: + strategy: + matrix: + package: + - hyprgraphics + - hyprgraphics-with-tests + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: cachix/install-nix-action@v26 + - uses: DeterminateSystems/magic-nix-cache-action@main + + # not needed (yet) + # - uses: cachix/cachix-action@v12 + # with: + # name: hyprland + # authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + + - name: Build & Test + run: nix build .#${{ matrix.package }} --print-build-logs +