]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
Import workflow definitions from `main`.
authorFlorian Forster <octo@collectd.org>
Tue, 28 Nov 2023 10:06:22 +0000 (11:06 +0100)
committerFlorian Forster <octo@collectd.org>
Wed, 29 Nov 2023 20:56:19 +0000 (21:56 +0100)
.cirrus.yml
.github/workflows/build.yml
.github/workflows/distcheck.yml [new file with mode: 0644]

index 469ec35012a7cbf2c2b062ae98e06361fd9a824c..ab37691096f0724f5bd0e0ab31168c01e030cacb 100644 (file)
@@ -1,52 +1,7 @@
 env:
   LANG: C
   CIRRUS_CLONE_DEPTH: 1
-  DEFAULT_CONFIG_OPTS: >-
-          --disable-aggregation
-          --disable-amqp
-          --disable-amqp1
-          --disable-barometer
-          --disable-check_uptime
-          --disable-csv
-          --disable-curl_xml
-          --disable-gmond
-          --disable-grpc
-          --disable-java
-          --disable-lua
-          --disable-match_empty_counter
-          --disable-match_hashed
-          --disable-match_regex
-          --disable-match_timediff
-          --disable-match_value
-          --disable-modbus
-          --disable-mqtt
-          --disable-network
-          --disable-openldap
-          --disable-perl
-          --disable-postgresql
-          --disable-python
-          --disable-redis
-          --disable-rrdcached
-          --disable-rrdtool
-          --disable-snmp
-          --disable-snmp_agent
-          --disable-statsd
-          --disable-target_notification
-          --disable-target_replace
-          --disable-target_scale
-          --disable-target_set
-          --disable-target_v5upgrade
-          --disable-threshold
-          --disable-write_graphite
-          --disable-write_kafka
-          --disable-write_mongodb
-          --disable-write_redis
-          --disable-write_riemann
-          --disable-write_sensu
-          --disable-write_syslog
-          --disable-write_tsdb
-          --enable-debug
-          --disable-dependency-tracking
+  DEFAULT_CONFIG_OPTS: --enable-debug --without-libstatgrab --disable-dependency-tracking
 
 
 ###
@@ -54,15 +9,15 @@ env:
 #
 release_ready_task:
   container:
-    image: collectd/ci:buster_amd64
+    image: collectd/ci:bookworm_amd64
   lint_script:
     - /checks/check-bashisms.sh
     - /checks/check-pod.sh
   configure_script:
     - ./build.sh
-    - ./configure $DEFAULT_CONFIG_OPTS --without-libstatgrab
+    - ./configure $DEFAULT_CONFIG_OPTS
   checks_script:
-    - make -j2 -s distcheck DISTCHECK_CONFIGURE_FLAGS="${DEFAULT_CONFIG_OPTS} --without-libstatgrab"
+    - make -j$(nproc) -s distcheck DISTCHECK_CONFIGURE_FLAGS="${DEFAULT_CONFIG_OPTS}"
 
 ###
 # Default toolchain and build flags used in deb packages, on a range of Debian
@@ -72,44 +27,29 @@ release_ready_task:
 debian_default_toolchain_task:
   matrix:
     - container:
-        image: collectd/ci:buster_amd64
+        image: collectd/ci:bookworm_amd64
       allow_failures: false
     - container:
-        image: collectd/ci:stretch_amd64
+        image: collectd/ci:mantic_amd64
       allow_failures: false
     - container:
-        image: collectd/ci:stretch_i386
-      allow_failures: false
-    - container:
-        image: collectd/ci:xenial_amd64
-      allow_failures: false
-    - container:
-        image: collectd/ci:bionic_amd64
-      allow_failures: false
-    - container:
-        image: collectd/ci:focal_amd64
-      allow_failures: false
-      # debian/unstable is expected to fail
-    - allow_failures: true
+        image: collectd/ci:debian_unstable
+      allow_failures: true
       skip_notifications: true
-      only_if: $CIRRUS_BRANCH == 'master'
-      container:
-        image: collectd/ci:sid_amd64
+      only_if: $CIRRUS_BRANCH == 'main'
   configure_script:
     - ./build.sh
     - gcc --version
     - >
