Skip to content

Commit

Permalink
workflows: Add PR check for CentOS 7 compilation (#4381)
Browse files Browse the repository at this point in the history
* workflows provide in-repo centos 7 compile checks for PR

Signed-off-by: Patrick Stephens <[email protected]>
  • Loading branch information
patrick-stephens authored Dec 1, 2021
1 parent 8c49120 commit 9ccc6f8
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/README.workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
| [build-release](./build-release.yaml) | Builds the distro packages and docker images from a tagged release| on new release/tag|
| [publish-release](./publish-release.yaml) | Publishes the docker images/manifest on hub.docker.io/fluent/ and the distro packages | on new release/tag on build-release completes|
| [pr-closed-docker](./pr-closed-docker.yaml) | Removes docker images for PR on hub.docker.io/fluentbitdev/| on pr closed|
| [pr-compile-check](./pr-compile-check.yaml) | Runs some compilation sanity checks on a PR |
| [pr-stale](./pr-stale.yaml) | Closes stale PR(s) with no activity in 30 days | scheduled daily 01:30 AM UTC|
| [integration-build-master](./integration-build-master.yaml) | Builds a docker image to be used in integration testing (master branch) | on new commit/push on master|
| [integration-build-pr](./integration-build-pr.yaml) | Builds a docker image to be used in integration testing (pr branch) | on new commit/push on PR(s) |
Expand All @@ -15,7 +16,7 @@

### Available labels

| Label name | Description |
| Label name | Description |
| :----------|-------------|
| docs-required| default tag used to request documentation, has to be removed before merge |
| ok-to-test | run all integration tests |
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/pr-compile-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'Pull requests compile checks'
on:
pull_request:
types:
- opened
- edited
- reopened
- synchronize
workflow_dispatch:

jobs:
# Sanity check for compilation using older compiler on CentOS 7
pr-compile-centos-7:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout Fluent Bit code
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Attempt to build current source for CentOS 7
uses: docker/build-push-action@v2
with:
context: .
file: ./dockerfiles/Dockerfile.centos7
# No need to use after this so discard completely
push: false
load: false
24 changes: 24 additions & 0 deletions dockerfiles/Dockerfile.centos7
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This container image is primarily used to test compilation works for CentOS 7, it is
# not intended for production usage.
# Based on https://github.com/fluent/fluent-bit-packaging/tree/master/distros/centos/7
FROM centos:7

RUN yum -y update && \
yum install -y rpm-build curl ca-certificates gcc gcc-c++ cmake make bash \
wget unzip systemd-devel wget flex bison \
cyrus-sasl-lib cyrus-sasl-devel openssl openss-libs openssl-devel \
postgresql-libs postgresql-devel postgresql-server postgresql && \
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \
rpm -ivh epel-release-latest-7.noarch.rpm && \
yum install -y cmake3

COPY . /src/
WORKDIR /src/build

RUN cmake3 -DCMAKE_INSTALL_PREFIX=/opt/td-agent-bit/ -DCMAKE_INSTALL_SYSCONFDIR=/etc/ \
-DFLB_RELEASE=On -DFLB_TRACE=On -DFLB_TD=On \
-DFLB_SQLDB=On -DFLB_HTTP_SERVER=On \
-DFLB_OUT_KAFKA=On \
-DFLB_OUT_PGSQL=On ../

RUN make -j $(getconf _NPROCESSORS_ONLN)

0 comments on commit 9ccc6f8

Please sign in to comment.