Skip to content

Commit

Permalink
github: Add in build and test workflow
Browse files Browse the repository at this point in the history
Unfortunately out of path builds do not work at present.

Signed-off-by: Jon Shallow <[email protected]>
  • Loading branch information
mrdeep1 authored and boaks committed Aug 8, 2022
1 parent 3888884 commit 86f4988
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 6 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build Tests

on:
push:
branches:
- main
- develop
- gh-workflows
pull_request:
branches:
- main
- develop

env:
PLATFORM: posix
TESTS: yes

jobs:
build-linux-autotools:
runs-on: ubuntu-latest
strategy:
matrix:
CC: ["gcc", "clang" ]
steps:
- uses: actions/checkout@v3
- name: setup
run: |
sudo apt-get update && sudo apt-get install -y libcunit1-dev libtool libtool-bin exuberant-ctags valgrind
./autogen.sh
- name: configure
run: |
# mkdir build-${{matrix.CC}}
# cd build-${{matrix.CC}}
$GITHUB_WORKSPACE/configure --enable-tests
- name: compile
run: |
# cd build-${{matrix.CC}}
make EXTRA_CFLAGS=-Werror
- name: tests
run: |
# cd build-${{matrix.CC}}
libtool --mode=execute valgrind --track-origins=yes --leak-check=yes --show-reachable=yes --error-exitcode=123 --quiet tests/unit-tests/testdriver
libtool --mode=execute valgrind --track-origins=yes --leak-check=yes --show-reachable=yes --error-exitcode=123 --quiet tests/ccm-test
build-linux-cmake:
name: Build for Linux using CMake
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build tinydtls
run: |
cmake -Dmake_tests=ON .
make
build-macos-cmake:
name: Build for macOS using CMake
runs-on: macos-latest

steps:
- uses: actions/checkout@v3
- name: Build tinydtls
run: |
cmake -Dmake_tests=ON .
make
3 changes: 2 additions & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ HEADERS:=dtls.h hmac.h dtls_debug.h dtls_config.h uthash.h numeric.h crypto.h gl
netq.h alert.h utlist.h dtls_prng.h peer.h state.h dtls_time.h session.h \
tinydtls.h dtls_mutex.h
PKG_CONFIG_FILES:=tinydtls.pc
CFLAGS:=-Wall -pedantic -std=c99 -DSHA2_USE_INTTYPES_H @CFLAGS@ @WARNING_CFLAGS@
CFLAGS:=-Wall -pedantic -std=c99 -DSHA2_USE_INTTYPES_H @CFLAGS@ \
@WARNING_CFLAGS@ $(EXTRA_CFLAGS)
CPPFLAGS:=@CPPFLAGS@ -DDTLS_CHECK_CONTENTTYPE -I$(top_srcdir)
SUBDIRS:=tests tests/unit-tests doc platform-specific sha2 aes ecc
DISTSUBDIRS:=$(SUBDIRS)
Expand Down
2 changes: 1 addition & 1 deletion aes/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ SOURCES:= rijndael.c rijndael_wrap.c
HEADERS:= rijndael.h
OBJECTS:= $(patsubst %.c, %.o, $(SOURCES))
CPPFLAGS=@CPPFLAGS@
CFLAGS=-Wall -std=c99 -pedantic @CFLAGS@ @WARNING_CFLAGS@
CFLAGS=-Wall -std=c99 -pedantic @CFLAGS@ @WARNING_CFLAGS@ $(EXTRA_CFLAGS)
LDFLAGS=@LDFLAGS@
LDLIBS=@LIBS@
FILES:=Makefile.in $(SOURCES) $(HEADERS)
Expand Down
2 changes: 1 addition & 1 deletion ecc/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ else
ECC_OBJECTS:= $(patsubst %.c, %.o, $(ECC_SOURCES)) ecc_test.o
PROGRAMS:= testecc testfield
CPPFLAGS=@CPPFLAGS@
CFLAGS=-Wall -std=c99 -pedantic @CFLAGS@ @WARNING_CFLAGS@ -DTEST_INCLUDE
CFLAGS=-Wall -std=c99 -pedantic @CFLAGS@ @WARNING_CFLAGS@ $(EXTRA_CFLAGS) -DTEST_INCLUDE
LDFLAGS=@LDFLAGS@
LDLIBS=@LIBS@

Expand Down
2 changes: 1 addition & 1 deletion sha2/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ SOURCES:= sha2.c
HEADERS:=sha2.h
OBJECTS:= $(patsubst %.c, %.o, $(SOURCES))
CPPFLAGS=@CPPFLAGS@ -I$(top_srcdir)
CFLAGS=-DSHA2_USE_INTTYPES_H -Wall -std=c99 -pedantic @CFLAGS@ @WARNING_CFLAGS@
CFLAGS=-DSHA2_USE_INTTYPES_H -Wall -std=c99 -pedantic @CFLAGS@ @WARNING_CFLAGS@ $(EXTRA_CFLAGS)
LDFLAGS=@LDFLAGS@
LDLIBS=@LIBS@
FILES:=Makefile.in $(SOURCES) $(HEADERS) README sha2prog.c sha2speed.c sha2test.pl
Expand Down
2 changes: 1 addition & 1 deletion tests/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ SOURCES:= dtls-server.c ccm-test.c \
OBJECTS:= $(patsubst %.c, %.o, $(SOURCES))
PROGRAMS:= $(patsubst %.c, %, $(SOURCES))
HEADERS:=
CFLAGS:=-Wall -std=c99 @CFLAGS@ @WARNING_CFLAGS@ -D_GNU_SOURCE
CFLAGS:=-Wall -std=c99 @CFLAGS@ @WARNING_CFLAGS@ $(EXTRA_CFLAGS) -D_GNU_SOURCE
CPPFLAGS:=-I$(top_srcdir) @CPPFLAGS@
LDFLAGS:=-L$(top_builddir) @LDFLAGS@
LDLIBS:=$(top_srcdir)/libtinydtls.a @LIBS@
Expand Down
2 changes: 1 addition & 1 deletion tests/unit-tests/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ SOURCES:= $(UNITS)
PROGRAM:=testdriver
OBJECTS:= $(patsubst %.c, %.o, $(SOURCES))
HEADERS:= $(patsubst %.c, %.h, $(UNITS))
CFLAGS:=-Wall -std=c99 @CUNIT_CFLAGS@ @CFLAGS@ @WARNING_CFLAGS@
CFLAGS:=-Wall -std=c99 @CUNIT_CFLAGS@ @CFLAGS@ @WARNING_CFLAGS@ $(EXTRA_CFLAGS)
CPPFLAGS:=-I$(top_srcdir) @CPPFLAGS@
LDFLAGS:=-L$(top_builddir) @LDFLAGS@
LDLIBS:=$(top_srcdir)/libtinydtls.a @CUNIT_LIBS@ @LIBS@
Expand Down

0 comments on commit 86f4988

Please sign in to comment.