-      ./configure CC=gcc $DEFAULT_CONFIG_OPTS --without-libstatgrab
+      ./configure CC=gcc $DEFAULT_CONFIG_OPTS
       CFLAGS="$(dpkg-buildflags --get CFLAGS)"
       CPPLAGS="$(dpkg-buildflags --get CPPFLAGS)"
       LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"
   build_script:
-    - make -j2 -sk
+    - make -j$(nproc) -sk
   tests_script:
-    - VALGRIND_OPTS="--errors-for-leak-kinds=definite" make -j2 -sk check
-    #- /checks/check-built-plugins.sh
-  on_failure:
-    debug_script: cat test-suite.log || true
+    - VALGRIND_OPTS="--errors-for-leak-kinds=definite" make -j$(nproc) -sk check || (cat ./test-suite.log && false)
+    - /checks/check-built-plugins.sh
 
 ###
 # Default toolchain and build flags used in RPM packages, on a range of RedHat
@@ -118,31 +58,26 @@ debian_default_toolchain_task:
 #
 redhat_default_toolchain_task:
   matrix:
-    - allow_failures: true
-      skip_notifications: true
-      container:
-        image: collectd/ci:el7_x86_64 # TODO: fix this platform
-    - allow_failures: true
-      skip_notifications: true
-      container:
-        image: collectd/ci:fedora28_x86_64
-    # fedora/rawhide is expected to fail
-    - allow_failures: true
-      skip_notifications: true
-      only_if: $CIRRUS_BRANCH == 'master'
-      container:
+    - container:
+        image: collectd/ci:el9_x86_64
+      allow_failures: false
+    - container:
+        image: collectd/ci:fedora39
+      allow_failures: false
+    - container:
         image: collectd/ci:fedora_rawhide_x86_64
+      allow_failures: true
+      skip_notifications: true
+      only_if: $CIRRUS_BRANCH == 'main'
   configure_script:
     - ./build.sh
     - gcc --version
-    - ./configure CC=gcc $DEFAULT_CONFIG_OPTS --without-libstatgrab CFLAGS="$(rpm --eval '%optflags')"
+    - ./configure CC=gcc $DEFAULT_CONFIG_OPTS CFLAGS="$(rpm --eval '%optflags')"
   build_script:
-    - make -j2 -sk
+    - make -j$(nproc) -sk
   tests_script:
-    - VALGRIND_OPTS="--errors-for-leak-kinds=definite" make -j2 -sk check
-    #- /checks/check-built-plugins.sh
-  on_failure:
-    debug_script: cat test-suite.log || true
+    - VALGRIND_OPTS="--errors-for-leak-kinds=definite" make -j$(nproc) -sk check || (cat ./test-suite.log && false)
+    - /checks/check-built-plugins.sh
 
 
 ###
@@ -151,7 +86,7 @@ redhat_default_toolchain_task:
 # Some are expected to fail, others should always pass
 non_standard_toolchains_task:
   container:
-    image: collectd/ci:stretch_amd64
+    image: collectd/ci:bookworm_amd64
   only_if: $CIRRUS_PR == ''
 
   matrix:
@@ -166,17 +101,14 @@ non_standard_toolchains_task:
         - clang --version
         - >
           ./configure CC=clang CXX=clang++
-          $DEFAULT_CONFIG_OPTS --without-libstatgrab
+          $DEFAULT_CONFIG_OPTS
           CFLAGS="$(dpkg-buildflags --get CFLAGS)"
           CPPLAGS="$(dpkg-buildflags --get CPPFLAGS)"
           LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"
       build_script:
-        - make -j2 -sk
+        - make -j$(nproc) -sk
       tests_script:
-        - VALGRIND_OPTS="--errors-for-leak-kinds=definite" make -j2 -sk check
-      on_failure:
-        debug_script: cat test-suite.log || true
-
+        - VALGRIND_OPTS="--errors-for-leak-kinds=definite" make -j$(nproc) -sk check || (cat ./test-suite.log && false)
 
     # build against libstatgrab, should always pass
     - env:
@@ -187,12 +119,12 @@ non_standard_toolchains_task:
         - ./build.sh
         - gcc --version
         - >
-          ./configure $DEFAULT_CONFIG_OPTS --with-libstatgrab
+          ./configure --with-libstatgrab --enable-debug
           CFLAGS="$(dpkg-buildflags --get CFLAGS)"
           CPPLAGS="$(dpkg-buildflags --get CPPFLAGS)"
           LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"
       build_script:
