Skip to content

Fix ENV variable declaration in the test container, update fedora version to 42, tweak CI #902

Fix ENV variable declaration in the test container, update fedora version to 42, tweak CI

Fix ENV variable declaration in the test container, update fedora version to 42, tweak CI #902

Workflow file for this run

name: CI
on:
push:
paths-ignore:
- '.gitignore'
- '**.md'
- 'LICENSE'
pull_request:
paths-ignore:
- '.gitignore'
- '**.md'
- 'LICENSE'
jobs:
cmake-fedora-latest:
name: cmake-fedora-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
compiler: [ gcc, clang ]
os: [ ubuntu-latest, ubuntu-24.04-arm ]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: mod_proxy_cluster
- name: Setup Podman
run: |
sudo apt update
sudo apt-get -y install podman
- name: Create container and build
run: |
{
echo 'FROM fedora:42'
echo 'RUN dnf install --assumeyes @c-development cmake httpd-devel ${{ matrix.compiler }}'
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'
} > Containerfile
podman build .
make-fedora-latest:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, ubuntu-24.04-arm ]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: mod_proxy_cluster
- name: Setup Podman
run: |
sudo apt update
sudo apt-get -y install podman
- name: Create container and build
run: |
{
echo 'FROM fedora:42'
echo 'RUN dnf install --assumeyes @c-development httpd-devel redhat-rpm-config'
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;'
} > Containerfile
podman build .
clang-format-style-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: mod_proxy_cluster
- name: Install clang-format
run: |
sudo apt-get update
sudo apt-get install -y clang-format
- name: Check styles
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
strategy:
fail-fast: false
matrix:
image-tag: [ "latest", "oldest-supported" ]
container:
image: quay.io/mod_cluster/ci-httpd-dev:${{ matrix.image-tag }}
defaults:
run:
shell: bash
env:
CFLAGS: "-Wall -Werror"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Print httpd version
run: echo $HTTPD_VERSION
- 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;
make-with-httpd-trunk:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: mod_proxy_cluster
- name: Checkout latest httpd
uses: actions/checkout@v4
with:
repository: apache/httpd
path: httpd
- name: Checkout apr for httpd
uses: actions/checkout@v4
with:
repository: apache/apr
path: httpd/srclib/apr
- name: Install necessary packages
run: |
ls
sudo apt-get update
sudo apt-get install cmake gcc cmake gcc make libtool libtool-bin python3 autoconf libxml2-dev libpcre2-dev -y
- name: Build httpd
run: |
ls
export "APACHE_DIR=/usr/local/apache2/"
cd httpd
./buildconf
./configure --prefix=/usr/local/apache2 --with-included-apr --enable-proxy-ajp --enable-maintainer-mode \
--enable-so --enable-proxy --enable-proxy-http --enable-proxy-wstunned --enable-proxy-hcheck \
--with-port=8090
sudo make
sudo make install
- name: Build mod_proxy_cluster and add it to httpd
env:
CFLAGS: "-Wall -Werror"
run: |
ls
cd mod_proxy_cluster/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; \
sudo cp *.so /usr/local/apache2/modules; \
cd ..; \
done;
- name: Preserve built Apache for perl-test job
uses: actions/[email protected]
with:
name: apache-trunk
path: /usr/local/apache2
retention-days: 0
cmake-windows-latest:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ windows-latest, windows-11-arm ]
env:
APACHE_LOUNGE_DISTRO_VERSION: 2.4.65-250724
HTTPD_DEV_HOME: 'C:\Apache24'
steps:
- name: Checkout
uses: actions/checkout@v4
- 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/VS17/binaries/httpd-${{ env.APACHE_LOUNGE_DISTRO_VERSION }}-win64-VS17.zip"
Expand-Archive -Path "httpd-apache-lounge.zip" -DestinationPath "C:\"
- name: Build
run: |
./native/scripts/windows-build.bat
cp cmakebuild/modules/*.so C:/Apache24/modules/
- name: Fix and prepare config files
run: |
cp test\httpd\mod_proxy_cluster.conf ${{ env.HTTPD_DEV_HOME }}\conf\mod_proxy_cluster.conf
echo "LogLevel debug" >> ${{ env.HTTPD_DEV_HOME }}\conf\mod_proxy_cluster.conf
echo "Include conf/mod_proxy_cluster.conf" >> ${{ env.HTTPD_DEV_HOME }}\conf\httpd.conf
(Get-Content ${{ env.HTTPD_DEV_HOME }}\conf\httpd.conf) | %{$_ -replace "Listen 80","#Listen 80"} | Set-Content -Path ${{ env.HTTPD_DEV_HOME }}\conf\httpd.conf
- name: Run
run: |
Start-Process -FilePath ${{ env.HTTPD_DEV_HOME }}\bin\httpd.exe
curl --fail --max-time 10 http://localhost:8090
curl --fail --max-time 10 http://localhost:8090/mod_cluster_manager
- name: Preserve logs
uses: actions/upload-artifact@v4
if: always()
with:
name: Windows logs for ${{ matrix.os }}
path: C:\Apache24\logs\
retention-days: 7
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@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Setup dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y podman-docker maven git curl iproute2 wcstools
sudo touch /etc/containers/nodocker
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@v4
if: always()
with:
name: Test logs
path: |
test/logs/*
retention-days: 7
perl-tests:
runs-on: ubuntu-latest
needs: make-with-httpd-trunk
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup dependencies
run: |
sudo apt update
sudo apt remove apache2*
sudo apt install -y gcc make perl cpanminus libcrypt-ssleay-perl
- name: Get Apache built in the previous job
uses: actions/download-artifact@v4
with:
name: apache-trunk
path: apache2
- name: Put httpd on the right path
run: |
mkdir test-perl/t/modules/
cp apache2/modules/{mod_proxy_cluster.so,mod_manager.so,mod_advertise.so,mod_lbmethod_cluster.so} test-perl/t/modules/
sudo mv apache2/ /usr/local/apache2/
sudo chmod -R 755 /usr/local/apache2/
- name: Install perl modules
run: |
sudo cpanm --force Apache::Test Apache::TestMM HTTP::Request LWP::UserAgent
- name: Run testsuite
run: |
cd test-perl
perl Makefile.PL -httpd /usr/local/apache2/bin/httpd
make
t/TEST -httpd /usr/local/apache2/bin/httpd 2>&1 | tee test-perl.log
mv test-perl.log t/logs/test-perl.log
grep "Result: PASS" -q t/logs/test-perl.log
exit $?
- name: Preserve test logs
uses: actions/upload-artifact@v4
if: always()
with:
name: Perl tests logs
path: |
test-perl/t/logs/*
retention-days: 7
doxygen:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- 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@v4
with:
name: Doxygen docs
path: doxygen-out/html/*
retention-days: 30