Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/test-env/module-acme.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

PEBBLE=$(find "$GITHUB_WORKSPACE" -path "*/nginx-acme-*/build/get-pebble.pl" -type f 2>/dev/null | head -1)
[ -n "$PEBBLE" ] && echo "TEST_NGINX_PEBBLE_BINARY=$(perl "$PEBBLE")" >> "$GITHUB_ENV"
263 changes: 243 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
for target in $(make list-all-modules | cut -d ' ' -f 1); do
targets="$targets module-$target";
done
echo targets="base $targets" >> $GITHUB_ENV
echo targets="$targets" >> $GITHUB_ENV

- name: set-matrix
id: set-matrix
Expand All @@ -38,8 +38,58 @@ jobs:
jq -nRr '"matrix-" + $os +"=" + ( { include: [ $ARGS.positional[] | {target: . } ] } | tojson)' --arg os $os --args ${targets/ module-geoip/} >> $GITHUB_OUTPUT
done

alpine:
alpine-base:
runs-on: ubuntu-24.04
container: alpine:3.24
defaults:
run:
shell: sh -e {0}
needs: generate-matrix
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Setup Alpine Linux
run: |
apk add \
abuild \
build-base \
coreutils \
curl \
findutils \
git \
make \
xz
printf "#!/bin/sh\\nSETFATTR=true /usr/bin/abuild -F \"\$@\"\\n" > /usr/local/bin/abuild
chmod +x /usr/local/bin/abuild

- name: Create build depends for base
working-directory: alpine
run: |
make abuild-base

- name: Install build depends for base
working-directory: alpine
run: |
apk add $(. ./abuild-base/APKBUILD; echo $makedepends;)

- name: Build base
working-directory: alpine
run: |
make base

- name: Upload nginx binary
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: nginx-binary-alpine
path: alpine/base/nginx

- name: List what has been built
if: ${{ !cancelled() }}
run: |
find ~/packages/alpine -type f | xargs ls -ld

alpine:
needs: [generate-matrix, alpine-base]
runs-on: ubuntu-24.04
container: alpine:3.24
defaults:
Expand All @@ -63,12 +113,26 @@ jobs:
findutils \
git \
make \
perl \
perl-io-socket-ssl \
perl-io-socket-inet6 \
perl-utils \
perl-cryptx \
perl-dev \
perl-fcgi \
perl-parse-recdescent \
perl-protocol-websocket \
rustup \
xz
xz \
krb5-server \
krb5 \
krb5-dev \
perl-gssapi
printf "#!/bin/sh\\nSETFATTR=true /usr/bin/abuild -F \"\$@\"\\n" > /usr/local/bin/abuild
chmod +x /usr/local/bin/abuild

- name: Install Rust toolchain
if: matrix.target == 'module-acme'
uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 #v1
with:
toolchain: 1.86.0
Expand All @@ -88,14 +152,74 @@ jobs:
run: |
make ${{ matrix.target }}

- name: Download nginx binary
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: nginx-binary-alpine
path: alpine/base

- name: Setup test environment for ${{ matrix.target }}
run: |
SETUP="$GITHUB_WORKSPACE/.github/test-env/${{ matrix.target }}.sh"
if [ -f "$SETUP" ]; then bash "$SETUP"; fi

