summaryrefslogtreecommitdiffstats
path: root/.github/workflows/ci.yaml
blob: 06249d1c3a7adac47ec27f291f9f6f6ba4eb795c (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
57
58
59
60
61
62
---
name: test
on:
  push:
  pull_request:
concurrency:
  # Cancels pending runs when a PR gets updated.
  group: ${{ github.head_ref || github.run_id }}-${{ github.actor }}
  cancel-in-progress: true
jobs:

  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: sudo apt-get install -y make clang-format
      - run: make lint
      - run: git diff --exit-code

  build-with-gcc:
    strategy:
      matrix:
        cfg: [debug, release]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with: {fetch-depth: 0}
      - run: sudo apt-get install -y build-essential
      - run: make VERBOSE=1 CFG=${{ matrix.cfg}} -j$(nproc)
      - run: |
          _${{ matrix.cfg }}/inotify-info --version
          _${{ matrix.cfg }}/inotify-info

  build-with-zig:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with: {fetch-depth: 0}
      - uses: actions/cache@v4
        with:
          key: zig-sdk-and-cache-${{ hashFiles('.github/workflows/ci.yaml') }}
          path: ~/.cache/zig
      - run: |
          wget --progress=dot:mega \
            https://ziglang.org/download/0.13.0/zig-linux-$(uname -m)-0.13.0.tar.xz
          tar -xJf zig-linux-*.tar.xz
          rm zig-linux-*.xz
          mv zig-linux-* zig-sdk
      - run: |
          make VERBOSE=1 -j$(nproc) \
            CC="zig-sdk/zig cc -target $(uname -m)-linux-musl" \
            CXX="zig-sdk/zig c++ -target $(uname -m)-linux-musl"
      - run: |
          _release/inotify-info --version
          _release/inotify-info

  build-with-docker:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: docker build -t inotify-info .
      - run: docker run --rm --privileged -v /proc:/proc inotify-info