From ab526282d4d59c8517305a6e4ccb8e0b5c1d6a85 Mon Sep 17 00:00:00 2001 From: Andreas Lundin Date: Sun, 17 Nov 2024 20:07:22 +0100 Subject: [PATCH] initial commit of github actions --- .github/workflows/github-actions-build.yml | 37 ++++++++++++++++++++++ Makefile | 2 +- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/github-actions-build.yml diff --git a/.github/workflows/github-actions-build.yml b/.github/workflows/github-actions-build.yml new file mode 100644 index 0000000..b9154af --- /dev/null +++ b/.github/workflows/github-actions-build.yml @@ -0,0 +1,37 @@ +--- + +name: Build +on: [push, pull_request] +jobs: + build: + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + + matrix: + os: [ubuntu-latest, ubuntu-22.04, macOS-14, macOS-15] + compiler: [gcc, clang] + exclude: + - os: macOS-14 + compiler: gcc + - os: macOS-15 + compiler: gcc + + steps: + - uses: actions/checkout@v4 + + - name: Install libpcap-dev + if: contains(matrix.os, 'ubuntu') + run: sudo apt install -y libpcap-dev + + - name: Compile using ${{ matrix.compiler }} + run: make CC=${{ matrix.compiler }} + + - name: Install + run: sudo make install + + - name: Execute + run: /usr/local/sbin/ifpstat -v + +... diff --git a/Makefile b/Makefile index 5700b01..1ec5e38 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ MANDIR=/usr/local/share/man/man1 VERSION=1.0.2 -CC=cc +CC?=cc CFLAGS=-O2 -W -Wall -Wno-unused-parameter LIBS=-lpcap