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
8 changes: 6 additions & 2 deletions .containerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
.git/
.ai/
dependencies/*-dist/
build/
quic/third-party/*-dist/
test/certs/
build*/
keys/
certs/
certs/
1 change: 1 addition & 0 deletions .dockerignore
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ assignees: ''

<!--
Before submitting, please ensure:
1. You are on a clean, unmodified codebase (main branch or latest release).
1. You are on a clean, unmodified codebase (trunk branch or latest release).
2. You can consistently reproduce the issue.
3. You have searched open and closed issues to ensure this is not a duplicate.
4. You are reporting only ONE bug per issue.
Expand All @@ -27,7 +27,7 @@ A clear description of what you expected to happen.
**Environment (please complete the following information):**
- OS: [e.g. Ubuntu 22.04]
- Compiler Version: [e.g. GCC 11.3.0]
- mod_http3 Version or Commit hash: [e.g. 0.1.0 or abc1234]
- mod_http3 Version: [e.g. 0.1.0 or abc1234]
- httpd Version: [e.g. 2.5.0-trunk]
- OpenSSL Version: [e.g. 3.5.0]
- nghttp3 Version: [e.g. 1.17.0]
Expand Down
78 changes: 78 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: build

on:
workflow_call:
outputs:
image:
description: Image this build published for the commit.
value: ${{ jobs.module.outputs.image }}

permissions:
contents: read
packages: write

env:
IMAGE: ghcr.io/${{ github.repository }}:${{ github.sha }}

jobs:
module:
name: module
runs-on: ubuntu-latest
outputs:
image: ${{ steps.ref.outputs.image }}

steps:
- name: Checkout
uses: actions/checkout@v7
with:
submodules: recursive

- name: Set up buildx
uses: docker/setup-buildx-action@v4

- name: Log in to ghcr
if: github.event_name != 'pull_request'
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- name: Build image
uses: docker/build-push-action@v7
with:
context: .
file: container/Containerfile
build-args: JOBS=4
tags: ${{ env.IMAGE }}
load: true
push: ${{ github.event_name != 'pull_request' }}
cache-from: type=gha,scope=module
cache-to: type=gha,scope=module,mode=max

- name: Check linkage
run: |
docker run --rm --entrypoint ldd "$IMAGE" \
/src/dependencies/httpd-dist/modules/mod_http3.so | tee ldd.txt
! grep -q "not found" ldd.txt

- name: Build artifacts
uses: docker/build-push-action@v7
with:
context: .
file: container/Containerfile
build-args: JOBS=4
target: artifacts
outputs: type=local,dest=dist
cache-from: type=gha,scope=module

- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: dist
path: dist/
if-no-files-found: error

- name: Export image ref
id: ref
run: echo "image=$IMAGE" >>"$GITHUB_OUTPUT"
73 changes: 73 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: ci

on:
push:
branches: ["**"]
tags: ["v*"]
pull_request:
workflow_dispatch:

permissions:
contents: read
packages: write

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: ${{ github.ref_type != 'tag' }}

jobs:
version:
name: version
if: github.ref_type == 'tag'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7

