From 868fc6e0f32b8f5c9c10eca41fdf048ec64eeea0 Mon Sep 17 00:00:00 2001 From: Fernando Ayats Date: Wed, 13 Jul 2022 10:36:47 +0200 Subject: Revert "FIXME: temp disable workflows" This reverts commit 532ffe16811dea5a8f4c9730ec7e2bb0fd1b9395. --- .github/workflows/ci.yaml | 85 +++++++++++++++++++++++++++++ .github/workflows/flawfinder.yml | 30 ++++++++++ .github/workflows/nix-build.yaml | 21 +++++++ .github/workflows/nix-meson-ver-update.yaml | 26 +++++++++ .github/workflows/nix-update.yaml | 22 ++++++++ 5 files changed, 184 insertions(+) create mode 100644 .github/workflows/ci.yaml create mode 100644 .github/workflows/flawfinder.yml create mode 100644 .github/workflows/nix-build.yaml create mode 100644 .github/workflows/nix-meson-ver-update.yaml create mode 100644 .github/workflows/nix-update.yaml (limited to '.github/workflows') diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..77c9c48b --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,85 @@ +name: Build Hyprland + +on: [push, pull_request, workflow_dispatch] +jobs: + gcc: + name: "Build Hyprland (Arch)" + runs-on: ubuntu-latest + container: + image: archlinux + steps: + - name: Get required pacman pkgs + run: | + sed -i 's/SigLevel = Required DatabaseOptional/SigLevel = Optional TrustAll/' /etc/pacman.conf + pacman --noconfirm --noprogressbar -Syyu + pacman --noconfirm --noprogressbar -Sy glslang libepoxy libfontenc libxcvt libxfont2 libxkbfile vulkan-headers vulkan-validation-layers xcb-util-errors xcb-util-renderutil xcb-util-wm xorg-fonts-encodings xorg-server-common xorg-setxkbmap xorg-xkbcomp xorg-xwayland git cmake go clang lld libc++ pkgconf meson ninja wayland wayland-protocols libinput libxkbcommon pixman glm libdrm libglvnd cairo pango systemd scdoc base-devel seatd + - name: Set up user + run: | + useradd -m githubuser + echo -e "root ALL=(ALL:ALL) ALL\ngithubuser ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers + - name: Build wlroots + run: | + su githubuser -c "cd ~ && git clone https://gitlab.freedesktop.org/wlroots/wlroots" + su githubuser -c "cd ~/wlroots && meson build/ --prefix=/usr && ninja -C build/ && sudo ninja -C build/ install && cd .." + - name: Fix permissions for git + run: | + git config --global --add safe.directory /__w/Hyprland/Hyprland + - name: Checkout Hyprland + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Build Hyprland + run: | + git submodule sync --recursive && git submodule update --init --force --recursive + make all + - name: Compress and package artifacts + run: | + mkdir x86_64-pc-linux-gnu + mkdir hyprland + mkdir hyprland/example + mkdir hyprland/assets + cp ./LICENSE hyprland/ + cp build/Hyprland hyprland/ + cp hyprctl/hyprctl hyprland/ + cp subprojects/wlroots/build/libwlroots.so.11032 hyprland/ + cp build/Hyprland hyprland/ + cp -r example/ hyprland/ + cp -r assets/ hyprland/ + tar -cvf Hyprland.tar.xz hyprland + - name: Release + uses: actions/upload-artifact@v3 + with: + name: Build archive + path: Hyprland.tar.xz + + meson: + name: "Build Hyprland with Meson (Arch)" + runs-on: ubuntu-latest + container: + image: archlinux + steps: + - name: Download dependencies + run: | + sed -i 's/SigLevel = Required DatabaseOptional/SigLevel = Optional TrustAll/' /etc/pacman.conf + pacman --noconfirm --noprogressbar -Syyu + pacman --noconfirm --noprogressbar -Sy glslang libepoxy libfontenc libxcvt libxfont2 libxkbfile vulkan-headers vulkan-validation-layers xcb-util-errors xcb-util-renderutil xcb-util-wm xorg-fonts-encodings xorg-server-common xorg-setxkbmap xorg-xkbcomp xorg-xwayland git go clang lld libc++ pkgconf meson ninja wayland wayland-protocols libinput libxkbcommon pixman glm libdrm libglvnd cairo pango systemd scdoc base-devel seatd + - name: Checkout Hyprland + uses: actions/checkout@v3 + with: + submodules: true + - name: Configure + run: | + meson obj-x86_64-pc-linux-gnu \ + -Ddefault_library=static + - name: Compile + run: ninja -C obj-x86_64-pc-linux-gnu +# - name: Compress artifacts +# run: | +# mkdir x86_64-pc-linux-gnu +# DESTDIR=$PWD/x86_64-pc-linux-gnu meson install -C obj-x86_64-pc-linux-gnu --tags runtime +# tar -cvf x86_64-pc-linux-gnu.tar.xz x86_64-pc-linux-gnu +# - name: Upload artifacts +# uses: actions/upload-artifact@v3 +# with: +# name: Build artifacts (x86_64-pc-linux-gnu) +# path: x86_64-pc-linux-gnu.tar.xz diff --git a/.github/workflows/flawfinder.yml b/.github/workflows/flawfinder.yml new file mode 100644 index 00000000..e1df95dc --- /dev/null +++ b/.github/workflows/flawfinder.yml @@ -0,0 +1,30 @@ +name: Flawfinder + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + flawfinder: + name: Flawfinder Checks + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Scan with Flawfinder + uses: david-a-wheeler/flawfinder@8e4a779ad59dbfaee5da586aa9210853b701959c + with: + arguments: '--sarif ./' + output: 'flawfinder_results.sarif' + + - name: Upload analysis results to GitHub Security tab + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: ${{github.workspace}}/flawfinder_results.sarif diff --git a/.github/workflows/nix-build.yaml b/.github/workflows/nix-build.yaml new file mode 100644 index 00000000..b0905fee --- /dev/null +++ b/.github/workflows/nix-build.yaml @@ -0,0 +1,21 @@ +name: Build Hyprland (Nix) + +on: [push, pull_request, workflow_dispatch] +jobs: + nix: + name: "Build Hyprland (Nix)" + runs-on: ubuntu-latest + steps: + - name: Clone repository + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Install nix + uses: cachix/install-nix-action@v17 + with: + install_url: https://releases.nixos.org/nix/nix-2.8.0/install + extra_nix_config: | + auto-optimise-store = true + experimental-features = nix-command flakes + - name: Build HyprLand with default settings + run: nix build --print-build-logs diff --git a/.github/workflows/nix-meson-ver-update.yaml b/.github/workflows/nix-meson-ver-update.yaml new file mode 100644 index 00000000..ddeac945 --- /dev/null +++ b/.github/workflows/nix-meson-ver-update.yaml @@ -0,0 +1,26 @@ +name: "Nix & Meson: update version" + +on: [workflow_dispatch] + +jobs: + update: + runs-on: ubuntu-latest + steps: + - name: Clone repository + uses: actions/checkout@v3 + - name: Update flake and meson version + run: | + REGEX="([0-9]+(\.[0-9a-zA-Z]+)+)" + + CRT_REV=$(git show-ref --tags --head --abbrev | head -n 1 | head -c 7) + TAG_REV=$(git show-ref --tags --abbrev | tail -n 1 | head -c 7) + CRT_VER=$(sed -nEe "/$REGEX/{p;q;}" meson.build | awk -F\' '{print $2}') + VERSION=$(git show-ref --tags --abbrev | tail -n 1 | tail -c +20) + + if [[ $TAG_REV = $CRT_REV ]] || [[ $CRT_VER != $VERSION ]]; then + sed -Ei "s/$REGEX/$VERSION/g" meson.build + sed -Ei "s/$REGEX/$VERSION/g" flake.nix + fi + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: "[gha] bump flake and meson version" diff --git a/.github/workflows/nix-update.yaml b/.github/workflows/nix-update.yaml new file mode 100644 index 00000000..91a5c686 --- /dev/null +++ b/.github/workflows/nix-update.yaml @@ -0,0 +1,22 @@ +name: "Nix: update lockfile" + +on: [push, workflow_dispatch] + +jobs: + update: + runs-on: ubuntu-latest + steps: + - name: Clone repository + uses: actions/checkout@v3 + - name: Install nix + uses: cachix/install-nix-action@v17 + with: + install_url: https://releases.nixos.org/nix/nix-2.8.0/install + extra_nix_config: | + auto-optimise-store = true + experimental-features = nix-command flakes + - name: Update lockfile + run: nix/update-inputs.sh + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: "[gha] bump flake inputs" -- cgit v1.2.3