mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-23 15:41:04 +03:00
[CI] main.yml: basic build steps
This commit is contained in:
1 parent
5bcb0a1578
commit
57a5a7e089
2 files changed
+45
-38
No files matched your search
+44
-37
@@ -1,48 +1,55 @@
|
|||||||
name: CMake
|
name: Build Tests
|
||||||
|
|
||||||
on: [push, pull_request]
|
on:
|
||||||
|
push:
|
||||||
|
# for now, trigger only on push to test branch gh-workflows
|
||||||
|
# later, will be push/pull_request to all main, develop, and 'release-*'
|
||||||
|
branches:
|
||||||
|
- gh-workflows
|
||||||
|
|
||||||
|
env:
|
||||||
|
PLATFORM: posix
|
||||||
|
TESTS: yes
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build-linux:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest]
|
CC: ["gcc", "clang"]
|
||||||
BUILD_SHARED_LIBS: ["ON", "OFF"]
|
TLS: ["no", "openssl", "gnutls", "mbedtls"]
|
||||||
ENABLE_DTLS: ["ON", "OFF"]
|
|
||||||
ENABLE_TCP: ["ON", "OFF"]
|
|
||||||
DTLS_BACKEND: ["openssl", "gnutls", "mbedtls", "tinydtls"]
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
- name: setup (linux)
|
- name: setup
|
||||||
if: startsWith(matrix.os, 'ubuntu')
|
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update && sudo apt-get install libcunit1-dev libmbedtls-dev libgnutls28-dev
|
sudo apt-get update && sudo apt-get install -y libcunit1-dev libmbedtls-dev libgnutls28-dev libtool libtool-bin exuberant-ctags valgrind graphviz doxygen libxml2-utils xsltproc docbook-xml docbook-xsl asciidoc
|
||||||
|
./autogen.sh
|
||||||
- name: Create Build Environment
|
- name: configure no-TLS
|
||||||
run: cmake -E make_directory ${{runner.workspace}}/build
|
if: matrix.TLS == 'no'
|
||||||
|
|
||||||
- name: Configure CMake
|
|
||||||
shell: bash
|
|
||||||
working-directory: ${{runner.workspace}}/build
|
|
||||||
run: |
|
run: |
|
||||||
cmake $GITHUB_WORKSPACE \
|
mkdir build-${{matrix.TLS}}-${{matrix.CC}}
|
||||||
-DENABLE_EXAMPLES=ON \
|
cd build-${{matrix.TLS}}-${{matrix.CC}}
|
||||||
-DENABLE_TESTS=ON \
|
$GITHUB_WORKSPACE/configure --enable-tests --disable-dtls CC=${{matrix.CC}}
|
||||||
-DBUILD_SHARED_LIBS=${{matrix.BUILD_SHARED_LIBS}} \
|
- name: configure TLS
|
||||||
-DENABLE_DTLS=${{matrix.ENABLE_DTLS}} \
|
if: matrix.TLS != 'no'
|
||||||
-DENABLE_TCP=${{matrix.ENABLE_TCP}} \
|
run: |
|
||||||
-DDTLS_BACKEND=${{matrix.DTLS_BACKEND}}
|
mkdir build-${{matrix.TLS}}-${{matrix.CC}}
|
||||||
|
cd build-${{matrix.TLS}}-${{matrix.CC}}
|
||||||
- name: Build
|
"$GITHUB_WORKSPACE/configure" --enable-tests --with-${{matrix.TLS}} CC=${{matrix.CC}}
|
||||||
working-directory: ${{runner.workspace}}/build
|
- name: compile
|
||||||
shell: bash
|
run: |
|
||||||
run: cmake --build .
|
cd build-${{matrix.TLS}}-${{matrix.CC}}
|
||||||
# TODO: add tests to the pipeline
|
make
|
||||||
# - name: Test
|
- name: test
|
||||||
# working-directory: ${{runner.workspace}}/build
|
if: matrix.TLS != 'tinydtls'
|
||||||
# shell: bash
|
run: |
|
||||||
# run: ctest .
|
cd build-${{matrix.TLS}}-${{matrix.CC}}
|
||||||
|
libtool --mode=execute tests/testdriver
|
||||||
|
- name: test tinydtls
|
||||||
|
if: matrix.TLS == 'tinydtls'
|
||||||
|
run: |
|
||||||
|
cd build-${{matrix.TLS}}-${{matrix.CC}}
|
||||||
|
LD_LIBRARY_PATH="ext/tinydtls" libtool --mode=execute tests/testdriver
|
||||||
|
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
|
|
||||||
SILENT="--disable-silent-rules"
|
#SILENT="--disable-silent-rules"
|
||||||
|
|
||||||
if test "x$TESTS" = "xyes" -o "x$TESTS" = "xtrue" ; then
|
if test "x$TESTS" = "xyes" -o "x$TESTS" = "xtrue" ; then
|
||||||
WITH_TESTS="`scripts/fix-cunit.sh` --enable-tests"
|
WITH_TESTS="`scripts/fix-cunit.sh` --enable-tests"
|
||||||
|
|||||||
Reference in new issue
Block a user