Skip to content

examples: Do CI pre-commit checks on man page examples #2671

examples: Do CI pre-commit checks on man page examples

examples: Do CI pre-commit checks on man page examples #2671

Workflow file for this run

name: Build Tests
on:
push:
branches:
- main
- develop
- release-*
- gh-workflows
pull_request:
branches:
- main
- develop
env:
PLATFORM: posix
TESTS: yes
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: pre-commit/action@v3.0.1
scan-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: setup
run: |
sudo apt-get update && sudo apt-get install -y libcunit1-dev libtool libtool-bin exuberant-ctags clang-tools
./autogen.sh
- name: check
run: |
./configure --disable-documentation --disable-doxygen --disable-man --enable-examples --enable-tests --disable-dtls
scan-build --status-bugs make V=0
check-missing-updates:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: setup
run: |
sudo apt-get update && sudo apt-get install -y libcunit1-dev libtool libtool-bin exuberant-ctags clang-tools
./autogen.sh
- name: configure
run: |
./configure --disable-documentation --disable-doxygen --disable-man --enable-examples --enable-tests --disable-dtls
- name: check
run: |
scripts/check-missing-updates.sh
build-linux:
runs-on: ubuntu-latest
strategy:
matrix:
CC: ["gcc", "clang"]
TLS: ["no", "openssl", "gnutls", "mbedtls", "wolfssl"]
steps:
- uses: actions/checkout@v4
- name: setup
run: |
sudo apt-get update && sudo apt-get install -y libcunit1-dev libmbedtls-dev libgnutls28-dev libwolfssl-dev libtool libtool-bin exuberant-ctags valgrind
./autogen.sh
- name: configure no-TLS
if: matrix.TLS == 'no'
run: |
mkdir build-${{matrix.TLS}}-${{matrix.CC}}
cd build-${{matrix.TLS}}-${{matrix.CC}}
$GITHUB_WORKSPACE/configure --disable-silent-rules --disable-documentation --enable-examples --enable-tests --disable-dtls CC=${{matrix.CC}}
- name: configure TLS
if: matrix.TLS != 'no'
run: |
mkdir build-${{matrix.TLS}}-${{matrix.CC}}
cd build-${{matrix.TLS}}-${{matrix.CC}}
"$GITHUB_WORKSPACE/configure" --disable-silent-rules --disable-documentation --enable-examples --enable-tests --with-${{matrix.TLS}} CC=${{matrix.CC}}
- name: compile
run: |
cd build-${{matrix.TLS}}-${{matrix.CC}}
make EXTRA_CFLAGS=-Werror && make check EXTRA_CFLAGS=-Werror
- name: test
run: |
cd build-${{matrix.TLS}}-${{matrix.CC}}
libtool --mode=execute valgrind --track-origins=yes --leak-check=yes --show-reachable=yes --error-exitcode=123 --quiet --suppressions=$GITHUB_WORKSPACE/tests/valgrind_suppression tests/testdriver
tinydtls-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- 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: |
$GITHUB_WORKSPACE/configure --disable-silent-rules --disable-documentation --enable-examples --enable-tests --with-tinydtls
- name: compile
run: |
make EXTRA_CFLAGS=-Werror && make check EXTRA_CFLAGS=-Werror
- name: test
run: |
LD_LIBRARY_PATH=ext/tinydtls libtool --mode=execute valgrind --track-origins=yes --leak-check=yes --show-reachable=yes --error-exitcode=123 --quiet --suppressions=$GITHUB_WORKSPACE/tests/valgrind_suppression tests/testdriver
cmake-build:
runs-on: ubuntu-latest
strategy:
matrix:
TLS: ["no", "openssl", "gnutls", "mbedtls", "wolfssl", "tinydtls"]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: setup
run: |
sudo apt-get update && sudo apt-get install -y libcunit1-dev libmbedtls-dev libgnutls28-dev libwolfssl-dev
cmake -E make_directory $GITHUB_WORKSPACE/build-${{matrix.TLS}}-cmake
- name: configure no-TLS
if: matrix.TLS == 'no'
run: |
cd $GITHUB_WORKSPACE/build-${{matrix.TLS}}-cmake
cmake $GITHUB_WORKSPACE -DENABLE_EXAMPLES=ON -DENABLE_TESTS=ON -DENABLE_DTLS=OFF -DENABLE_DOCS=OFF -DWARNING_TO_ERROR=ON
- name: configure TLS
if: matrix.TLS != 'no'
run: |
cd $GITHUB_WORKSPACE/build-${{matrix.TLS}}-cmake
cmake $GITHUB_WORKSPACE -DENABLE_EXAMPLES=ON -DENABLE_TESTS=ON -DENABLE_DTLS=ON -DENABLE_DOCS=OFF -DDTLS_BACKEND=${{matrix.TLS}} -DWARNING_TO_ERROR=ON
- name: build
run: |
cd $GITHUB_WORKSPACE/build-${{matrix.TLS}}-cmake
cmake --build .
cmake-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: macOS CMake setup
run: |
cmake -E make_directory build_test
- name: macOS CMake configure
run: |
cd build_test
cmake .. -DWARNING_TO_ERROR=ON -DENABLE_TESTS=NO -DENABLE_DTLS=NO
- name: macOS CMake build
run: |
cd build_test
cmake --build .
contiki-build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: install macOS software
run: |
brew install make automake libtool
- name: setup
run: |
./autogen.sh
- name: configure
run: |
./configure --disable-doxygen --disable-manpages --disable-dtls --without-epoll --disable-examples --disable-examples-source --disable-tcp --disable-oscore --disable-q-block
- name: compile
run: |
gmake -C examples/contiki
other-build:
runs-on: ubuntu-latest
strategy:
matrix:
OS: ["contiki", "lwip", "riot"]
steps:
- uses: actions/checkout@v4
- name: setup
run: |
sudo apt-get update && sudo apt-get install -y libc6-dev-i386
./autogen.sh
- name: configure
run: |
$GITHUB_WORKSPACE/configure --disable-documentation --disable-examples --disable-tests --disable-dtls
- name: compile
run: |
make -C examples/${{matrix.OS}} EXTRA_CFLAGS=-Werror
ms-build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Install OpenSSL on Windows (choco)
run: call .\scripts\msinstallopenssl.cmd
shell: cmd
- name: Build sln
shell: cmd
run: call .\scripts\msbuild.sln.cmd
ms-cmake:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install OpenSSL on Windows (choco)
run: call .\scripts\msinstallopenssl.cmd
shell: cmd
- name: MS CMake setup
run: |
cmake -E make_directory build_test
- name: MS CMake configure
run: |
cd build_test
cmake .. -DWARNING_TO_ERROR=ON -DWITH_OPENSSL=YES
- name: MS CMake build
run: |
cd build_test
cmake --build .
mingw-cmake:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
install: git mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-openssl
- name: MinGW build
run: |
echo 'Running in MSYS2!'
scripts/mingw-cmake.sh
additional-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: setup
run: |
sudo apt-get update && sudo apt-get install -y libgnutls28-dev libtool libtool-bin exuberant-ctags
./autogen.sh
- name: configure
run: ./configure --disable-tests --disable-documentation
- name: build
run: |
make
make -C tests/oss-fuzz -f Makefile.ci check clean
documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: setup
run: |
sudo apt-get update && sudo apt-get install -y libtool libtool-bin exuberant-ctags graphviz doxygen libxml2-utils xsltproc docbook-xml docbook-xsl asciidoc
./autogen.sh
- name: configure
run: ./configure --disable-tests --enable-documentation --prefix $GITHUB_WORKSPACE/test-install
- name: manuals check
run: |
make -C man
- name: manual page examples check
run: |
scripts/check_examples.sh
- name: doxygen check
run: |
make -C doc
- name: installation check
run: |
make install && ls -lR $GITHUB_WORKSPACE/test-install
distribution:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: setup
run: |
sudo apt-get update && sudo apt-get install -y libcunit1-dev libtool libtool-bin exuberant-ctags graphviz doxygen libxml2-utils xsltproc docbook-xml docbook-xsl asciidoc libc6-dev-i386
./autogen.sh
- name: configure
run: |
mkdir build-dist
cd build-dist
$GITHUB_WORKSPACE/configure --enable-silent-rules --enable-documentation --enable-examples --disable-dtls
- name: build distribution
run: |
cd build-dist
make dist
- name: check distribution build
run: |
cd build-dist
$GITHUB_WORKSPACE/scripts/github_dist.sh
shell: bash