From 5da14042f70711ea5cf66e034699730335462f66 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 5 May 2024 14:08:03 +0200 Subject: Merging upstream version 1.45.3+dfsg. Signed-off-by: Daniel Baumann --- .../lib/cfl/.github/actionlint-matcher.json | 17 +++ src/fluent-bit/lib/cfl/.github/dependabot.yml | 12 ++ .../lib/cfl/.github/workflows/build.yaml | 168 +++++++++++++++++++++ src/fluent-bit/lib/cfl/.github/workflows/lint.yaml | 30 ++++ .../lib/cfl/.github/workflows/packages.yaml | 102 +++++++++++++ 5 files changed, 329 insertions(+) create mode 100644 src/fluent-bit/lib/cfl/.github/actionlint-matcher.json create mode 100644 src/fluent-bit/lib/cfl/.github/dependabot.yml create mode 100644 src/fluent-bit/lib/cfl/.github/workflows/build.yaml create mode 100644 src/fluent-bit/lib/cfl/.github/workflows/lint.yaml create mode 100644 src/fluent-bit/lib/cfl/.github/workflows/packages.yaml (limited to 'src/fluent-bit/lib/cfl/.github') diff --git a/src/fluent-bit/lib/cfl/.github/actionlint-matcher.json b/src/fluent-bit/lib/cfl/.github/actionlint-matcher.json new file mode 100644 index 000000000..7b1ba251e --- /dev/null +++ b/src/fluent-bit/lib/cfl/.github/actionlint-matcher.json @@ -0,0 +1,17 @@ +{ + "problemMatcher": [ + { + "owner": "actionlint", + "pattern": [ + { + "regexp": "^(?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*: (?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)* \\[(.+?)\\]$", + "file": 1, + "line": 2, + "column": 3, + "message": 4, + "code": 5 + } + ] + } + ] + } \ No newline at end of file diff --git a/src/fluent-bit/lib/cfl/.github/dependabot.yml b/src/fluent-bit/lib/cfl/.github/dependabot.yml new file mode 100644 index 000000000..12f9b4a0b --- /dev/null +++ b/src/fluent-bit/lib/cfl/.github/dependabot.yml @@ -0,0 +1,12 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + # Maintain dependencies for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" \ No newline at end of file diff --git a/src/fluent-bit/lib/cfl/.github/workflows/build.yaml b/src/fluent-bit/lib/cfl/.github/workflows/build.yaml new file mode 100644 index 000000000..8f3ad7391 --- /dev/null +++ b/src/fluent-bit/lib/cfl/.github/workflows/build.yaml @@ -0,0 +1,168 @@ +name: Build PR(s) and master branch. +on: + push: + branches: + - master + pull_request: + branches: + - master + types: [opened, reopened, synchronize] +jobs: + build-windows: + name: Build sources on amd64 for ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [windows-latest, windows-2019] + steps: + - uses: actions/checkout@v3 + - name: Build on ${{ matrix.os }} with vs-2019 + run: | + .\scripts\win_build.bat + - name: Run unit tests. + run: | + ctest --rerun-failed --output-on-failure -C Debug --test-dir .\tests\ + + build-msys2: + name: Build sources on MSYS2 for ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [windows-latest, windows-2019] + steps: + - uses: actions/checkout@v3 + - name: Get dependencies w/ chocolatey + uses: crazy-max/ghaction-chocolatey@v2 + with: + args: install -y cmake --installargs 'ADD_CMAKE_TO_PATH=System' + - uses: msys2/setup-msys2@v2 + with: + update: true + msystem: UCRT64 + path-type: inherit + install: >- + mingw-w64-ucrt-x86_64-gcc + - name: Build on ${{ matrix.os }} with MSYS2 + shell: msys2 {0} + run: | + cmake -G "MinGW Makefiles" -DCFL_TESTS=On . + cmake --build . + - name: Run unit tests. + run: | + ctest --rerun-failed --output-on-failure -C Debug --test-dir .\tests\ + + build-centos: + name: CentOS 7 build to confirm no issues once used downstream + runs-on: ubuntu-latest + container: centos:7 + steps: + - name: Set up base image dependencies + run: | + yum -y update + yum install -y ca-certificates cmake gcc gcc-c++ make wget + 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 + shell: bash + + - uses: actions/checkout@v3 + + - name: Run compilation + run: | + cmake3 -DCFL_DEV=on . + make + + build-debian: + name: Debian Buster build to confirm no issues once used downstream + runs-on: ubuntu-latest + container: debian:buster + steps: + - name: Set up base image dependencies + run: | + apt-get update + apt-get install -y build-essential cmake make + shell: bash + + - uses: actions/checkout@v3 + + - name: Run compilation + run: | + cmake -DCFL_DEV=on . + make + + build-unix-arm64: + name: Build sources on arm64 for ${{ matrix.os }} - ${{ matrix.compiler }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + compiler: [ gcc, clang ] + steps: + - uses: actions/checkout@v3 + - name: Build on ${{ matrix.os }} with ${{ matrix.compiler }} + uses: uraimo/run-on-arch-action@v2.3.0 + with: + arch: aarch64 + distro: ubuntu20.04 + run: | + apt-get update && \ + apt-get install -y --no-install-recommends \ + build-essential \ + cmake \ + file \ + make + export CC=${{ env.compiler }} + cmake -DCFL_TESTS=On . + make all + CTEST_OUTPUT_ON_FAILURE=1 make test + env: + CC: ${{ matrix.compiler }} + + build-unix-amd64: + name: Build sources on amd64 for ${{ matrix.os }} - ${{ matrix.compiler }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + compiler: [ gcc, clang ] + steps: + - uses: actions/checkout@v3 + - name: Build on ${{ matrix.os }} with ${{ matrix.compiler }} + run: | + echo "CC = $CC, CXX = $CXX" + cmake -DCFL_TESTS=On . + make all + CTEST_OUTPUT_ON_FAILURE=1 make test + env: + CC: ${{ matrix.compiler }} + + build-analysis-tests: + name: Build with various code analysis tools + strategy: + fail-fast: false + matrix: + preset: + - clang-sanitize-address + - clang-sanitize-memory + - clang-sanitize-undefined + - clang-sanitize-dataflow + - clang-sanitize-safe-stack + - valgrind + permissions: + contents: read + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: true + + - uses: docker://lpenz/ghaction-cmake:0.19 + with: + preset: ${{ matrix.preset }} + # dependencies_debian: '' + cmakeflags: '-DCFL_TESTS=On -DCFL_DEV=on .' + build_command: make all diff --git a/src/fluent-bit/lib/cfl/.github/workflows/lint.yaml b/src/fluent-bit/lib/cfl/.github/workflows/lint.yaml new file mode 100644 index 000000000..7e3dc05b6 --- /dev/null +++ b/src/fluent-bit/lib/cfl/.github/workflows/lint.yaml @@ -0,0 +1,30 @@ +name: Lint PRs +on: + pull_request: + workflow_dispatch: + +jobs: + shellcheck: + runs-on: ubuntu-latest + name: Shellcheck + permissions: + contents: read + steps: + - uses: actions/checkout@v3 + - uses: ludeeus/action-shellcheck@master + with: + ignore_paths: lib + + actionlint: + runs-on: ubuntu-latest + name: Actionlint + permissions: + contents: read + steps: + - uses: actions/checkout@v3 + - run: | + echo "::add-matcher::.github/actionlint-matcher.json" + bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) + ./actionlint -color -shellcheck= + shell: bash + diff --git a/src/fluent-bit/lib/cfl/.github/workflows/packages.yaml b/src/fluent-bit/lib/cfl/.github/workflows/packages.yaml new file mode 100644 index 000000000..2c5bedbee --- /dev/null +++ b/src/fluent-bit/lib/cfl/.github/workflows/packages.yaml @@ -0,0 +1,102 @@ +name: Build packages for master or a tagged release + +on: + push: + branches: + - master + # Any tag starting with 'v' + tags: + - 'v*' + workflow_dispatch: + +jobs: + build-distro-packages-arm64: + runs-on: ubuntu-latest + name: build arm64 packages + strategy: + fail-fast: true + matrix: + format: [ rpm, deb ] + steps: + - uses: actions/checkout@v3 + - uses: uraimo/run-on-arch-action@v2.3.0 + name: Build the ${{matrix.format}} packages + with: + arch: aarch64 + distro: ubuntu20.04 + run: | + apt-get update && \ + apt-get install -y --no-install-recommends \ + build-essential \ + cmake \ + file \ + rpm \ + make + cmake . + echo ${{ matrix.format }} | awk '{print toupper($0)}' | xargs -I{} cpack -G {} + + - name: Store the master package artifacts + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.format }}-arm64 + path: | + ./*.${{matrix.format}} + + build-distro-packages-amd64: + name: build amd64 packages + strategy: + fail-fast: true + matrix: + format: [ rpm, deb ] + + runs-on: [ ubuntu-latest ] + steps: + - uses: actions/checkout@v3 + - name: Build the ${{matrix.format}} packages + run: | + cmake . + echo ${{ matrix.format }} | awk '{print toupper($0)}' | xargs -I{} cpack -G {} + + - name: Store the master package artifacts + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.format }}-amd64 + path: | + ./*.${{matrix.format}} + + release: + name: Create release and upload packages + needs: + - build-distro-packages-amd64 + - build-distro-packages-arm64 + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Download all artefacts + uses: actions/download-artifact@v3 + with: + path: artifacts/ + + - name: Display structure of downloaded files + run: ls -R + working-directory: artifacts + shell: bash + + - name: Unstable release on push to master to make it easier to download + uses: pyTooling/Actions/releaser@r0 + continue-on-error: true + with: + token: ${{ secrets.GITHUB_TOKEN }} + tag: 'unstable' + rm: true + files: | + artifacts/**/* + + - name: Release on tag + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + generate_release_notes: true + files: | + artifacts/**/* -- cgit v1.2.3