diff --git a/.github/workflows/daily-jobs.yml b/.github/workflows/daily-jobs.yml index 3b0e0f2..2dd6215 100644 --- a/.github/workflows/daily-jobs.yml +++ b/.github/workflows/daily-jobs.yml @@ -15,14 +15,15 @@ jobs: matrix: branch: - - sid_amd64 - - fedora34_x86_64 + - debian_unstable + - fedora38_x86_64 + - fedora_rawhide_x86_64 env: SLUG: "collectd/ci:${{ matrix.branch }}" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: ref: ${{ matrix.branch }} - name: Build container @@ -31,7 +32,7 @@ jobs: - run: docker inspect "${SLUG}" - run: docker history "${SLUG}" - name: Log into the container registry - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} diff --git a/.github/workflows/merge-jobs.yml b/.github/workflows/merge-jobs.yml index 840eaa8..4db6027 100644 --- a/.github/workflows/merge-jobs.yml +++ b/.github/workflows/merge-jobs.yml @@ -1,31 +1,27 @@ -name: Merge jobs +name: Build on Push on: push: branches-ignore: - main - # topic branches (e.g. fix/something) - - '**/**' jobs: build_and_publish_container: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Get branch name + - uses: actions/checkout@v4 + - name: Determine container name run: | - export BRANCH="$(${{ github.ref }} | rev | cut -d '/' -f1 | rev ) - - run: - export SLUG="collectd/ci:${BRANCH}" + branch="$(sed -e 's#refs/heads/##' <<<"${{ github.ref }}")" + echo "SLUG=collectd/ci:${branch:?}" >>"${GITHUB_ENV}" - name: Build container - run: - docker build --pull -t "${SLUG}" . - - run: docker inspect "${SLUG}" - - run: docker history "${SLUG}" + run: docker build --pull -t "${SLUG:?}" . + - run: docker inspect "${SLUG:?}" + - run: docker history "${SLUG:?}" - run: docker images - name: Log into the container registry - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - run: docker push "${SLUG}" + - run: docker push "${SLUG:?}" diff --git a/.github/workflows/pr-jobs.yml b/.github/workflows/pr-jobs.yml index 7eeb9ac..65dd471 100644 --- a/.github/workflows/pr-jobs.yml +++ b/.github/workflows/pr-jobs.yml @@ -12,17 +12,26 @@ jobs: runs-on: ubuntu-latest env: SLUG: "collectd/ci:test" + VALGRIND_OPTS: "--errors-for-leak-kinds=definite" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Build container run: docker build -t "${SLUG}" . - - run: docker inspect "${SLUG}" + - name: Inspect container + run: docker inspect "${SLUG}" - name: Check out the latest verison of collectd - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: collectd/collectd ref: main path: ${{ github.workspace }}/collectd + - name: Create the test container + run: | + docker run -itd --name collectd-pr-test -v "${GITHUB_WORKSPACE}/collectd:/collectd" -w /collectd "${SLUG}" - name: Make sure collectd builds on the container run: | - docker run -v "${GITHUB_WORKSPACE}/collectd:/collectd" -w /collectd "${SLUG}" bash -c './build.sh && ./configure && make' + docker exec -w /collectd collectd-pr-test bash -c './build.sh && ./configure && make -sk' + - name: Run collectd unit tests + continue-on-error: true + run: | + docker exec -w /collectd collectd-pr-test make check diff --git a/.github/workflows/weekly-jobs.yml b/.github/workflows/weekly-jobs.yml index fbdb156..22195db 100644 --- a/.github/workflows/weekly-jobs.yml +++ b/.github/workflows/weekly-jobs.yml @@ -15,26 +15,31 @@ jobs: matrix: branch: # Debian + # Debian 12 + - bookworm_amd64 # Debian 11 - bullseye_amd64 # Debian 10 - buster_amd64 # Ubuntu + # Ubuntu 20.04 + - focal_amd64 + # Ubuntu 18.04 + - bionic_amd64 # Ubuntu 16.04 - xenial_amd64 # Ubuntu 14.04 - trusty_amd64 # Fedora - - fedora34_x86_64 + - fedora36_x86_64 # CentOS - - el7_x86_64 - - el8_x86_64 + - el9_x86_64 env: SLUG: "collectd/ci:${{ matrix.branch }}" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: ref: ${{ matrix.branch }} - name: Build container @@ -43,7 +48,7 @@ jobs: - run: docker inspect "${SLUG}" - run: docker history "${SLUG}" - name: Log into the container registry - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} diff --git a/README.md b/README.md index b19c19e..d852db3 100644 --- a/README.md +++ b/README.md @@ -4,29 +4,29 @@ Helper images for building collectd Here is a collection of manifests used to build the Docker images hosted at: -There is one branch per distribution/architecture pair which collectd is tested -against. Common bits are stored in the master branch, and merged into the -distro branches when needed. +There is one branch per distribution/version against which collectd is tested. +Common bits, most notably GitHub Actions, are stored in the main branch, and +merged into the distro branches when needed. Each Dockerfile contains a list of package names (mostly support libraries) to -install, and a list of plugins collectd *master* is expected to build based on +install, and a list of plugins collectd *main* is expected to build based on them. We want to stick to the official repositories, and only install packages found there, to ensure collectd releases integrate smoothly in these distributions. -Travis-CI takes care of building these images and pushing them to -cloud.docker.com. NB: Debian/sid and Fedora/rawhide built are triggered once -per day (as these distributions change constantly). You'll find the build logs -there: +GitHub Actions take care of building these images and pushing them to +`cloud.docker.com`. + +NOTE: Debian unstable ("Sid") and Fedora unstable ("Rawhide") are rebuilt daily +(as these distributions change frequently). The goal is to have the resulting images fit in the collectd project's CI, but -they are free to use for any other case. Only patches related to the CI will be -considered, though. +they are free to use for any other case. -Here's an example of how you could build collectd in an Ubuntu/Xenial -environment: -``` +Here's an example of how you can build collectd on Debian unstable: + +```shell git clone https://github.com/collectd/collectd -docker run -it --rm -v $PWD/collectd:/collectd -w /collectd collectd/ci:xenial_amd64 -./build.sh && ./configure && make && make check +docker run -it --rm -v $PWD/collectd:/collectd -w /collectd collectd/ci:debian_unstable +./build.sh && ./configure && make all check ``` diff --git a/checks/check-built-plugins.sh b/checks/check-built-plugins.sh index 147050d..a0721b1 100755 --- a/checks/check-built-plugins.sh +++ b/checks/check-built-plugins.sh @@ -3,9 +3,16 @@ set -e declare -A want -for p in ${SUPPORTED_PLUGIN_LIST}; do - want["${p}"]=1 -done +if [[ $# -ge 1 ]]; then + for p in $(egrep -v '^ *($|#)' "${1}"); do + want["${p}"]=1 + done +else + echo "No plugins on the command line; using SUPPORTED_PLUGIN_LIST instead." + for p in ${SUPPORTED_PLUGIN_LIST}; do + want["${p}"]=1 + done +fi declare -A got for f in .libs/*.so; do