summaryrefslogtreecommitdiff
path: root/.github/workflows/ci.yaml
blob: d14ac02e9dc351b12de46ec0da904d842ee6021d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Build Hyprland

on: [push, pull_request, workflow_dispatch]
jobs:
  gcc:
    if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork
    name: "Build Hyprland (Arch)"
    runs-on: ubuntu-latest
    container:
      image: archlinux
    steps:
      - name: Checkout repository actions
        uses: actions/checkout@v4
        with:
          sparse-checkout: .github/actions

      - name: Setup base
        uses: ./.github/actions/setup_base
        with:
          INSTALL_XORG_PKGS: true

      - name: Build Hyprland
        run: |
          CFLAGS=-Werror CXXFLAGS=-Werror make nopch

      - name: Compress and package artifacts
        run: |
          mkdir x86_64-pc-linux-gnu
          mkdir hyprland
          cp ./LICENSE hyprland/
          cp build/Hyprland hyprland/
          cp build/hyprctl/hyprctl hyprland/
          cp build/hyprpm/hyprpm hyprland/
          cp -r example/ hyprland/
          cp -r assets/ hyprland/
          tar -cvJf Hyprland.tar.xz hyprland

      - name: Release
        uses: actions/upload-artifact@v4
        with:
          name: Build archive
          path: Hyprland.tar.xz

  clang-format:
    permissions: read-all
    if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork
    name: "Code Style"
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: clang-format check
        uses: jidicula/clang-format-action@v4.16.0
        with:
          exclude-regex: ^subprojects$