-        - make -j2 -sk
+        - make -j$(nproc) -sk
       tests_script:
         - >
           for i in cpu disk interface load memory swap users; do
@@ -213,7 +145,7 @@ non_standard_toolchains_task:
         - clang --version
         - >
           ./configure CC=clang CXX=clang++
-          $DEFAULT_CONFIG_OPTS --without-libstatgrab
+          $DEFAULT_CONFIG_OPTS
           CFLAGS='-Wall
           -Wno-error
           -Wextra
@@ -239,11 +171,9 @@ non_standard_toolchains_task:
           -Wno-typedef-redefinition
           -Wno-gnu-variable-sized-type-not-at-end'
       build_script:
-        - make -j2 -sk
+        - make -j$(nproc) -sk
       tests_script:
-        - VALGRIND_OPTS="--errors-for-leak-kinds=definite" make -j2 -sk check
-      on_failure:
-        debug_script: cat test-suite.log || true
+        - VALGRIND_OPTS="--errors-for-leak-kinds=definite" make -j$(nproc) -sk check || (cat ./test-suite.log && false)
 
 ###
 # Build using a range of compilers, available in debian/unstable. NB: might
@@ -251,30 +181,46 @@ non_standard_toolchains_task:
 #
 bleeding_edge_compilers_task:
   container:
-    image: collectd/ci:sid_amd64
-  only_if: $CIRRUS_BRANCH == 'master'
+    image: collectd/ci:debian_unstable
+  only_if: $CIRRUS_BRANCH == 'main'
   allow_failures: true
   skip_notifications: true
   env:
     matrix:
-      CC: gcc-7
-      CC: gcc-8
-      CC: clang-6.0
-      CC: clang-7
-      CC: clang-8
-      CC: clang-9
+      CC: gcc-10
+      CC: clang
+      CC: clang-18
+      CC: clang-17
   configure_script:
     - ./build.sh
     - $CC --version
     - >
       ./configure CC=$CC
-      $DEFAULT_CONFIG_OPTS --without-libstatgrab
+      $DEFAULT_CONFIG_OPTS
       CFLAGS="$(dpkg-buildflags --get CFLAGS)"
       CPPLAGS="$(dpkg-buildflags --get CPPFLAGS)"
       LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"
   build_script:
-    - make -j2 -sk
+    - make -j$(nproc) -sk
+  tests_script:
+    - VALGRIND_OPTS="--errors-for-leak-kinds=definite" make -j$(nproc) -sk check || (cat ./test-suite.log && false)
+
+freebsd_task:
+  freebsd_instance:
+    matrix:
+      - image_family: freebsd-13-2
+  allow_failures: false
+  pkg_install_script:
+    - >
+      pkg install --yes
+      autotools
+      bison
+      flex
+      pkgconf
+  configure_script:
+    - ./build.sh
+    - ./configure --disable-perl
+  build_script:
+    - make -j$(nproc) -sk
   tests_script:
-    - VALGRIND_OPTS="--errors-for-leak-kinds=definite" make -j2 -sk check
-  on_failure:
-    debug_script: cat test-suite.log || true
+    - VALGRIND_OPTS="--errors-for-leak-kinds=definite" make -j$(nproc) -sk check || (cat ./test-suite.log && false)
index 1891c1f4bf1eeb6a540ffdfd8ce5ad4eff577c49..85e12ef1e44f95165047a924dfe1cce45ca76fde 100644 (file)
@@ -17,79 +17,34 @@ jobs:
   build:
     runs-on: ubuntu-latest
     container: collectd/ci:${{ matrix.container_tag }}
-    continue-on-error: ${{ matrix.allow_failures }}
+    continue-on-error: false
     strategy:
       fail-fast: false
       matrix:
-        # for tasks that are optional, use the continue-on-error option, to prevent a workflow from failing when the task fails
-        allow_failures: [ false ]
         container_tag:
           # debian family
+          - bookworm_amd64
           - bullseye_amd64
           - buster_amd64
-          - stretch_amd64
-          - stretch_i386
           # Ubuntu
-          - xenial_amd64
-          - bionic_amd64
+          - mantic_amd64
+          - jammy_amd64
           - focal_amd64
+          - bionic_amd64
           # RedHat family
           - el9_x86_64
