From: Terry Burton Date: Wed, 18 Nov 2020 01:22:09 +0000 (+0000) Subject: Add a GitHub Actions workflow X-Git-Tag: release_3_0_22~339 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=daa17cf6414ef2b3a7e067fcc74c6dcbf299e8ca;p=thirdparty%2Ffreeradius-server.git Add a GitHub Actions workflow .travis.yml retained for the time being --- diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000000..4eecda9cf82 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,146 @@ +name: CI + +on: + push: + branches-ignore: + - coverity_scan + pull_request: + +env: + PANIC_ACTION: "gdb -batch -x raddb/panic.gdb %e %p 1>&0 2>&0" + CI: 1 + GH_ACTIONS: 1 + +jobs: + ci: + + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + os: + - ubuntu-18.04 +# - ubuntu-20.04 + env: + - { CC: gcc, DO_BUILD: yes, LIBS_OPTIONAL: no, LIBS_SHARED: yes, REPRODUCIBLE: no, BUILD_CFLAGS: "-DWITH_EVAL_DEBUG" } + - { CC: gcc, DO_BUILD: yes, LIBS_OPTIONAL: yes, LIBS_SHARED: yes, REPRODUCIBLE: no, BUILD_CFLAGS: "-DWITH_EVAL_DEBUG" } + - { CC: gcc, DO_BUILD: yes, LIBS_OPTIONAL: yes, LIBS_SHARED: yes, REPRODUCIBLE: yes, BUILD_CFLAGS: "-DWITH_EVAL_DEBUG" } + - { CC: gcc, DO_BUILD: yes, LIBS_OPTIONAL: yes, LIBS_SHARED: yes, REPRODUCIBLE: no, BUILD_CFLAGS: "-DWITH_EVAL_DEBUG -O2 -g3" } + - { CC: clang, DO_BUILD: yes, LIBS_OPTIONAL: no, LIBS_SHARED: yes, REPRODUCIBLE: no, BUILD_CFLAGS: "-DWITH_EVAL_DEBUG" } + - { CC: clang, DO_BUILD: yes, LIBS_OPTIONAL: yes, LIBS_SHARED: yes, REPRODUCIBLE: no, BUILD_CFLAGS: "-DWITH_EVAL_DEBUG" } + - { CC: clang, DO_BUILD: yes, LIBS_OPTIONAL: yes, LIBS_SHARED: yes, REPRODUCIBLE: yes, BUILD_CFLAGS: "-DWITH_EVAL_DEBUG" } + - { CC: clang, DO_BUILD: yes, LIBS_OPTIONAL: yes, LIBS_SHARED: yes, REPRODUCIBLE: no, BUILD_CFLAGS: "-DWITH_EVAL_DEBUG -O2 -g3" } + + env: ${{ matrix.env }} + + name: "${{ matrix.os }} ${{ matrix.env.CC }} ${{ toJson(matrix.env) }}" + + steps: + + - uses: actions/checkout@v2 + + - name: Package manager performance improvements + run: | + sudo sh -c 'echo force-unsafe-io > /etc/dpkg/dpkg.cfg.d/02speedup' + echo 'man-db man-db/auto-update boolean false' | sudo debconf-set-selections + sudo dpkg-reconfigure man-db + + - name: Freshen APT repo metadata + run: | + sudo apt-get update + + - name: Install common build dependencies + run: | + sudo apt-get install -y --no-install-recommends \ + autoconf \ + build-essential \ + debhelper \ + devscripts \ + dh-make \ + fakeroot \ + firebird-dev \ + freetds-dev \ + libcap-dev \ + libcollectdclient-dev \ + libcurl4-openssl-dev \ + libgdbm-dev \ + libhiredis-dev \ + libidn11-dev \ + libiodbc2 \ + libiodbc2-dev \ + libkqueue-dev \ + libkrb5-dev \ + libldap2-dev \ + libmemcached-dev \ + libmysqlclient-dev \ + libpam0g-dev \ + libpcap-dev \ + libpcre3-dev \ + libperl-dev \ + libpq-dev \ + libreadline-dev \ + libruby \ + libsnmp-dev \ + libssl-dev \ + libtalloc-dev \ + libunbound-dev \ + libwbclient-dev \ + libykclient-dev \ + libyubikey-dev \ + lintian \ + pbuilder \ + python-dev \ + python3-dev \ + ruby-dev \ + quilt + + - name: Install JSON build deps for 18.04 + if: ${{ matrix.os == 'ubuntu-18.04' }} + run: sudo apt-get install -y --no-install-recommends libjson-c3 + + - name: Install JSON build deps for 20.04 + if: ${{ matrix.os == 'ubuntu-20.04' }} + run: sudo apt-get install -y --no-install-recommends libjson-c4 + + - name: Install LLVM 10 for 18.04 + if: ${{ matrix.os == 'ubuntu-18.04' && matrix.env.CC == 'clang' }} + run: | + wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add + sudo apt-add-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main" + sudo apt-get install -y --no-install-recommends clang-10 llvm-10 gdb + sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-10 60 && sudo update-alternatives --set clang /usr/bin/clang-10 + sudo update-alternatives --install /usr/bin/llvm-symbolizer llvm-symbolizer /usr/bin/llvm-symbolizer-10 60 && sudo update-alternatives --set llvm-symbolizer /usr/bin/llvm-symbolizer-10 + + - name: Install LLVM 10 for 20.04 + if: ${{ matrix.os == 'ubuntu-20.04' && matrix.env.CC == 'clang' }} + run: | + wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add + sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-10 main" + sudo apt-get install -y --no-install-recommends clang-10 llvm-10 gdb + sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-10 60 && sudo update-alternatives --set clang /usr/bin/clang-10 + sudo update-alternatives --install /usr/bin/llvm-symbolizer llvm-symbolizer /usr/bin/llvm-symbolizer-10 60 && sudo update-alternatives --set llvm-symbolizer /usr/bin/llvm-symbolizer-10 + + - name: Install GCC + if: ${{ matrix.env.CC == 'gcc' }} + run: | + sudo apt-get install -y --no-install-recommends gcc gdb + + - name: Show versions + run: | + $CC --version + make --version + + - name: Build + run: | + export PATH=$(echo "$PATH" | sed -e 's#:/home/linuxbrew/[^:]\+##g') + CFLAGS="${BUILD_CFLAGS}" ./configure -C --enable-werror --prefix=$HOME/freeradius --with-shared-libs=$LIBS_SHARED --with-threads=$LIBS_OPTIONAL --with-udpfromto=$LIBS_OPTIONAL --with-openssl=$LIBS_OPTIONAL --with-pcre=$LIBS_OPTIONAL --enable-reproducible-builds=${REPRODUCIBLE} + make -j `nproc` + + - name: clang scan + run: | + make -j `nproc` scan && [ "$(find build/plist/ -name *.html)" = '' ] + if: ${{ matrix.env.CC == 'clang' }} + + - name: Test + run: make ci-test diff --git a/.travis.yml b/.travis.yml index 8761ad74472..519256cc3f2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -89,7 +89,7 @@ before_script: # Run CLANG analyzer if we're building with CLANG - if [ "${DO_BUILD}" = 'yes' -a "${COVERITY_SCAN_BRANCH}" != 1 -a ${CC} = 'clang' ]; then make -j8 scan && [ "$(find build/plist/ -name *.html)" = '' ]; fi script: - - if [ "${DO_BUILD}" = 'yes' -a "${COVERITY_SCAN_BRANCH}" != 1 ]; then make travis-test; fi + - if [ "${DO_BUILD}" = 'yes' -a "${COVERITY_SCAN_BRANCH}" != 1 ]; then make ci-test; fi # - if [ "${DO_BUILD}" = 'no' ]; then make deb; fi # Build the doxygen documentation - if [ "${DO_BUILD}" = 'no' ]; then cd doc/source; doxygen 3>&1 1>&2 2>&3 | grep -iv '^warning:' | tee doxygen_stderr.log && [ ! -n "$(cat doxygen_stderr.log)" ]; fi diff --git a/CONTRIBUTING b/CONTRIBUTING index b0895036108..65c4504e3bc 100644 --- a/CONTRIBUTING +++ b/CONTRIBUTING @@ -105,5 +105,5 @@ See README.* docs in the directories above for basic information on writing test cases. The easiest way to write new tests is to use the existing tests as examples. - Tests are run via Travis for each pull-request, and on every commit by a developer with repository - access. + Tests are run via a GitHub Actions workflow for each pull-request, and on every commit by a develope + with repository access. diff --git a/Makefile b/Makefile index a2ae131a40f..40b07d83b3a 100644 --- a/Makefile +++ b/Makefile @@ -65,7 +65,7 @@ endif endif # -# To work around OpenSSL issues with travis. +# To work around OpenSSL issues within CI. # .PHONY: raddb/test.conf: @@ -95,9 +95,9 @@ $(BUILD_DIR)/tests/radiusd-c: raddb/test.conf ${BUILD_DIR}/bin/radiusd | build.r test: ${BUILD_DIR}/bin/radiusd ${BUILD_DIR}/bin/radclient tests.unit tests.xlat tests.keywords tests.auth tests.modules $(BUILD_DIR)/tests/radiusd-c | build.raddb @$(MAKE) -C src/tests tests -#  Tests specifically for Travis.  We do a LOT more than just +#  Tests specifically for CI.  We do a LOT more than just #  the above tests -travis-test: raddb/test.conf test +ci-test: raddb/test.conf test @FR_LIBRARY_PATH=./build/lib/local/.libs/ ./build/make/jlibtool --mode=execute ./build/bin/radiusd -xxxv -n test @rm -f raddb/test.conf @$(MAKE) install diff --git a/README.rst b/README.rst index d52f64025ec..0c1e63e40e9 100644 --- a/README.rst +++ b/README.rst @@ -175,5 +175,5 @@ are available from `Network RADIUS `_. .. |CoverityStatus| image:: https://scan.coverity.com/projects/58/badge.svg? .. _CoverityStatus: https://scan.coverity.com/projects/58 -.. |BuildStatus| image:: https://travis-ci.org/FreeRADIUS/freeradius-server.png?branch=v3.0.x -.. _BuildStatus: https://travis-ci.org/FreeRADIUS/freeradius-server +.. |BuildStatus| image:: https://github.com/FreeRADIUS/freeradius-server/workflows/CI/badge.svg?branch=v3.0.x +.. _BuildStatus: https://github.com/FreeRADIUS/freeradius-server/actions?query=workflow%3ACI diff --git a/scripts/travis/Dockerfile b/scripts/ci/Dockerfile similarity index 100% rename from scripts/travis/Dockerfile rename to scripts/ci/Dockerfile diff --git a/scripts/travis/Jenkinsfile b/scripts/ci/Jenkinsfile similarity index 100% rename from scripts/travis/Jenkinsfile rename to scripts/ci/Jenkinsfile diff --git a/scripts/travis/start.sh b/scripts/ci/start.sh similarity index 97% rename from scripts/travis/start.sh rename to scripts/ci/start.sh index 1929605cdc5..04080680fa3 100644 --- a/scripts/travis/start.sh +++ b/scripts/ci/start.sh @@ -29,7 +29,7 @@ if [ "${DO_BUILD}" = 'yes' -a ${CC} = 'clang' ]; then fi if [ "${DO_BUILD}" = 'yes' ]; then - make travis-test + make ci-test fi if [ "${DO_BUILD}" = 'no' ]; then