Skip to content

Commit

Permalink
Merge branch 'main' into debian11
Browse files Browse the repository at this point in the history
  • Loading branch information
octo committed Dec 21, 2023
2 parents 2deb49a + bac09b5 commit dbb3ce8
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 45 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/daily-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand Down
24 changes: 10 additions & 14 deletions .github/workflows/merge-jobs.yml
Original file line number Diff line number Diff line change
@@ -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:?}"
17 changes: 13 additions & 4 deletions .github/workflows/pr-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 10 additions & 5 deletions .github/workflows/weekly-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand Down
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@ Helper images for building collectd
Here is a collection of manifests used to build the Docker images hosted at:
<https://cloud.docker.com/u/collectd/repository/docker/collectd/ci/tags>

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: <https://travis-ci.org/collectd/ci-docker/builds>
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
```
13 changes: 10 additions & 3 deletions checks/check-built-plugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dbb3ce8

Please sign in to comment.