- name: Test ${{ matrix.target }}
env:
TEST_NGINX_BINARY: "${{ github.workspace }}/alpine/base/nginx"
TEST_NGINX_GLOBALS: "user root;"
working-directory: alpine
run: |
MODULE=${{ matrix.target }}
MODULE=${MODULE#module-}
chmod +x "$TEST_NGINX_BINARY"
make test TEST_MODULES=${MODULE}

- name: List what has been built
if: ${{ !cancelled() }}
run: |
find ~/packages/alpine -type f | xargs ls -ld

ubuntu:
ubuntu-base:
runs-on: ubuntu-24.04
needs: generate-matrix
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Setup Ubuntu
run: |
sudo apt-get update
sudo apt-get install -y --no-install-suggests --no-install-recommends \
curl \
devscripts \
equivs \
git \
libxml2-utils \
lsb-release \
xsltproc

- name: Build base
working-directory: debian
run: |
NGINX_VERSION=$(make --eval 'nv:; @echo $(BASE_VERSION)' nv)
make rules-base
sudo mk-build-deps --install --tool="apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes" \
debuild-base/nginx-${NGINX_VERSION}/debian/control
make base

- name: Upload nginx binary
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: nginx-binary-ubuntu
path: debian/base/nginx

- name: List what has been built
if: ${{ !cancelled() }}
run: |
find .. -mindepth 1 -maxdepth 1 -name "*.deb" | xargs ls -ld

ubuntu:
runs-on: ubuntu-24.04
needs: [generate-matrix, ubuntu-base]
strategy:
fail-fast: false
matrix: ${{fromJson(needs.generate-matrix.outputs.matrix-ubuntu)}}
Expand All @@ -111,11 +235,19 @@ jobs:
devscripts \
equivs \
git \
libio-socket-ssl-perl \
libio-socket-inet6-perl \
libxml2-utils \
lsb-release \
xsltproc
xsltproc \
krb5-kdc \
krb5-admin-server \
krb5-user \
libkrb5-dev \
libgssapi-perl

- name: Install Rust toolchain
if: matrix.target == 'module-acme'
uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 #v1
with:
toolchain: 1.86.0
Expand All @@ -129,15 +261,79 @@ jobs:
debuild-${{ matrix.target }}/nginx-${NGINX_VERSION}/debian/control
make ${{ matrix.target }}

- name: Download nginx binary
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: nginx-binary-ubuntu
path: debian/base

- name: Setup test environment for ${{ matrix.target }}
run: |
SETUP="$GITHUB_WORKSPACE/.github/test-env/${{ matrix.target }}.sh"
if [ -f "$SETUP" ]; then bash "$SETUP"; fi

- name: Test ${{ matrix.target }}
env:
TEST_NGINX_BINARY: "${{ github.workspace }}/debian/base/nginx"
working-directory: debian
run: |
MODULE=${{ matrix.target }}
MODULE=${MODULE#module-}
chmod +x "$TEST_NGINX_BINARY"
make test TEST_MODULES=${MODULE}

- name: List what has been built
if: ${{ !cancelled() }}
run: |
find .. -mindepth 1 -maxdepth 1 -name "*.deb" | xargs ls -ld

redhat:
needs: generate-matrix
redhat-base:
runs-on: ubuntu-24.04
needs: generate-matrix
container: almalinux:9
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Setup AlmaLinux
run: |
dnf makecache
dnf install -y \
g++ \
gcc \
git \
epel-release \
libxslt \
make \
rpm-build \
which \
xz \
'dnf-command(config-manager)'
dnf config-manager --set-enabled crb

- name: Build base
working-directory: rpm/SPECS
run: |
make nginx.spec
dnf -y builddep ./nginx.spec
make base

- name: Upload nginx binary
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: nginx-binary-redhat
path: rpm/SPECS/base/nginx

- name: List what has been built
if: ${{ !cancelled() }}
run: |
find rpm/RPMS -type f | xargs ls -ld

redhat:
needs: [generate-matrix, redhat-base]
runs-on: ubuntu-24.04
container:
image: almalinux:9
options: --init
strategy:
fail-fast: false
matrix: ${{fromJson(needs.generate-matrix.outputs.matrix-redhat )}}
Expand All @@ -148,39 +344,66 @@ jobs:
- name: Setup AlmaLinux
run: |
dnf makecache
dnf install -y epel-release 'dnf-command(config-manager)'
dnf config-manager --set-enabled crb
dnf install -y \
g++ \
gcc \
git \
epel-release \
libxslt \
make \
perl \
perl-Digest-MD5 \
perl-ExtUtils-Embed \
perl-IO-Compress \
perl-IO-Socket-INET6 \
perl-IO-Socket-SSL \
perl-JSON \
perl-JSON-PP \
perl-Test-Simple \
rpm-build \
which \
xz \
'dnf-command(config-manager)'
dnf config-manager --set-enabled crb
krb5-server \
krb5-workstation \
krb5-devel \
perl-GSSAPI

- name: Install Rust toolchain
if: matrix.target == 'module-acme'
uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 #v1
with:
toolchain: 1.86.0

- name: Create and install build depends for ${{ matrix.target }} and build it
working-directory: rpm/SPECS
run: |
case ${{ matrix.target }} in
base)
spec="nginx.spec"
;;
*)
spec="nginx-${{ matrix.target }}.spec"
;;
esac
make $spec
dnf -y builddep ./${spec}
make nginx-${{ matrix.target }}.spec
dnf -y builddep ./nginx-${{ matrix.target }}.spec
make ${{ matrix.target }}

- name: Download nginx binary
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: nginx-binary-redhat
path: rpm/SPECS/base

- name: Setup test environment for ${{ matrix.target }}
run: |
SETUP="$GITHUB_WORKSPACE/.github/test-env/${{ matrix.target }}.sh"
if [ -f "$SETUP" ]; then bash "$SETUP"; fi

- name: Test ${{ matrix.target }}
env:
TEST_NGINX_BINARY: "${{ github.workspace }}/rpm/SPECS/base/nginx"
TEST_NGINX_GLOBALS: "user root;"
working-directory: rpm/SPECS
run: |
MODULE=${{ matrix.target }}
MODULE=${MODULE#module-}
chmod +x "$TEST_NGINX_BINARY"
make test TEST_MODULES=${MODULE}

- name: List what has been built
if: ${{ !cancelled() }}
run: |
Expand Down
Loading
Loading