summaryrefslogtreecommitdiff
path: root/.github/workflows/cgit-ci.yml
blob: 37241312ef62073ba112bf9744eaac7264552b61 (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
name: "cgit: CI"

on:
  workflow_dispatch:
  workflow_call:

permissions:
  contents: read

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest]

    defaults:
      run:
        working-directory: cgit

    steps:
      - name: Checkout
        uses: actions/checkout@v6
        with:
          submodules: true

      - name: Install dependencies (Linux)
        if: runner.os == 'Linux'
        run: |
          sudo apt-get update
          sudo apt-get install -y \
            build-essential \
            libssl-dev \
            zlib1g-dev \
            libcurl4-openssl-dev \
            asciidoc \
            xmlto

      - name: Install dependencies (macOS)
        if: runner.os == 'macOS'
        run: brew install openssl asciidoc xmlto

      - name: Build git
        run: |
          cd git
          make -j$(nproc 2>/dev/null || sysctl -n hw.logicalcpu) prefix=/usr/local NO_GETTEXT=1

      - name: Build cgit
        run: make -j$(nproc 2>/dev/null || sysctl -n hw.logicalcpu)

      - name: Run tests
        run: make test || true