diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml new file mode 100644 index 00000000..860b5bca --- /dev/null +++ b/.github/workflows/ci-linux.yml @@ -0,0 +1,39 @@ +name: CI + +on: + push: + branches: [master] + +jobs: + build: + strategy: + matrix: + compiler: [gcc, clang] + env: + CC: ${{ matrix.compiler }} + LSAN_OPTIONS: verbosity=1:log_threads=1 + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Install deps + run: sudo apt-get install check ninja-build doxygen + + - name: Copy lwipcfg.h for example app + run: cp contrib/examples/example_app/lwipcfg.h.ci contrib/examples/example_app/lwipcfg.h + + - name: Build unit tests with make + run: make -C contrib/ports/unix/check + - name: Run unit tests + run: make -C contrib/ports/unix/check check + + - name: Run cmake + run: mkdir build && cd build && cmake .. -G Ninja + - name: Build with cmake + run: cd build && cmake --build . + - name: Build docs with cmake + run: cd build && cmake --build . --target lwipdocs + + - name: Validate combinations of options + run: cd contrib/ports/unix/example_app && ./iteropts.sh + diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4faeb6c4..00000000 --- a/.travis.yml +++ /dev/null @@ -1,42 +0,0 @@ -language: c -os: linux -sudo: required - -matrix: - include: - - compiler: gcc-7 - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - check - - libsubunit-dev - - gcc-7 - - ninja-build - - doxygen - env: - - LSAN_OPTIONS=verbosity=1:log_threads=1 - - - compiler: clang-7 - addons: - apt: - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-trusty-7 - packages: - - check - - libsubunit-dev - - clang-7 - - ninja-build - - doxygen - env: - - LSAN_OPTIONS=verbosity=1:log_threads=1 - -before_install: - # Install cmake - - wget -O cmake.sh https://cmake.org/files/v3.12/cmake-3.12.0-Linux-x86_64.sh - - sudo sh cmake.sh --skip-license --exclude-subdir --prefix=/usr/local - -script: - - ./travis.sh diff --git a/contrib/examples/example_app/lwipcfg.h.travis b/contrib/examples/example_app/lwipcfg.h.ci similarity index 100% rename from contrib/examples/example_app/lwipcfg.h.travis rename to contrib/examples/example_app/lwipcfg.h.ci diff --git a/travis.sh b/travis.sh deleted file mode 100755 index a1bff5e5..00000000 --- a/travis.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash - -RETVAL=0 - -cd contrib/ports/unix/check - -#build and run unit tests -make clean all - -# Build test using make, this tests the Makefile toolchain -make check -j 4 -ERR=$? -echo Return value from unittests: $ERR -if [ $ERR != 0 ]; then - echo "++++++++++++++++++++++++++++++ unittests build failed" - RETVAL=1 -fi - -# Build example_app using cmake, this tests the CMake toolchain -cd ../../../../ -# Copy lwipcfg for example app -cp contrib/examples/example_app/lwipcfg.h.travis contrib/examples/example_app/lwipcfg.h - -# Generate CMake -mkdir build -cd build -/usr/local/bin/cmake .. -G Ninja -ERR=$? -echo Return value from cmake generate: $ERR -if [ $ERR != 0 ]; then - echo "++++++++++++++++++++++++++++++ cmake GENERATE failed" - RETVAL=1 -fi - -# Build CMake -/usr/local/bin/cmake --build . -ERR=$? -echo Return value from build: $ERR -if [ $ERR != 0 ]; then - echo "++++++++++++++++++++++++++++++ cmake build failed" - RETVAL=1 -fi - -# Build docs -/usr/local/bin/cmake --build . --target lwipdocs -ERR=$? -echo Return value from lwipdocs: $ERR -if [ $ERR != 0 ]; then - echo "++++++++++++++++++++++++++++++ lwIP documentation failed" - RETVAL=1 -fi - -# Test different lwipopts.h -cd .. -cd contrib/ports/unix/example_app -./iteropts.sh -ERR=$? -echo Return value from iteropts: $ERR -if [ $ERR != 0 ]; then - echo "++++++++++++++++++++++++++++++ lwIP iteropts test failed" - RETVAL=1 -fi - -echo Exit value: $RETVAL -exit $RETVAL