2025-02-05 15:16:24 +01:00
|
|
|
---
|
|
|
|
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:
|
|
|
|
|
2025-02-05 15:20:33 +01:00
|
|
|
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
|
|
|
|
|
2025-02-05 15:16:24 +01:00
|
|
|
build-with-gcc:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
cfg: [debug, release]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
2025-02-05 15:21:10 +01:00
|
|
|
with: {fetch-depth: 0}
|
2025-02-05 15:16:24 +01:00
|
|
|
- run: sudo apt-get install -y build-essential
|
2025-02-05 15:21:10 +01:00
|
|
|
- run: make VERBOSE=1 CFG=${{ matrix.cfg}} -j$(nproc)
|
|
|
|
- run: |
|
|
|
|
_${{ matrix.cfg }}/inotify-info --version
|
|
|
|
_${{ matrix.cfg }}/inotify-info
|
2025-02-05 15:16:24 +01:00
|
|
|
|
|
|
|
build-with-zig:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
2025-02-05 15:21:10 +01:00
|
|
|
with: {fetch-depth: 0}
|
2025-02-05 15:16:24 +01:00
|
|
|
- uses: actions/cache@v4
|
|
|
|
with:
|
|
|
|
key: zig-sdk-and-cache-${{ hashFiles('.github/workflows/ci.yaml') }}
|
|
|
|
path: ~/.cache/zig
|
|
|
|
- run: |
|
|
|
|
wget --progress=dot:mega \
|
2025-02-05 15:21:10 +01:00
|
|
|
https://ziglang.org/download/0.13.0/zig-linux-$(uname -m)-0.13.0.tar.xz
|
2025-02-05 15:16:24 +01:00
|
|
|
tar -xJf zig-linux-*.tar.xz
|
|
|
|
rm zig-linux-*.xz
|
|
|
|
mv zig-linux-* zig-sdk
|
|
|
|
- run: |
|
2025-02-05 15:21:10 +01:00
|
|
|
make VERBOSE=1 -j$(nproc) \
|
2025-02-05 15:16:24 +01:00
|
|
|
CC="zig-sdk/zig cc -target $(uname -m)-linux-musl" \
|
|
|
|
CXX="zig-sdk/zig c++ -target $(uname -m)-linux-musl"
|
2025-02-05 15:21:10 +01:00
|
|
|
- run: |
|
|
|
|
_release/inotify-info --version
|
|
|
|
_release/inotify-info
|
2025-02-05 15:16:24 +01:00
|
|
|
|
|
|
|
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
|