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/cmetrics/.github/workflows/build.yaml | 144 +++++++++++++++++++++ .../lib/cmetrics/.github/workflows/lint.yaml | 28 ++++ .../lib/cmetrics/.github/workflows/packages.yaml | 108 ++++++++++++++++ 3 files changed, 280 insertions(+) create mode 100644 src/fluent-bit/lib/cmetrics/.github/workflows/build.yaml create mode 100644 src/fluent-bit/lib/cmetrics/.github/workflows/lint.yaml create mode 100644 src/fluent-bit/lib/cmetrics/.github/workflows/packages.yaml (limited to 'src/fluent-bit/lib/cmetrics/.github/workflows') diff --git a/src/fluent-bit/lib/cmetrics/.github/workflows/build.yaml b/src/fluent-bit/lib/cmetrics/.github/workflows/build.yaml new file mode 100644 index 000000000..88bfb3fa3 --- /dev/null +++ b/src/fluent-bit/lib/cmetrics/.github/workflows/build.yaml @@ -0,0 +1,144 @@ +name: Build PR(s) and master branch. +on: + workflow_dispatch: + 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] + permissions: + contents: read + steps: + - uses: actions/checkout@v3 + with: + submodules: true + + - 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-centos: + name: CentOS 7 build to confirm no issues once used downstream + runs-on: ubuntu-latest + container: centos:7 + permissions: + contents: read + steps: + - name: Set up base image dependencies + run: | + yum -y update && \ + yum install -y ca-certificates cmake gcc gcc-c++ git 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 + + - name: Clone repo with submodules (1.8.3 version of Git) + run: | + git clone --recursive https://github.com/calyptia/cmetrics.git + shell: bash + + - name: Run compilation + run: | + cmake3 -DCMT_TESTS=on -DCMT_DEV=on . + make + shell: bash + working-directory: cmetrics + + 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 ] + permissions: + contents: read + steps: + - uses: actions/checkout@v3 + with: + submodules: true + + - 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 -DCMT_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 ] + permissions: + contents: read + steps: + - uses: actions/checkout@v3 + with: + submodules: true + + - name: Build on ${{ matrix.os }} with ${{ matrix.compiler }} + run: | + echo "CC = $CC, CXX = $CXX" + cmake -DCMT_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: '-DCMT_TESTS=On -DCMT_DEV=on .' + build_command: make all diff --git a/src/fluent-bit/lib/cmetrics/.github/workflows/lint.yaml b/src/fluent-bit/lib/cmetrics/.github/workflows/lint.yaml new file mode 100644 index 000000000..75cdd122e --- /dev/null +++ b/src/fluent-bit/lib/cmetrics/.github/workflows/lint.yaml @@ -0,0 +1,28 @@ +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 + + 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/cmetrics/.github/workflows/packages.yaml b/src/fluent-bit/lib/cmetrics/.github/workflows/packages.yaml new file mode 100644 index 000000000..41e913ec8 --- /dev/null +++ b/src/fluent-bit/lib/cmetrics/.github/workflows/packages.yaml @@ -0,0 +1,108 @@ +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 + with: + submodules: true + + - 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 + with: + submodules: true + + - 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 + draft: false + files: | + artifacts/**/* -- cgit v1.2.3