-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from matusmarhefka/ci
ci: add a basic CI
- Loading branch information
Showing
4 changed files
with
71 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
*.sw* | ||
*.o | ||
tags | ||
src/dfuzzer | ||
src/makefile.dep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
set noet | ||
set tabstop=4 | ||
set shiftwidth=4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
||
|