]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
CI tests for build and install of DEBs and RPMs
authorTerry Burton <tez@terryburton.co.uk>
Wed, 2 Dec 2020 03:47:16 +0000 (03:47 +0000)
committerMatthew Newton <matthew-git@newtoncomputing.co.uk>
Fri, 4 Dec 2020 02:26:46 +0000 (02:26 +0000)
.github/workflows/ci-deb.yml [new file with mode: 0644]
.github/workflows/ci-rpm.yml [new file with mode: 0644]

diff --git a/.github/workflows/ci-deb.yml b/.github/workflows/ci-deb.yml
new file mode 100644 (file)
index 0000000..26db52c
--- /dev/null
@@ -0,0 +1,109 @@
+name: CI DEB
+
+on:
+  push:
+    branches-ignore:
+      - coverity_scan
+  pull_request:
+
+env:
+  CI: 1
+  GH_ACTIONS: 1
+  DEBIAN_FRONTEND: noninteractive
+
+jobs:
+  deb-build:
+
+    runs-on: ubuntu-latest
+
+    container:
+      image: debian:buster
+
+    name: "DEB build"
+
+    steps:
+
+    - name: Package manager performance improvements
+      run: |
+        echo force-unsafe-io > /etc/dpkg/dpkg.cfg.d/02speedup
+        echo 'man-db man-db/auto-update boolean false' | debconf-set-selections
+
+    - name: Install recent git
+      run: |
+        apt-get update
+        apt-get install -y git
+
+    - uses: actions/checkout@v2
+      with:
+        repository: mheily/libkqueue
+        path: libkqueue
+
+    - name: Install build tools
+      run: |
+        apt-get install -y cmake make gcc file
+
+    - name: Build libkqueue
+      run: |
+        cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib ./
+        make
+        cpack -G DEB
+        dpkg -i --force-all ./libkqueue*.deb
+      working-directory: libkqueue
+
+    - uses: actions/checkout@v2
+      with:
+        path: freeradius
+
+    - name: Install build dependencies
+      run: |
+        apt-get install -y build-essential devscripts quilt
+        debian/rules debian/control
+        mk-build-deps -irt"apt-get -y" debian/control ;
+      working-directory: freeradius
+
+    - name: Build DEBs
+      run: |
+        make deb
+        mkdir debs
+      working-directory: freeradius
+
+    - name: Collect DEBs
+      run: |
+        mkdir debs
+        mv libkqueue/*.deb debs
+        mv *.deb debs
+
+    - name: Store DEBs
+      uses: actions/upload-artifact@v2
+      with:
+        name: debs
+        path: debs
+
+  deb-test:
+
+    needs:
+      - deb-build
+
+    runs-on: ubuntu-latest
+
+    container:
+      image: debian:buster
+
+    name: "DEB install test"
+
+    steps:
+
+    - name: Load DEBs
+      uses: actions/download-artifact@v2
+      with:
+        name: debs
+
+    - name: Install DEBs
+      run: |
+        apt-get update
+        find . -maxdepth 1 -name '*.deb' | xargs apt-get install -y
+
+    - name: Startup test
+      run: |
+        freeradius -XC
+
diff --git a/.github/workflows/ci-rpm.yml b/.github/workflows/ci-rpm.yml
new file mode 100644 (file)
index 0000000..aa1c926
--- /dev/null
@@ -0,0 +1,129 @@
+name: CI RPM
+
+on:
+  push:
+    branches-ignore:
+      - coverity_scan
+  pull_request:
+
+env:
+  CI: 1
+  GH_ACTIONS: 1
+
+jobs:
+  rpm-build:
+
+    runs-on: ubuntu-latest
+
+    container:
+      image: centos:8
+
+    name: "RPM build"
+
+    steps:
+
+    - name: Install recent git
+      run: |
+        yum install -y git
+
+    - uses: actions/checkout@v2
+      with:
+        repository: mheily/libkqueue
+        path: libkqueue
+
+    - name: Install build tools
+      run: |
+        yum install -y cmake make gcc rpm-build
+
+    - name: Build libkqueue
+      run: |
+        cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib ./
+        make
+        cpack -G RPM
+        yum localinstall -y *.rpm
+      working-directory: libkqueue
+
+    - uses: actions/checkout@v2
+      with:
+        path: freeradius
+
+    - name: Extra repos
+      run: |
+        echo '[ltb-project]' >> /etc/yum.repos.d/ltb-project.repo
+        echo 'name=LTB project packages' >> /etc/yum.repos.d/ltb-project.repo
+        echo 'baseurl=https://ltb-project.org/rpm/$releasever/$basearch' >> /etc/yum.repos.d/ltb-project.repo
+        echo 'enabled=1' >> /etc/yum.repos.d/ltb-project.repo
+        echo 'gpgcheck=1' >> /etc/yum.repos.d/ltb-project.repo
+        echo 'gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-LTB-project' >> /etc/yum.repos.d/ltb-project.repo
+        rpm --import https://ltb-project.org/lib/RPM-GPG-KEY-LTB-project
+        yum install -y epel-release yum-utils
+        yum config-manager --enable PowerTools
+
+    - name: Install build dependencies
+      run: |
+        yum install -y \
+          bzip2 \
+          gcc \
+          libcurl-devel \
+          make \
+          perl \
+          rpm-build \
+          yum-utils
+        yum-builddep -y freeradius/redhat/freeradius.spec
+
+    - name: Build RPMs
+      run: |
+        make rpm
+      working-directory: freeradius
+
+    - name: Collect RPMs
+      run: |
+        mkdir rpms
+        mv libkqueue/*.rpm rpms
+        mv freeradius/rpmbuild/RPMS/x86_64/*.rpm rpms
+
+    - name: Store RPMs
+      uses: actions/upload-artifact@v2
+      with:
+        name: rpms
+        path: rpms
+
+  rpm-test:
+
+    needs:
+      - rpm-build
+
+    runs-on: ubuntu-latest
+
+    container:
+      image: centos:8
+
+    name: "RPM install test"
+
+    steps:
+
+    - name: Extra repos
+      run: |
+        echo '[ltb-project]' >> /etc/yum.repos.d/ltb-project.repo
+        echo 'name=LTB project packages' >> /etc/yum.repos.d/ltb-project.repo
+        echo 'baseurl=https://ltb-project.org/rpm/$releasever/$basearch' >> /etc/yum.repos.d/ltb-project.repo
+        echo 'enabled=1' >> /etc/yum.repos.d/ltb-project.repo
+        echo 'gpgcheck=1' >> /etc/yum.repos.d/ltb-project.repo
+        echo 'gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-LTB-project' >> /etc/yum.repos.d/ltb-project.repo
+        rpm --import https://ltb-project.org/lib/RPM-GPG-KEY-LTB-project
+        yum install -y epel-release yum-utils
+        yum config-manager --enable PowerTools
+
+    - name: Load RPMs
+      uses: actions/download-artifact@v2
+      with:
+        name: rpms
+
+    - name: Install RPMs
+      run: |
+        yum install -y *.rpm
+
+    - name: Startup test
+      run: |
+        radiusd -XC
+