Skip to content

Fail on superfluous command line arguments #202

Fail on superfluous command line arguments

Fail on superfluous command line arguments #202

Workflow file for this run

name: Main CI
on: [push, pull_request]
jobs:
build:
name: (${{ matrix.cc }}) Build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
cc: [ 'gcc', 'clang-18' ]
env:
CC: ${{ matrix.cc }}
steps:
- uses: actions/checkout@v4
- name: install clang repo
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key 2>/dev/null | sudo apt-key add -
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main' -y
sudo apt-get update -q
- name: install dependencies
run: sudo apt-get install -y asciidoctor check clang-18 libevent-dev libmysqlclient-dev libpcap-dev libsqlite3-dev meson
- name: setup
run: meson setup build -Dwerror=true || (cat build/meson-logs/meson-log.txt; exit 1)
- name: build
run: meson compile -C build/
- name: test
run: meson test -C build/
weverything_build:
name: Clang Weverything Build
runs-on: ubuntu-latest
env:
CC: clang-18
CFLAGS: '-O2 -flto -Weverything -Wno-gnu-zero-variadic-macro-arguments -Wno-unsafe-buffer-usage -Wno-padded -Wno-gnu-conditional-omitted-operand -Wno-gnu-statement-expression-from-macro-expansion -Wno-language-extension-token -Wno-covered-switch-default -Wno-disabled-macro-expansion'
steps:
- uses: actions/checkout@v4
- name: install clang repo
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key 2>/dev/null | sudo apt-key add -
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main' -y
sudo apt-get update -q
- name: install dependencies
run: sudo apt-get install -y asciidoctor check clang-18 libevent-dev libmysqlclient-dev libpcap-dev libsqlite3-dev meson
- name: setup
run: meson setup build -Dwerror=true || (cat build/meson-logs/meson-log.txt; exit 1)
- name: build
run: meson compile -C build/
- name: test
run: meson test -C build/
whitespace_check:
name: Whitespace Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: check-whitespaces
run: git diff-tree --check $(git hash-object -t tree /dev/null) HEAD
spelling_check:
name: Codespell Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: install codespell
run: |
sudo apt-get update -q
sudo apt-get install -y codespell
- name: run codespell
run: codespell -C2 -Lnd,objext,ether --skip .git,_typos.toml
format_check:
name: Format Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: install clang-format
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key 2>/dev/null | sudo apt-key add -
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main' -y
sudo apt-get update -q
sudo apt-get install -y clang-format-18
- name: check format
run: clang-format-18 -i --Werror src/*.c src/*.h tests/*.c
- name: check changes
run: git diff --exit-code
# cppcheck:
# name: Cppcheck
#
# runs-on: ubuntu-latest
#
# steps:
# - uses: actions/checkout@v4
# - name: install cppcheck
# run: sudo apt-get install -y cppcheck
# - name: cppcheck
# #--error-exitcode=2
# run: cppcheck --enable=warning --force --inconclusive --library=std.cfg --library=posix.cfg --std=c11 --quiet --inline-suppr src/