Files
libcoap/.github/workflows/main.yml
T

675 lines
25 KiB
YAML

name: Build Tests
on:
push:
branches:
- main
- develop
- release-*
- gh-workflows
pull_request:
branches:
- main
- develop
env:
PLATFORM: posix
TESTS: yes
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
OPENHITLS_REPO: https://gitcode.com/openHiTLS/openhitls.git
# Pinned until the next openHiTLS release
OPENHITLS_REF: 2d524d8e0f9c392a4bc3c244f976a69f9f6bb64a
# Keep in sync with examples/contiki/Makefile
WITH_CONTIKI_NG_BRANCH: release/v5.2
# Keep in sync with examples/lwip/Makefile
WITH_LWIP_BRANCH: STABLE-2_2_1_RELEASE
# Keep in sync with examples/zephyr/Makefile
WITH_ZEPHYR_BRANCH: v4.3.0
jobs:
do-caches:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: cache openHiTLS
id: cache_openhitls
uses: actions/cache@v6
with:
path: ${{ runner.temp }}/openhitls-prefix
key: openhitls-${{ runner.os }}-${{ runner.arch }}-${{ env.OPENHITLS_REF }}-full
lookup-only: true
- name: build openHiTLS
if: steps.cache_openhitls.outputs.cache-hit != 'true'
run: |
rm -rf "$RUNNER_TEMP/openhitls-src" "$RUNNER_TEMP/openhitls-prefix"
git init "$RUNNER_TEMP/openhitls-src"
cd "$RUNNER_TEMP/openhitls-src"
git remote add origin "$OPENHITLS_REPO"
git fetch --depth 1 origin "$OPENHITLS_REF"
git checkout FETCH_HEAD
cmake -S . -B build -DHITLS_BUILD_PROFILE=full -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel "$(nproc)"
cmake --install build --prefix "$RUNNER_TEMP/openhitls-prefix"
- name: cache Contiki
id: cache_contiki_ng
uses: actions/cache@v6
with:
path: ${{ runner.temp }}/download/contiki-ng
key: contiki-${{ runner.os }}-${{ runner.arch }}-${{ env.WITH_CONTIKI_NG_BRANCH }}-full
lookup-only: true
- name: download Contiki
if: steps.cache_contiki_ng.outputs.cache-hit != 'true'
run: |
rm -rf "$RUNNER_TEMP/download/contiki-ng"
mkdir -p "$RUNNER_TEMP/download"
cd "$RUNNER_TEMP/download"
git clone --depth 1 https://github.com/contiki-ng/contiki-ng.git -b $WITH_CONTIKI_NG_BRANCH
cd contiki-ng
git checkout "$WITH_CONTIKI_NG_BRANCH"
- name: cache LwIP
id: cache_lwip
uses: actions/cache@v6
with:
path: ${{ runner.temp }}/download/lwip
key: lwip-${{ runner.os }}-${{ runner.arch }}-${{ env.WITH_LWIP_BRANCH }}-full
lookup-only: true
- name: download LwIP
if: steps.cache_lwip.outputs.cache-hit != 'true'
run: |
rm -rf "$RUNNER_TEMP/download/lwip"
mkdir -p "$RUNNER_TEMP/download"
cd "$RUNNER_TEMP/download"
git clone --depth 1 https://git.savannah.nongnu.org/git/lwip.git -b $WITH_LWIP_BRANCH
cd lwip
git checkout "$WITH_LWIP_BRANCH"
- name: cache Zephyr
id: cache_zephyr
uses: actions/cache@v6
with:
path: ${{ runner.temp }}/download/zephyrproject
key: zephyr-${{ runner.os }}-${{ runner.arch }}-${{ env.WITH_ZEPHYR_BRANCH }}-full
lookup-only: true
- name: download Zephyr
if: steps.cache_zephyr.outputs.cache-hit != 'true'
run: |
rm -rf "$RUNNER_TEMP/download//download/zephyrproject"
mkdir -p "$RUNNER_TEMP/download"
cd "$RUNNER_TEMP/download"
python3 -m venv zephyrproject/.venv
ls -l zephyrproject/.venv/bin/activate
. zephyrproject/.venv/bin/activate
pip install west
west init --mr ${WITH_ZEPHYR_BRANCH} zephyrproject
cd zephyrproject
west update -n
west zephyr-export
west packages pip --install
cd zephyr
west sdk install --install-base=zephyrproject/../ -t x86_64-zephyr-elf
cd ../../
deactivate
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: 3.x
- uses: pre-commit/action@v3.0.1
scan-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- 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@v6
- 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:
needs: do-caches
runs-on: ubuntu-latest
strategy:
matrix:
CC: ["gcc", "clang"]
TLS: ["no", "openssl", "gnutls", "mbedtls", "wolfssl", "openhitls"]
steps:
- uses: actions/checkout@v6
- 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: cache openHiTLS
if: matrix.TLS == 'openhitls'
id: cache_openhitls
uses: actions/cache@v6
with:
path: ${{ runner.temp }}/openhitls-prefix
key: openhitls-${{ runner.os }}-${{ runner.arch }}-${{ env.OPENHITLS_REF }}-full
- name: install openHiTLS
if: matrix.TLS == 'openhitls'
run: |
sudo cp -a "$RUNNER_TEMP/openhitls-prefix/." /usr/local/
sudo ldconfig
- 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
examples/coap-server -? 2>&1 | head -10
build-linux2:
needs: do-caches
runs-on: ubuntu-latest
strategy:
matrix:
CC: ["gcc", "clang"]
TLS: ["mbedtls", "openhitls"]
OSCORE_ONLY: ["yes", "no"]
steps:
- uses: actions/checkout@v6
- 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: cache openHiTLS
if: matrix.TLS == 'openhitls'
id: cache_openhitls
uses: actions/cache@v6
with:
path: ${{ runner.temp }}/openhitls-prefix
key: openhitls-${{ runner.os }}-${{ runner.arch }}-${{ env.OPENHITLS_REF }}-full
- name: install openHiTLS
if: matrix.TLS == 'openhitls'
run: |
sudo cp -a "$RUNNER_TEMP/openhitls-prefix/." /usr/local/
sudo ldconfig
- name: configure OSCORE Only
if: matrix.OSCORE_ONLY == 'yes'
run: |
mkdir build-${{matrix.TLS}}-${{matrix.CC}}-${{matrix.OSCORE_ONLY}}
cd build-${{matrix.TLS}}-${{matrix.CC}}-${{matrix.OSCORE_ONLY}}
$GITHUB_WORKSPACE/configure --disable-silent-rules --disable-documentation --enable-examples --enable-tests --with-${{matrix.TLS}}-oscore --disable-dtls CC=${{matrix.CC}}
- name: configure OSCORE + DTLS
if: matrix.OSCORE_ONLY == 'no'
run: |
mkdir build-${{matrix.TLS}}-${{matrix.CC}}-${{matrix.OSCORE_ONLY}}
cd build-${{matrix.TLS}}-${{matrix.CC}}-${{matrix.OSCORE_ONLY}}
$GITHUB_WORKSPACE/configure --disable-silent-rules --disable-documentation --enable-examples --enable-tests --with-${{matrix.TLS}}-oscore --enable-dtls CC=${{matrix.CC}}
- name: compile
run: |
cd build-${{matrix.TLS}}-${{matrix.CC}}-${{matrix.OSCORE_ONLY}}
make EXTRA_CFLAGS=-Werror && make check EXTRA_CFLAGS=-Werror
- name: test
run: |
cd build-${{matrix.TLS}}-${{matrix.CC}}-${{matrix.OSCORE_ONLY}}
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
examples/coap-server -? 2>&1 | head -10
build-linux-sanitizer:
runs-on: ubuntu-latest
strategy:
matrix:
BITS: ["32", "64" ]
steps:
- uses: actions/checkout@v6
- name: setup
run: |
sudo dpkg --add-architecture i386
sudo apt-get update && sudo apt-get install -y libcunit1-dev libtool libtool-bin exuberant-ctags build-essential libc6-dev-i386 libcunit1-dev:i386
./autogen.sh
- name: configure-32
if: matrix.BITS == '32'
run: |
$GITHUB_WORKSPACE/configure --disable-silent-rules --disable-documentation --enable-examples --enable-tests --disable-dtls --enable-sanitizer --build=i386
- name: configure-64
if: matrix.BITS == '64'
run: |
$GITHUB_WORKSPACE/configure --disable-silent-rules --disable-documentation --enable-examples --enable-tests --disable-dtls --enable-sanitizer
- name: compile
run: |
make EXTRA_CFLAGS=-Werror
- name: tests
run: |
tests/testdriver
tinydtls-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
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:
needs: do-caches
runs-on: ubuntu-latest
strategy:
matrix:
TLS: ["no", "openssl", "gnutls", "mbedtls", "wolfssl", "tinydtls", "openhitls"]
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- name: setup
run: |
sudo apt-get update && sudo apt-get install -y libcunit1-dev libmbedtls-dev libgnutls28-dev libwolfssl-dev valgrind
cmake -E make_directory $GITHUB_WORKSPACE/build-${{matrix.TLS}}-cmake
- name: cache openHiTLS
if: matrix.TLS == 'openhitls'
id: cache_openhitls
uses: actions/cache@v6
with:
path: ${{ runner.temp }}/openhitls-prefix
key: openhitls-${{ runner.os }}-${{ runner.arch }}-${{ env.OPENHITLS_REF }}-full
- name: install openHiTLS
if: matrix.TLS == 'openhitls'
run: |
sudo cp -a "$RUNNER_TEMP/openhitls-prefix/." /usr/local/
sudo ldconfig
- 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' && matrix.TLS != 'mbedtls-oscore-only'
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 .
- name: test
run: |
cd $GITHUB_WORKSPACE/build-${{matrix.TLS}}-cmake
valgrind --track-origins=yes --leak-check=yes --show-reachable=yes --error-exitcode=123 --quiet --suppressions=$GITHUB_WORKSPACE/tests/valgrind_suppression ./testdriver
./coap-server -? 2>&1 | head -10
cmake-build2:
needs: do-caches
runs-on: ubuntu-latest
strategy:
matrix:
TLS: ["mbedtls", "openhitls"]
OSCORE_ONLY: ["yes", "no"]
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- name: setup
run: |
sudo apt-get update && sudo apt-get install -y libcunit1-dev libmbedtls-dev libgnutls28-dev libwolfssl-dev valgrind
cmake -E make_directory $GITHUB_WORKSPACE/build-${{matrix.TLS}}-${{matrix.OSCORE_ONLY}}-cmake
- name: cache openHiTLS
if: matrix.TLS == 'openhitls'
id: cache_openhitls
uses: actions/cache@v6
with:
path: ${{ runner.temp }}/openhitls-prefix
key: openhitls-${{ runner.os }}-${{ runner.arch }}-${{ env.OPENHITLS_REF }}-full
- name: install openHiTLS
if: matrix.TLS == 'openhitls'
run: |
sudo cp -a "$RUNNER_TEMP/openhitls-prefix/." /usr/local/
sudo ldconfig
- name: configure OSCORE Only
if: matrix.OSCORE_ONLY == 'yes'
run: |
cd $GITHUB_WORKSPACE/build-${{matrix.TLS}}-${{matrix.OSCORE_ONLY}}-cmake
cmake $GITHUB_WORKSPACE -DENABLE_EXAMPLES=ON -DENABLE_TESTS=ON -DOSCORE_BACKEND=${{matrix.TLS}} -DENABLE_DTLS=OFF -DENABLE_DOCS=OFF -DWARNING_TO_ERROR=ON
- name: configure OSCORE and DTLS
if: matrix.OSCORE_ONLY == 'no'
run: |
cd $GITHUB_WORKSPACE/build-${{matrix.TLS}}-${{matrix.OSCORE_ONLY}}-cmake
cmake $GITHUB_WORKSPACE -DENABLE_EXAMPLES=ON -DENABLE_TESTS=ON -DOSCORE_BACKEND=${{matrix.TLS}} -DENABLE_DTLS=ON -DENABLE_DOCS=OFF -DWARNING_TO_ERROR=ON
- name: build
run: |
cd $GITHUB_WORKSPACE/build-${{matrix.TLS}}-${{matrix.OSCORE_ONLY}}-cmake
cmake --build .
- name: test
run: |
cd $GITHUB_WORKSPACE/build-${{matrix.TLS}}-${{matrix.OSCORE_ONLY}}-cmake
valgrind --track-origins=yes --leak-check=yes --show-reachable=yes --error-exitcode=123 --quiet --suppressions=$GITHUB_WORKSPACE/tests/valgrind_suppression ./testdriver
./coap-server -? 2>&1 | head -10
cmake-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v6
- 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@v6
- name: install macOS software
run: |
brew trust aws/tap
brew install make automake libtool
- name: compile
run: |
gmake -C examples/contiki
other-build:
needs: do-caches
runs-on: ubuntu-latest
strategy:
matrix:
OS: ["contiki", "lwip", "riot", "zephyr"]
steps:
- uses: actions/checkout@v6
- name: setup
run: |
sudo apt-get update && sudo apt-get install -y libc6-dev-i386 lib32stdc++-13-dev
- name: cache Contiki
if: matrix.OS == 'contiki'
id: cache_contiki_ng
uses: actions/cache@v6
with:
path: ${{ runner.temp }}/download/contiki-ng
key: contiki-${{ runner.os }}-${{ runner.arch }}-${{ env.WITH_CONTIKI_NG_BRANCH }}-full
- name: install Contiki
if: matrix.OS == 'contiki'
run: |
(cd "$RUNNER_TEMP/download/contiki-ng" ; git describe --tags --all)
rm -f examples/contiki/contiki-ng
mkdir -p examples/contiki
cp -a $RUNNER_TEMP/download/contiki-ng examples/contiki
cd examples/contiki/contiki-ng/os/net/app-layer && rm -rf libcoap && ln -s ../../../../../.. libcoap
- name: cache LwIP
if: matrix.OS == 'lwip'
id: cache_lwip
uses: actions/cache@v6
with:
path: ${{ runner.temp }}/download/lwip
key: lwip-${{ runner.os }}-${{ runner.arch }}-${{ env.WITH_LWIP_BRANCH }}-full
- name: install LwIP
if: matrix.OS == 'lwip'
run: |
(cd "$RUNNER_TEMP/download/lwip" ; git describe --tags --all)
rm -f examples/lwip/lwip
mkdir -p examples/lwip
cp -a $RUNNER_TEMP/download/lwip examples/lwip
- name: cache Zephyr
if: matrix.OS == 'zephyr'
id: cache_zephyr
uses: actions/cache@v6
with:
path: ${{ runner.temp }}/download/zephyrproject
key: zephyr-${{ runner.os }}-${{ runner.arch }}-${{ env.WITH_ZEPHYR_BRANCH }}-full
- name: install Zephyr
if: matrix.OS == 'zephyr'
run: |
rm -f examples/zephyr/zephyrproject
mkdir -p examples/zephyr/zephyrproject
cp -a $RUNNER_TEMP/download/zephyrproject examples/zephyr
(cd examples/zephyr/zephyrproject/zephyr/zephyr-sdk* ; cmake -P cmake/zephyr_sdk_export.cmake)
- name: compile
run: |
make -C examples/${{matrix.OS}} EXTRA_CFLAGS=-Werror
ms-build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v3
- 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@v6
- 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 -DENABLE_THREAD_SAFE=OFF
- name: MS CMake build
run: |
cd build_test
cmake --build .
mingw-cmake:
runs-on: windows-latest
strategy:
matrix:
OS: ["UCRT64", "CLANG64", "MINGW64", "MINGW32"]
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v6
- name: Environment Setup
shell: bash
run: |
if [ "${{matrix.OS}}" = "UCRT64" ]; then
mingw_var="ucrt-x86_64"
elif [ "${{matrix.OS}}" = "CLANG64" ]; then
mingw_var="clang-x86_64"
elif [ "${{matrix.OS}}" = "MINGW64" ]; then
mingw_var="x86_64"
elif [ "${{matrix.OS}}" = "MINGW32" ]; then
mingw_var="i686"
else
echo "Unsupported MinGW variant: ${{matrix.OS}}"
mingw_var=""
fi
echo "MINGW_VARIANT=${mingw_var}" >> $GITHUB_ENV
- uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.OS}}
update: true
install: git mingw-w64-${{env.MINGW_VARIANT}}-gcc mingw-w64-${{env.MINGW_VARIANT}}-cmake mingw-w64-${{env.MINGW_VARIANT}}-openssl
- name: MinGW ${{matrix.OS}} build
run: |
echo 'Running in MSYS2 ${{matrix.OS}}!'
scripts/mingw-cmake.sh
additional-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
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 EXTRA_CFLAGS=-Werror -C tests/oss-fuzz -f Makefile.ci check clean
documentation:
runs-on: ubuntu-latest
needs: pre-commit
steps:
- uses: actions/checkout@v6
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 pre-commit
./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-tarball:
needs: do-caches
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- name: setup
run: |
sudo apt-get install -y exuberant-ctags
./autogen.sh
- name: configure
run: |
mkdir build-dist
cd build-dist
$GITHUB_WORKSPACE/configure --enable-silent-rules --disable-documentation --enable-examples --disable-dtls
- name: cache tarball
id: cache_tarball
uses: actions/cache@v6
with:
path: ${{ runner.temp }}/libcoap-*.tar.bz2
key: cache-${{ github.run_id }}
- name: build distribution
run: |
cd build-dist
make dist
cp -f libcoap-*.tar.bz2 ${{ runner.temp }}
distribution-builds:
needs: distribution-tarball
runs-on: ubuntu-latest
strategy:
matrix:
BUILD: ["contiki", "lwip", "riot", "zephyr", "autogen", "cmake"]
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- uses: actions/checkout@v6
- name: setup other
if: matrix.BUILD == 'contiki' || matrix.BUILD == 'lwip' || matrix.BUILD == 'riot' || matrix.BUILD == 'zephyr'
run: |
sudo apt-get update && sudo apt-get install -y libc6-dev-i386 lib32stdc++-13-dev
- name: setup autogen
if: matrix.BUILD == 'autogen'
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
- name: setup cmake
if: matrix.BUILD == 'cmake'
run: |
sudo apt-get update && sudo apt-get install -y libc6-dev-i386 lib32stdc++-13-dev libcunit1-dev
- name: restore tarball
id: cache_tarball
uses: actions/cache@v6
with:
path: ${{ runner.temp }}/libcoap-*.tar.bz2
key: cache-${{ github.run_id }}
- name: cache Contiki
if: matrix.BUILD == 'contiki'
id: cache_contiki_ng
uses: actions/cache@v6
with:
path: ${{ runner.temp }}/download/contiki-ng
key: contiki-${{ runner.os }}-${{ runner.arch }}-${{ env.WITH_CONTIKI_NG_BRANCH }}-full
- name: cache LwIP
if: matrix.BUILD == 'lwip'
id: cache_lwip
uses: actions/cache@v6
with:
path: ${{ runner.temp }}/download/lwip
key: lwip-${{ runner.os }}-${{ runner.arch }}-${{ env.WITH_LWIP_BRANCH }}-full
- name: cache Zephyr
if: matrix.BUILD == 'zephyr'
id: cache_zephyr
uses: actions/cache@v6
with:
path: ${{ runner.temp }}/download/zephyrproject
key: zephyr-${{ runner.os }}-${{ runner.arch }}-${{ env.WITH_ZEPHYR_BRANCH }}-full
- name: check distribution build
run: |
./autogen.sh
mkdir -p build-dist
cd build-dist
cp -f ${{ runner.temp }}/libcoap-*.tar.bz2 .
$GITHUB_WORKSPACE/scripts/github_dist.sh ${{matrix.BUILD}}
shell: bash