]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add a GitHub Actions workflow
authorTerry Burton <tez@terryburton.co.uk>
Wed, 18 Nov 2020 01:22:09 +0000 (01:22 +0000)
committerAlan DeKok <aland@freeradius.org>
Wed, 18 Nov 2020 16:27:29 +0000 (11:27 -0500)
.travis.yml retained for the time being

.github/workflows/ci.yml [new file with mode: 0644]
.travis.yml
CONTRIBUTING
Makefile
README.rst
scripts/ci/Dockerfile [moved from scripts/travis/Dockerfile with 100% similarity]
scripts/ci/Jenkinsfile [moved from scripts/travis/Jenkinsfile with 100% similarity]
scripts/ci/start.sh [moved from scripts/travis/start.sh with 97% similarity]

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644 (file)
index 0000000..4eecda9
--- /dev/null
@@ -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
index 8761ad7447244a17cbe96875a4bf80e6029706a2..519256cc3f210eb13968e540605b8c76284268d1 100644 (file)
@@ -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
index b0895036108cf93df9a2a6469d36a7aaa5a837c2..65c4504e3bc9fa9de8c95836a12e638de235656e 100644 (file)
   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.
index a2ae131a40f79f80b85235eb34f8681063f5929a..40b07d83b3a40e69cb00e1636da966ab4eea9b7f 100644 (file)
--- 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
index d52f64025ec72521d8b22a8d6c83ef435e931efb..0c1e63e40e999a28139e2d74c79dcecc505b201a 100644 (file)
@@ -175,5 +175,5 @@ are available from `Network RADIUS <https://networkradius.com>`_.
 .. |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
similarity index 97%
rename from scripts/travis/start.sh
rename to scripts/ci/start.sh
index 1929605cdc56d54b73ab531461b49738bbb8d515..04080680fa3b8965e0995cc204acaafadf2899a2 100644 (file)
@@ -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