2023-02-04 00:59:33 +00:00
|
|
|
name: Build CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
|
|
|
schedule:
|
|
|
|
# build the main branch every Monday morning
|
|
|
|
- cron: '37 9 * * 1'
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2023-04-12 10:28:39 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
2023-02-04 00:59:33 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-04-12 10:28:39 +00:00
|
|
|
os: [ubuntu-latest, macos-latest]
|
2023-04-09 15:06:30 +00:00
|
|
|
compiler: [cc, clang, gcc-12]
|
2023-04-12 10:28:39 +00:00
|
|
|
exclude:
|
|
|
|
- os: macos-latest
|
|
|
|
compiler: cc
|
|
|
|
- os: macos-latest
|
|
|
|
compiler: gcc-12
|
2023-02-04 00:59:33 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Compiler version
|
|
|
|
run: $CC -v
|
|
|
|
env:
|
|
|
|
CC: ${{ matrix.compiler }}
|
2023-04-12 10:28:39 +00:00
|
|
|
- name: Install Linux dependencies
|
2023-08-10 09:07:37 +00:00
|
|
|
run: sudo apt install cmake ninja-build libssl-dev libpcap-dev libnet1-dev libjson-c-dev
|
2023-04-12 10:28:39 +00:00
|
|
|
if: ${{ runner.os == 'Linux' }}
|
|
|
|
- name: Install macOS dependencies
|
|
|
|
run: |
|
2023-08-10 09:07:37 +00:00
|
|
|
brew install cmake ninja openssl@3 libpcap libnet json-c
|
2023-04-12 10:28:39 +00:00
|
|
|
echo "LDFLAGS=-L$(brew --prefix openssl@3)/lib" >> $GITHUB_ENV
|
|
|
|
echo "CPPFLAGS=-I$(brew --prefix openssl@3)/include" >> $GITHUB_ENV
|
|
|
|
if: ${{ runner.os == 'macOS' }}
|
2023-08-10 09:07:37 +00:00
|
|
|
- name: cmake -B ${{github.workspace}}/build -G Ninja
|
|
|
|
run: cmake -B ${{github.workspace}}/build -G Ninja
|
2023-02-04 00:59:33 +00:00
|
|
|
env:
|
|
|
|
CC: ${{ matrix.compiler }}
|
2023-08-10 09:07:37 +00:00
|
|
|
- name: ninja -C ${{github.workspace}}/build
|
|
|
|
run: ninja -C ${{github.workspace}}/build
|