From 4aed887e6d94c6e77ded54b692dd0a239f8725a8 Mon Sep 17 00:00:00 2001 From: Radoslav Husar Date: Mon, 11 Dec 2023 17:29:40 +0100 Subject: [PATCH] wip --- .github/workflows/ci-native.yml | 200 -------------------------------- .github/workflows/ci.yml | 85 ++++++++++++++ Doxyfile | 20 ++++ 3 files changed, 105 insertions(+), 200 deletions(-) delete mode 100644 .github/workflows/ci-native.yml create mode 100644 Doxyfile diff --git a/.github/workflows/ci-native.yml b/.github/workflows/ci-native.yml deleted file mode 100644 index 2bbe863b3..000000000 --- a/.github/workflows/ci-native.yml +++ /dev/null @@ -1,200 +0,0 @@ -name: CI -on: - push: - branches: - - '*' - pull_request: - branches: - - '*' -jobs: - - cmake-fedora-latest: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - compiler: [ gcc, clang ] - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - path: mod_proxy_cluster - - name: Setup Podman - run: | - sudo apt update - sudo apt-get -y install podman - podman pull fedora:38 - - name: Create container and build - run: | - { - echo 'FROM fedora:38' - echo 'RUN dnf install cmake httpd-devel ${{ matrix.compiler }} -y' - echo 'RUN dnf groupinstall "C Development Tools and Libraries" -y' - echo 'RUN dnf clean all' - echo 'COPY mod_proxy_cluster mod_proxy_cluster' - echo 'WORKDIR /mod_proxy_cluster/native' - echo 'RUN cmake . -DCMAKE_C_COMPILER=${{ matrix.compiler }}' - echo 'RUN make' - } > podmanfile - podman build -f ./podmanfile - name: cmake-fedora-latest - - make-fedora-latest: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - path: mod_proxy_cluster - - name: Setup Podman - run: | - sudo apt update - sudo apt-get -y install podman - podman pull fedora:38 - - name: Create container and build - run: | - { - echo 'FROM fedora:38' - echo 'RUN dnf install httpd-devel redhat-rpm-config -y' - echo 'RUN dnf groupinstall "C Development Tools and Libraries" -y' - echo 'RUN dnf clean all' - echo 'COPY mod_proxy_cluster mod_proxy_cluster' - echo 'WORKDIR /mod_proxy_cluster/native' - echo 'RUN \' - echo 'for module in advertise/ mod_proxy_cluster/ balancers/ mod_manager; do \' - echo ' echo Building: $module; \' - echo ' cd $module; \' - echo ' sh buildconf; \' - echo ' ./configure --with-apxs=$APACHE_DIR/bin/apxs; \' - echo ' make clean; \' - # Ensure the build fails in case of a failure in any of the module builds! - echo ' make || exit 1; \' - echo ' cd ..; \' - echo 'done;' - } > podmanfile - podman build -f ./podmanfile - - clang-format-style-check: - # The ubuntu-latest has an old version of clang-format, let's just use the latest installed via brew. - runs-on: macos-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - path: mod_proxy_cluster - - name: Install clang-format - run: | - brew install clang-format - - name: Check styles - # Take full control over shell parameters by providing a template string to the shell options - # to display the resulting diff in the build logs. - shell: bash {0} - run: | - code=0 - cd mod_proxy_cluster/native - for file in */*.c */*.h; do - clang-format $file -n &> diff.txt; - if [ ! -s diff.txt ]; then - printf "%-42s ... OK\n" $file - else - cat diff.txt - printf "%-42s ... NOK\n" $file - code=1 - fi - rm diff.txt || true # we don't fail if the file does not exist - done; - exit $code - - make-httpd-maintainer-mode: - runs-on: ubuntu-latest - container: - image: quay.io/mod_cluster/ci-httpd-dev - defaults: - run: - shell: bash - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Build - run: | - cd native - for module in advertise/ mod_proxy_cluster/ balancers/ mod_manager/; do \ - cd $module; \ - sh buildconf; \ - ./configure --with-apxs=/usr/local/apache2/bin/apxs; \ - make clean; \ - make || exit 1; \ - cd ..; \ - done; - - cmake-windows-latest: - runs-on: windows-latest - env: - APACHE_LOUNGE_DISTRO_VERSION: 2.4.57 - HTTPD_DEV_HOME: '${{ github.workspace }}\httpd-apache-lounge\Apache24' - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Setup Developer Command Prompt for Microsoft Visual C++ - uses: ilammy/msvc-dev-cmd@v1 - - name: Get httpd - run: | - curl.exe --output "httpd-apache-lounge.zip" --url "https://www.apachelounge.com/download/VS16/binaries/httpd-${{ env.APACHE_LOUNGE_DISTRO_VERSION }}-win64-VS16.zip" - Expand-Archive -Path "httpd-apache-lounge.zip" -DestinationPath "httpd-apache-lounge" - - name: Build - run: | - ./native/scripts/windows-build.bat - - tests: - runs-on: ubuntu-latest - env: - IMG: local-tomcat - HTTPD_IMG: local-httpd - DEBUG: on - FOREVER_PAUSE: 100 - ITERATION_COUNT: 2 - TOMCAT_CYCLE_COUNT: 2 - steps: - - name: Checkout - uses: actions/checkout@v3 -# this occupies 8084 port on Ubuntu 20.04 and we don't use it. - - name: Remove mono blocking 8084 port - run: sudo kill -9 $(sudo lsof -t -i:8084) - - name: Setup dependencies - run: | - sudo apt-get update -y - sudo apt-get install -y docker maven git curl iproute2 - cd test - sh setup-dependencies.sh - - name: Print network environment - run: ss -ltp - - name: Run testsuite - run: | - cd test - sh testsuite.sh - - name: Preserve test logs - uses: actions/upload-artifact@v3 - if: always() - with: - name: Test logs - path: | - test/logs/* - retention-days: 7 - - doxygen: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Get doxygen - run: | - sudo apt-get update -y - sudo apt-get install -y doxygen - - name: Build doxygen docs - run: doxygen - - name: Preserve doxygen docs - uses: actions/upload-artifact@v3 - with: - name: Doxygen docs - path: doxygen-out/html/* - retention-days: 30 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 62af73256..7c835893e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,7 @@ on: branches: - '*' jobs: + ci: runs-on: ${{ matrix.os }} strategy: @@ -29,3 +30,87 @@ jobs: ${{ runner.os }}-maven- - name: Build with Maven run: mvn -B package -P dist + + cmake-fedora-latest: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + compiler: [ gcc, clang ] + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + path: mod_proxy_cluster + - name: Setup Podman + run: | + sudo apt update + sudo apt-get -y install podman + podman pull fedora:38 + - name: Create container and build + run: | + { + echo 'FROM fedora:38' + echo 'RUN dnf install cmake httpd-devel ${{ matrix.compiler }} -y' + echo 'RUN dnf groupinstall "C Development Tools and Libraries" -y' + echo 'RUN dnf clean all' + echo 'COPY mod_proxy_cluster mod_proxy_cluster' + echo 'WORKDIR /mod_proxy_cluster/native' + echo 'RUN cmake . -DCMAKE_C_COMPILER=${{ matrix.compiler }}' + echo 'RUN make' + } > podmanfile + podman build -f ./podmanfile + name: cmake-fedora-latest + + make-fedora-latest: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + path: mod_proxy_cluster + - name: Setup Podman + run: | + sudo apt update + sudo apt-get -y install podman + podman pull fedora:38 + - name: Create container and build + run: | + { + echo 'FROM fedora:38' + echo 'RUN dnf install httpd-devel redhat-rpm-config -y' + echo 'RUN dnf groupinstall "C Development Tools and Libraries" -y' + echo 'RUN dnf clean all' + echo 'COPY mod_proxy_cluster mod_proxy_cluster' + echo 'WORKDIR /mod_proxy_cluster/native' + echo 'RUN \' + echo 'for module in advertise mod_cluster_slotmem mod_manager mod_proxy_cluster; do \' + echo ' echo Building: $module; \' + echo ' cd $module; \' + echo ' sh buildconf; \' + echo ' ./configure --with-apxs=$APACHE_DIR/bin/apxs; \' + echo ' make clean; \' + # Ensure the build fails in case of a failure in any of the module builds! + echo ' make || exit 1; \' + echo ' cd ..; \' + echo 'done;' + } > podmanfile + podman build -f ./podmanfile + + doxygen: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Get doxygen + run: | + sudo apt-get update -y + sudo apt-get install -y doxygen + - name: Build doxygen docs + run: doxygen + - name: Preserve doxygen docs + uses: actions/upload-artifact@v3 + with: + name: Doxygen docs + path: doxygen-out/html/* + retention-days: 30 diff --git a/Doxyfile b/Doxyfile new file mode 100644 index 000000000..5800ad691 --- /dev/null +++ b/Doxyfile @@ -0,0 +1,20 @@ +PROJECT_NAME = mod_proxy_cluster +PROJECT_NUMBER = 1.3 +PROJECT_BRIEF = An inteligent load-balancer for Apache httpd +PROJECT_LOGO = +OUTPUT_DIRECTORY = doxygen-out +JAVADOC_AUTOBRIEF = YES +OPTIMIZE_OUTPUT_FOR_C = YES +EXTRACT_ALL = YES +INPUT = native README.md +FILE_PATTERNS = *.c \ + *.cc \ + *.cpp \ + *.h \ + *.hpp +RECURSIVE = YES +EXCLUDE = test native/build +EXCLUDE_PATTERNS = *CMake* +USE_MDFILE_AS_MAINPAGE = README.md +GENERATE_LATEX = NO +HTML_COLORSTYLE = LIGHT