-          - el8_x86_64
-          - el7_x86_64
-          - fedora36_x86_64
-          - fedora35_x86_64
-          - fedora34_x86_64
-        config_flags: ['']
-
+          - fedora39
+          - fedora38_x86_64
+        configure_flags: ['']
+        include:
+          - container_tag: bookworm_amd64
+            configure_flags: '--enable-debug'
+          - container_tag: bookworm_amd64
+            # By default clang emits DWARF v5, which Valgrind cannot read yet.
+            # https://github.com/llvm/llvm-project/issues/56550
+            configure_flags: 'CC=clang CXX=clang++ CFLAGS=-gdwarf-4'
     env:
-      MAKEFLAGS: "-j2 -sk"
-      CONFIGURE_FLAGS: >-
-        ${{ matrix.config_flags }}
-        --disable-aggregation
-        --disable-amqp
-        --disable-amqp1
-        --disable-barometer
-        --disable-check_uptime
-        --disable-csv
-        --disable-curl_xml
-        --disable-gmond
-        --disable-grpc
-        --disable-java
-        --disable-lua
-        --disable-match_empty_counter
-        --disable-match_hashed
-        --disable-match_regex
-        --disable-match_timediff
-        --disable-match_value
-        --disable-modbus
-        --disable-mqtt
-        --disable-network
-        --disable-openldap
-        --disable-perl
-        --disable-postgresql
-        --disable-python
-        --disable-redis
-        --disable-rrdcached
-        --disable-rrdtool
-        --disable-snmp
-        --disable-snmp_agent
-        --disable-statsd
-        --disable-target_notification
-        --disable-target_replace
-        --disable-target_scale
-        --disable-target_set
-        --disable-target_v5upgrade
-        --disable-threshold
-        --disable-write_graphite
-        --disable-write_kafka
-        --disable-write_mongodb
-        --disable-write_redis
-        --disable-write_riemann
-        --disable-write_sensu
-        --disable-write_syslog
-        --disable-write_tsdb
-
+      CONFIGURE_FLAGS: ${{ matrix.configure_flags }}
       # this env var picked up by valgrind during make check phase
       VALGRIND_OPTS: "--errors-for-leak-kinds=definite"
     steps:
@@ -101,19 +56,26 @@ jobs:
         ./build.sh
     - name: Run configure script
       run: ./configure $CONFIGURE_FLAGS
+    - name: Upload config.log
+      uses: actions/upload-artifact@v3
+      with:
+        name: ${{ matrix.container_tag }}
+        path: config.log
     - name: Build collectd
-      run: make $MAKEFLAGS
+      run: make -j$(nproc) -sk
     - name: Run make check
-      run: make $MAKEFLAGS check
-    - name: Dump test logs
-      run: |
-          cat ./test-suite.log || true
-    - name: Install bzip2
-      run: |
-        yum install -y bzip2 || apt install -y bzip2
-    - name: Run make distcheck
       run: |
-        make $MAKEFLAG distcheck DISTCHECK_CONFIGURE_FLAGS="--disable-dependency-tracking --enable-debug $CONFIGURE_FLAGS"
+        set +e
+        make $MAKEFLAGS check
+        echo "$?" >make-check.status
+      continue-on-error: true
+    - name: Upload log files
+      uses: actions/upload-artifact@v3
+      with:
+        name: ${{ matrix.container_tag }}
+        path: "*.log"
+    - name: Report check status
+      run: exit $(< make-check.status)
 
   experimental:
     runs-on: ubuntu-20.04
@@ -124,67 +86,21 @@ jobs:
       matrix:
         # for tasks that are optional, use the continue-on-error option, to prevent a workflow from failing when the task fails
         container_tag:
-          - sid_amd64
+          - debian_unstable
           - fedora_rawhide_x86_64
         # Add additional per-distro vars here.
         include:
-          - container_tag: sid_amd64
-            config_flags: "--disable-dpdkstat --disable-dpdkevents --disable-virt"
+          - container_tag: debian_unstable
+            configure_flags: "--disable-dpdkstat --disable-dpdkevents --disable-virt"
           - container_tag: fedora_rawhide_x86_64
             cflags: "-fPIE -Wno-deprecated-declarations"
             cppflags: "-fPIE -Wno-deprecated-declarations"