- name: Match tag to CMakeLists
run: |
version=${GITHUB_REF_NAME#v}
grep -q "^project(mod_http3 VERSION ${version%%-rc*})$" CMakeLists.txt

build:
name: build
uses: ./.github/workflows/build.yml
permissions:
contents: read
packages: write

test:
name: test
needs: build
uses: ./.github/workflows/test.yml
permissions:
contents: read

interop:
name: interop
needs: build
if: github.event_name != 'pull_request'
uses: ./.github/workflows/interop.yml
with:
module-image: ${{ needs.build.outputs.image }}
permissions:
contents: read
packages: write

pages:
name: pages
needs: build
uses: ./.github/workflows/pages.yml
permissions:
contents: read

release:
name: release
needs: [version, build, test, interop, pages]
if: github.ref_type == 'tag'
uses: ./.github/workflows/release.yml
permissions:
contents: write
packages: write
pages: write
id-token: write
165 changes: 165 additions & 0 deletions .github/workflows/interop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
name: interop

on:
workflow_call:
inputs:
module-image:
description: Image the module was built into, reused for the endpoint.
required: true
type: string

permissions:
contents: read
packages: write

env:
IMAGE: ghcr.io/${{ github.repository }}-interop:${{ github.sha }}
RUNNER: quic-interop/quic-interop-runner

jobs:
build:
name: build
runs-on: ubuntu-latest
outputs:
clients: ${{ steps.clients.outputs.list }}

steps:
- name: Checkout
uses: actions/checkout@v7
with:
submodules: recursive

- name: Set up buildx
uses: docker/setup-buildx-action@v4

- name: Log in to ghcr
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- name: Build endpoint
uses: docker/build-push-action@v7
with:
context: .
file: interop/Containerfile
build-args: MODULE_IMAGE=${{ inputs.module-image }}
tags: ${{ env.IMAGE }}
load: true
cache-from: type=gha,scope=interop
cache-to: type=gha,scope=interop,mode=max

- name: Check exit 127
run: |
rc=0
timeout 120 docker run --rm -e ROLE=server -e TESTCASE=bogus "$IMAGE" || rc=$?
test "$rc" -eq 127

- name: Publish endpoint
uses: docker/build-push-action@v7
with:
context: .
file: interop/Containerfile
build-args: MODULE_IMAGE=${{ inputs.module-image }}
tags: ${{ env.IMAGE }}
push: true
cache-from: type=gha,scope=interop

- name: List clients
id: clients
env:
GH_TOKEN: ${{ github.token }}
run: |
list=$(gh api "repos/$RUNNER/contents/implementations_quic.json" \
-H "Accept: application/vnd.github.raw" |
jq -c '[to_entries[] | select(.value.role != "server") | .key]')
echo "list=$list" | tee -a "$GITHUB_OUTPUT"

test:
name: test (${{ matrix.engine }}, ${{ matrix.client }})
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
strategy:
fail-fast: false
max-parallel: 4
matrix:
engine: [openssl, ngtcp2]
client: ${{ fromJson(needs.build.outputs.clients) }}
env:
CLIENT: ${{ matrix.client }}
ENGINE: ${{ matrix.engine }}

steps:
- name: Checkout runner
uses: actions/checkout@v7
with:
repository: ${{ env.RUNNER }}

- name: Set up docker
uses: docker/setup-docker-action@v5
with:
version: version=v28.3.0

- name: Log in to ghcr
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- name: Set up python
uses: actions/setup-python@v7
with:
python-version: "3.12"
cache: pip

- name: Install runner
run: pip install -r requirements.txt

- name: Install tshark
run: |
sudo add-apt-repository -y ppa:wireshark-dev/nightly
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tshark
sudo modprobe ip6table_filter

- name: Pull images
run: |
docker pull "$IMAGE"
python pull.py -i "$CLIENT"

- name: Pin the engine
run: printf 'FROM %s\nENV ENGINE=%s\n' "$IMAGE" "$ENGINE" | docker build -t "mod_http3-$ENGINE" -

- name: Register endpoint
run: |
jq --arg image "mod_http3-$ENGINE" --arg url "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" \
'. + {mod_http3: {image: $image, role: "server", url: $url}}' \
implementations_quic.json >impls.json
mv impls.json implementations_quic.json

- name: Run matrix
continue-on-error: true
run: python run.py -s mod_http3 -c "$CLIENT" -t http3 -l logs -j results.json

- name: Report verdict
run: |
result=$(jq -r '.results[0][0].result' results.json)
echo "### $ENGINE / $CLIENT — \`$result\`" >>"$GITHUB_STEP_SUMMARY"
case $result in
succeeded) ;;
unsupported) echo "::warning title=$ENGINE/$CLIENT::the client has no http3 test case" ;;
*) echo "::error title=$ENGINE/$CLIENT::http3 $result"; exit 1 ;;
esac

- name: Keep logs
if: failure()
uses: actions/upload-artifact@v7
with:
name: interop-logs-${{ matrix.engine }}-${{ matrix.client }}
path: logs/
retention-days: 14
44 changes: 44 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: pages

on:
workflow_call:

permissions:
contents: read

env:
DOXYBOOK2_URL: https://github.com/matusnovak/doxybook2/releases/download/v1.5.0/doxybook2-linux-amd64-v1.5.0.zip

jobs:
build:
name: build
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v7

- name: Install doxygen
run: |
sudo apt-get update && sudo apt-get install -y doxygen
curl -fsSL -o /tmp/doxybook2.zip "$DOXYBOOK2_URL"
sudo unzip -oj /tmp/doxybook2.zip bin/doxybook2 -d /usr/local/bin
doxybook2 --version

- name: Set up python
uses: actions/setup-python@v7
with:
python-version: "3.x"
cache: pip
cache-dependency-path: docs/site/requirements.txt

- name: Install generator
run: pip install -r docs/site/requirements.txt

- name: Build site
run: bash scripts/generate_docs.sh

- name: Upload site
uses: actions/upload-pages-artifact@v5
with:
path: docs/site/build
Loading