Skip to content

Commit

Permalink
Merge pull request #16 from matusmarhefka/ci
Browse files Browse the repository at this point in the history
ci: add a basic CI
  • Loading branch information
evverx authored Apr 14, 2022
2 parents 1d89e99 + 289f290 commit d2a7a94
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 5 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
# vi: ts=2 sw=2 et:

name: Build test
on: [pull_request]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-20.04
concurrency:
group: ${{ github.workflow }}-${{ toJSON(matrix.env) }}-${{ github.ref }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
env:
- {
TYPE: "default",
CFLAGS: "-Werror -Wextra"
}
- {
TYPE: "asan+ubsan",
CFLAGS: "-Werror -Wextra -fsanitize=address,undefined",
ASAN_OPTIONS: "strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:abort_on_error=1",
UBSAN_OPTIONS: "print_stacktrace=1:print_summary=1:halt_on_error=1"
}
env: ${{ matrix.env }}
name: ${{ matrix.env.TYPE }}
steps:
- name: Repository checkout
uses: actions/checkout@v2

- name: Install dependencies
run: |
sudo apt -y update
sudo apt -y install gcc libglib2.0-dev libffi-dev make
- name: Build
run: |
make -C src
./src/dfuzzer -V
./src/dfuzzer -s -l
sudo make -C src install
- name: Test
run: |
# Test as an unprivileged user
dfuzzer -v -n org.freedesktop.systemd1
# Test as root
sudo dfuzzer -v -n org.freedesktop.systemd1
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.sw*
*.o
tags
src/dfuzzer
src/makefile.dep
3 changes: 3 additions & 0 deletions .vimrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
set noet
set tabstop=4
set shiftwidth=4
15 changes: 10 additions & 5 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,24 @@
# Copyright(C) 2014, 2015, Red Hat, Inc., Matus Marhefka <[email protected]>
#==============================================================================

CC=gcc
CFLAGS=-Wall -w -O2 -D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 `pkg-config --cflags --libs gio-2.0 libffi` -g
OBJ=dfuzzer.o introspection.o fuzz.o rand.o
TARGET=dfuzzer
CC ?= gcc
CFLAGS += -Wall -w -O2 -D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 `pkg-config --cflags --libs gio-2.0 libffi` -g
OBJ = dfuzzer.o introspection.o fuzz.o rand.o
TARGET = dfuzzer
all: dfuzzer
.PHONY: doc man clean
.PHONY: doc man clean install


makefile.dep:
$(CC) -MM *.c >makefile.dep
$(TARGET): $(OBJ)
$(CC) $(OBJ) $(CFLAGS) -o $(TARGET)

install: $(TARGET) man
install -pm 0755 $(TARGET) /usr/bin/$(TARGET)
install -pm 0644 dfuzzer.conf /etc/dfuzzer.conf
install -pm 0644 ../man/dfuzzer.1.gz /usr/share/man/man1/dfuzzer.1.gz

doc:
doxygen doxyfile

Expand Down

0 comments on commit d2a7a94

Please sign in to comment.