-            config_flags: "--disable-dpdkstat --disable-dpdkevents --disable-virt --disable-xmms"
+            configure_flags: "--disable-dpdkstat --disable-dpdkevents --disable-virt --disable-xmms"
     env:
-      MAKEFLAGS: "-j2 -sk"
       CFLAGS: ${{ matrix.cflags }}
       CPPFLAGS: ${{ matrix.cppflags }}
+      CONFIGURE_FLAGS: ${{ matrix.configure_flags }}
       VALGRIND_OPTS: "--errors-for-leak-kinds=definite"
-      CONFIGURE_FLAGS: >-
-        ${{ matrix.config_flags }}
-        --disable-aggregation
-        --disable-amqp
-        --disable-amqp1
-        --disable-barometer
-        --disable-check_uptime
-        --disable-csv
-        --disable-curl_xml
-        --disable-gmond
-        --disable-grpc
-        --disable-java
-        --disable-lua
-        --disable-match_empty_counter
-        --disable-match_hashed
-        --disable-match_regex
-        --disable-match_timediff
-        --disable-match_value
-        --disable-modbus
-        --disable-mqtt
-        --disable-network
-        --disable-openldap
-        --disable-perl
-        --disable-postgresql
-        --disable-python
-        --disable-redis
-        --disable-rrdcached
-        --disable-rrdtool
-        --disable-snmp
-        --disable-snmp_agent
-        --disable-statsd
-        --disable-target_notification
-        --disable-target_replace
-        --disable-target_scale
-        --disable-target_set
-        --disable-target_v5upgrade
-        --disable-threshold
-        --disable-write_graphite
-        --disable-write_kafka
-        --disable-write_mongodb
-        --disable-write_redis
-        --disable-write_riemann
-        --disable-write_sensu
-        --disable-write_syslog
-        --disable-write_tsdb
-
     steps:
     - uses: actions/checkout@v2
     - run: type pkg-config
@@ -194,19 +110,23 @@ jobs:
         ./build.sh
     - name: Run configure script
       run: ./configure $CONFIGURE_FLAGS
+    - name: Upload config.log
+      uses: actions/upload-artifact@v3
+      with:
+        name: ${{ matrix.container_tag }}
+        path: config.log
     - name: Build collectd
-      run: make $MAKEFLAGS
+      run: make -j$(nproc) -sk
     - name: Run make check
-      # Make check is failing on a few newer distros, temporarily mark it as optional until that is resolved 
-      continue-on-error: true
-      run: make $MAKEFLAGS check
-    - name: Dump test logs
-      run: |
-          cat ./test-suite.log || true
-    - name: Install bzip2
       run: |
-        yum install -y bzip2 || apt install -y bzip2
-    - name: Run make distcheck
-      run: |
-        make $MAKEFLAGS distcheck DISTCHECK_CONFIGURE_FLAGS="--disable-dependency-tracking --enable-debug $CONFIGURE_FLAGS"
-
+        set +e
+        make $MAKEFLAGS check
+        echo "$?" >make-check.status
+      continue-on-error: true
+    - name: Upload log files
+      uses: actions/upload-artifact@v3
+      with:
+        name: ${{ matrix.container_tag }}
+        path: "*.log"
+    - name: Report check status
+      run: exit $(< make-check.status)
diff --git a/.github/workflows/distcheck.yml b/.github/workflows/distcheck.yml
new file mode 100644 (file)
index 0000000..545b664
--- /dev/null
@@ -0,0 +1,34 @@
+name: Check the Distribution
+
+on:
+  push:
+    branches: [ collectd-6.0 ]
+  pull_request:
+    branches: [ collectd-6.0 ]
+
+permissions:
+  contents: read
+
+defaults:
+  run:
+    shell: bash
+
+jobs:
+  make_distcheck:
+    runs-on: ubuntu-latest
+    container: collectd/ci:bullseye_amd64
+    env:
+      # this env var picked up by valgrind during make check phase
+      VALGRIND_OPTS: "--errors-for-leak-kinds=definite"
+    steps:
+    - uses: actions/checkout@v4
+    - name: Install bzip2
+      run: apt install -y bzip2
+    - name: Print available packages
+      run: pkg-config --list-all | sort
+    - name: Generate configure script
+      run: ./build.sh
+    - name: Run configure script
+      run: ./configure
+    - name: Run make distcheck
+      run: make $MAKEFLAG distcheck