Skip to content

Commit fddae3e

Browse files
committed
ci: dynamic discover-versions; honest matrix labels (review fix)
The matrix on every Debian-container workflow was claiming openssl_ref: 'openssl-3.5.4', but the wolfprov .deb on ghcr.io is built by patching Debian Bookworm's stock libssl3 source -- which is currently 3.0.20. So the matrix label has been lying about what's actually installed and tested. The wolfssl_ref was likewise pinned and could drift. Replaces .github/workflows/_discover-wolfssl.yml with .github/workflows/_discover-versions.yml that resolves both at run time: - wolfSSL latest -stable tag via git ls-remote (same as before). - Debian Bookworm's currently-resolvable OpenSSL via `docker run --rm debian:bookworm apt-cache madison openssl`, stripping the Debian revision suffix. Outputs both plain (`wolfssl_ref`) and JSON-array (`wolfssl_ref_array`) forms; matrix consumers use the array form via fromJson. Wired into every workflow that calls build-wolfprovider.yml (38 heavy workflows + openssl-version.yml's wolfssl axis + the three workflows that previously used the wolfssl-only resolver). Each gets a `discover_versions` job that the build_wolfprovider and test_X jobs depend on. Today's resolution: wolfssl=v5.8.4-stable, openssl=openssl-3.0.20. When Bookworm bumps to 3.0.21 (or whenever) the label tracks automatically -- no CI edit needed.
1 parent b9adb95 commit fddae3e

44 files changed

Lines changed: 468 additions & 277 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Discover wolfSSL + OpenSSL versions
2+
3+
# Reusable workflow that resolves at run time:
4+
# - latest wolfSSL v*-stable tag (from upstream wolfssl/wolfssl)
5+
# - Debian Bookworm's stock OpenSSL version (matches what the
6+
# wolfprov-patched .deb on ghcr.io was built against)
7+
#
8+
# Consumers use these outputs to populate matrix values so the
9+
# matrix labels honestly reflect what the test actually installed.
10+
# Today: latest -> v5.8.4-stable, openssl -> 3.0.20 (Bookworm stock).
11+
# When Bookworm bumps OpenSSL or wolfSSL ships a new -stable, the
12+
# resolver picks it up without a CI edit.
13+
14+
on:
15+
workflow_call:
16+
outputs:
17+
wolfssl_ref:
18+
description: 'Plain string, e.g. v5.8.4-stable'
19+
value: ${{ jobs.discover.outputs.wolfssl_ref }}
20+
wolfssl_ref_array:
21+
description: 'JSON array for matrix use, e.g. ["v5.8.4-stable"]'
22+
value: ${{ jobs.discover.outputs.wolfssl_ref_array }}
23+
openssl_ref:
24+
description: 'Plain string, e.g. openssl-3.0.20'
25+
value: ${{ jobs.discover.outputs.openssl_ref }}
26+
openssl_ref_array:
27+
description: 'JSON array for matrix use, e.g. ["openssl-3.0.20"]'
28+
value: ${{ jobs.discover.outputs.openssl_ref_array }}
29+
30+
jobs:
31+
discover:
32+
name: Resolve wolfSSL + OpenSSL refs
33+
runs-on: ubuntu-latest
34+
timeout-minutes: 5
35+
outputs:
36+
wolfssl_ref: ${{ steps.resolve.outputs.wolfssl_ref }}
37+
wolfssl_ref_array: ${{ steps.resolve.outputs.wolfssl_ref_array }}
38+
openssl_ref: ${{ steps.resolve.outputs.openssl_ref }}
39+
openssl_ref_array: ${{ steps.resolve.outputs.openssl_ref_array }}
40+
steps:
41+
- name: Resolve versions
42+
id: resolve
43+
run: |
44+
set -euo pipefail
45+
46+
# ---- wolfSSL: highest v*-stable tag from upstream ----
47+
WOLFSSL=$(git ls-remote --tags --refs https://github.com/wolfSSL/wolfssl.git 'v*-stable' \
48+
| awk -F/ '{print $NF}' | sort -V | tail -n 1)
49+
if [ -z "${WOLFSSL:-}" ]; then
50+
echo "::error::Could not resolve latest wolfSSL -stable tag"
51+
exit 1
52+
fi
53+
54+
# ---- OpenSSL: whatever Debian Bookworm apt-resolves to ----
55+
# The wolfprov-patched .deb on ghcr.io is built by patching
56+
# Bookworm's stock libssl3 source, so this is the actual
57+
# OpenSSL the Debian-container workflows end up linking against.
58+
# Use docker to ask Bookworm's apt directly, then strip the
59+
# Debian revision (3.0.20-1~deb12u1 -> 3.0.20).
60+
OSSL_RAW=$(docker run --rm debian:bookworm sh -c \
61+
'apt-get update -qq >/dev/null 2>&1 && apt-cache madison openssl | head -1' \
62+
| awk '{print $3}')
63+
if [ -z "${OSSL_RAW:-}" ]; then
64+
echo "::error::Could not resolve Bookworm OpenSSL version"
65+
exit 1
66+
fi
67+
OSSL=$(echo "$OSSL_RAW" | sed 's/-.*//')
68+
69+
echo "wolfSSL latest -stable: $WOLFSSL"
70+
echo "Bookworm OpenSSL: openssl-$OSSL (raw: $OSSL_RAW)"
71+
72+
{
73+
echo "wolfssl_ref=$WOLFSSL"
74+
echo "wolfssl_ref_array=[\"$WOLFSSL\"]"
75+
echo "openssl_ref=openssl-$OSSL"
76+
echo "openssl_ref_array=[\"openssl-$OSSL\"]"
77+
} >> "$GITHUB_OUTPUT"

.github/workflows/_discover-wolfssl.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

.github/workflows/bind9.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,12 @@ jobs:
3838
with:
3939
github-token: ${{ secrets.GITHUB_TOKEN }}
4040

41+
discover_versions:
42+
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
43+
uses: ./.github/workflows/_discover-versions.yml
44+
4145
build_wolfprovider:
42-
needs: wait_for_smoke
46+
needs: [wait_for_smoke, discover_versions]
4347
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
4448
uses: ./.github/workflows/build-wolfprovider.yml
4549
with:
@@ -50,15 +54,15 @@ jobs:
5054
strategy:
5155
fail-fast: false
5256
matrix:
53-
wolfssl_ref: [ 'v5.8.4-stable' ]
54-
openssl_ref: [ 'openssl-3.5.4' ]
57+
wolfssl_ref: ${{ fromJson(needs.discover_versions.outputs.wolfssl_ref_array) }}
58+
openssl_ref: ${{ fromJson(needs.discover_versions.outputs.openssl_ref_array) }}
5559
fips_ref: [ 'FIPS', 'non-FIPS' ]
5660
replace_default: [ true ]
5761

5862
test_bind:
5963
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
6064
runs-on: ubuntu-22.04
61-
needs: build_wolfprovider
65+
needs: [build_wolfprovider, discover_versions]
6266
container:
6367
image: ghcr.io/${{ github.event.pull_request && github.event.pull_request.head.repo.owner.login || github.repository_owner }}/wolfprovider-test-deps:bookworm
6468
env:
@@ -69,8 +73,8 @@ jobs:
6973
fail-fast: false
7074
matrix:
7175
bind_ref: [ 'v9.18.28' ]
72-
wolfssl_ref: [ 'v5.8.4-stable' ]
73-
openssl_ref: [ 'openssl-3.5.4' ]
76+
wolfssl_ref: ${{ fromJson(needs.discover_versions.outputs.wolfssl_ref_array) }}
77+
openssl_ref: ${{ fromJson(needs.discover_versions.outputs.openssl_ref_array) }}
7478
fips_ref: [ 'FIPS', 'non-FIPS' ]
7579
replace_default: [ true ]
7680
env:

.github/workflows/cjose.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,12 @@ jobs:
3838
with:
3939
github-token: ${{ secrets.GITHUB_TOKEN }}
4040

41+
discover_versions:
42+
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
43+
uses: ./.github/workflows/_discover-versions.yml
44+
4145
build_wolfprovider:
42-
needs: wait_for_smoke
46+
needs: [wait_for_smoke, discover_versions]
4347
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
4448
uses: ./.github/workflows/build-wolfprovider.yml
4549
with:
@@ -50,15 +54,15 @@ jobs:
5054
strategy:
5155
fail-fast: false
5256
matrix:
53-
wolfssl_ref: [ 'v5.8.4-stable' ]
54-
openssl_ref: [ 'openssl-3.5.4' ]
57+
wolfssl_ref: ${{ fromJson(needs.discover_versions.outputs.wolfssl_ref_array) }}
58+
openssl_ref: ${{ fromJson(needs.discover_versions.outputs.openssl_ref_array) }}
5559
fips_ref: [ 'FIPS', 'non-FIPS' ]
5660
replace_default: [ true ]
5761

5862
test_cjose:
5963
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
6064
runs-on: ubuntu-22.04
61-
needs: build_wolfprovider
65+
needs: [build_wolfprovider, discover_versions]
6266
# Run inside Debian Bookworm to match packaging environment
6367
container:
6468
image: ghcr.io/${{ github.event.pull_request && github.event.pull_request.head.repo.owner.login || github.repository_owner }}/wolfprovider-test-deps:bookworm
@@ -71,8 +75,8 @@ jobs:
7175
matrix:
7276
# Dont test osp master since it might be unstable
7377
cjose_ref: [ 'v0.6.2.1' ]
74-
wolfssl_ref: [ 'v5.8.4-stable' ]
75-
openssl_ref: [ 'openssl-3.5.4' ]
78+
wolfssl_ref: ${{ fromJson(needs.discover_versions.outputs.wolfssl_ref_array) }}
79+
openssl_ref: ${{ fromJson(needs.discover_versions.outputs.openssl_ref_array) }}
7680
fips_ref: [ 'FIPS', 'non-FIPS' ]
7781
replace_default: [ true ]
7882
env:

.github/workflows/curl.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,12 @@ jobs:
3838
with:
3939
github-token: ${{ secrets.GITHUB_TOKEN }}
4040

41+
discover_versions:
42+
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
43+
uses: ./.github/workflows/_discover-versions.yml
44+
4145
build_wolfprovider:
42-
needs: wait_for_smoke
46+
needs: [wait_for_smoke, discover_versions]
4347
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
4448
uses: ./.github/workflows/build-wolfprovider.yml
4549
with:
@@ -50,15 +54,15 @@ jobs:
5054
strategy:
5155
fail-fast: false
5256
matrix:
53-
wolfssl_ref: [ 'v5.8.4-stable' ]
54-
openssl_ref: [ 'openssl-3.5.4' ]
57+
wolfssl_ref: ${{ fromJson(needs.discover_versions.outputs.wolfssl_ref_array) }}
58+
openssl_ref: ${{ fromJson(needs.discover_versions.outputs.openssl_ref_array) }}
5559
fips_ref: [ 'FIPS', 'non-FIPS' ]
5660
replace_default: [ true ]
5761

5862
test_curl:
5963
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
6064
runs-on: ubuntu-22.04
61-
needs: build_wolfprovider
65+
needs: [build_wolfprovider, discover_versions]
6266
container:
6367
image: ghcr.io/${{ github.event.pull_request && github.event.pull_request.head.repo.owner.login || github.repository_owner }}/wolfprovider-test-deps:bookworm
6468
env:
@@ -70,8 +74,8 @@ jobs:
7074
matrix:
7175
# PR runs latest curl only. Older refs are exercised at release time.
7276
curl_ref: [ 'curl-8_4_0' ]
73-
wolfssl_ref: [ 'v5.8.4-stable' ]
74-
openssl_ref: [ 'openssl-3.5.4' ]
77+
wolfssl_ref: ${{ fromJson(needs.discover_versions.outputs.wolfssl_ref_array) }}
78+
openssl_ref: ${{ fromJson(needs.discover_versions.outputs.openssl_ref_array) }}
7579
fips_ref: [ 'FIPS', 'non-FIPS' ]
7680
replace_default: [ true ]
7781
# force_fail collapsed into sequential runs in the test step

.github/workflows/debian-package.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,12 @@ jobs:
3838
with:
3939
github-token: ${{ secrets.GITHUB_TOKEN }}
4040

41+
discover_versions:
42+
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
43+
uses: ./.github/workflows/_discover-versions.yml
44+
4145
build_wolfprovider:
42-
needs: wait_for_smoke
46+
needs: [wait_for_smoke, discover_versions]
4347
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
4448
uses: ./.github/workflows/build-wolfprovider.yml
4549
with:
@@ -50,16 +54,16 @@ jobs:
5054
strategy:
5155
fail-fast: false
5256
matrix:
53-
wolfssl_ref: [ 'v5.8.4-stable' ]
54-
openssl_ref: [ 'openssl-3.5.4' ]
57+
wolfssl_ref: ${{ fromJson(needs.discover_versions.outputs.wolfssl_ref_array) }}
58+
openssl_ref: ${{ fromJson(needs.discover_versions.outputs.openssl_ref_array) }}
5559
fips_ref: [ 'FIPS', 'non-FIPS' ]
5660
replace_default: [ true, false ]
5761

5862
libwolfprov-replace-default:
5963
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
6064
name: libwolfprov ${{ matrix.replace_default && 'replace-default' || 'standalone' }} ${{ matrix.fips_ref }}
6165
runs-on: ubuntu-22.04
62-
needs: build_wolfprovider
66+
needs: [build_wolfprovider, discover_versions]
6367
# Run inside Debian Bookworm to match packaging environment
6468
container:
6569
image: ghcr.io/${{ github.event.pull_request && github.event.pull_request.head.repo.owner.login || github.repository_owner }}/wolfprovider-test-deps:bookworm
@@ -70,8 +74,8 @@ jobs:
7074
strategy:
7175
fail-fast: false
7276
matrix:
73-
wolfssl_ref: [ 'v5.8.4-stable' ]
74-
openssl_ref: [ 'openssl-3.5.4' ]
77+
wolfssl_ref: ${{ fromJson(needs.discover_versions.outputs.wolfssl_ref_array) }}
78+
openssl_ref: ${{ fromJson(needs.discover_versions.outputs.openssl_ref_array) }}
7579
fips_ref: [ 'FIPS', 'non-FIPS' ]
7680
replace_default: [ true, false ]
7781
# force_fail collapsed into sequential runs in the test step

.github/workflows/git-ssh-dr.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,12 @@ jobs:
3636
with:
3737
github-token: ${{ secrets.GITHUB_TOKEN }}
3838

39+
discover_versions:
40+
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
41+
uses: ./.github/workflows/_discover-versions.yml
42+
3943
build_wolfprovider:
40-
needs: wait_for_smoke
44+
needs: [wait_for_smoke, discover_versions]
4145
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
4246
uses: ./.github/workflows/build-wolfprovider.yml
4347
with:
@@ -48,8 +52,8 @@ jobs:
4852
strategy:
4953
fail-fast: false
5054
matrix:
51-
wolfssl_ref: [ 'v5.8.4-stable' ]
52-
openssl_ref: [ 'openssl-3.5.4' ]
55+
wolfssl_ref: ${{ fromJson(needs.discover_versions.outputs.wolfssl_ref_array) }}
56+
openssl_ref: ${{ fromJson(needs.discover_versions.outputs.openssl_ref_array) }}
5357
fips_ref: [ 'FIPS', 'non-FIPS' ]
5458
replace_default: [ true ]
5559

@@ -60,14 +64,14 @@ jobs:
6064
image: ghcr.io/${{ github.event.pull_request && github.event.pull_request.head.repo.owner.login || github.repository_owner }}/wolfprovider-test-deps:bookworm
6165
env:
6266
DEBIAN_FRONTEND: noninteractive
63-
needs: build_wolfprovider
67+
needs: [build_wolfprovider, discover_versions]
6468
# This should be a safe limit for the tests to run.
6569
timeout-minutes: 20
6670
strategy:
6771
fail-fast: false
6872
matrix:
69-
wolfssl_ref: [ 'v5.8.4-stable' ]
70-
openssl_ref: [ 'openssl-3.5.4' ]
73+
wolfssl_ref: ${{ fromJson(needs.discover_versions.outputs.wolfssl_ref_array) }}
74+
openssl_ref: ${{ fromJson(needs.discover_versions.outputs.openssl_ref_array) }}
7175
fips_ref: [ 'FIPS', 'non-FIPS' ]
7276
replace_default: [ true ]
7377
# PR matrix: 2 of 4 key types and 3 iterations.

.github/workflows/grpc.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,12 @@ jobs:
3838
with:
3939
github-token: ${{ secrets.GITHUB_TOKEN }}
4040

41+
discover_versions:
42+
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
43+
uses: ./.github/workflows/_discover-versions.yml
44+
4145
build_wolfprovider:
42-
needs: wait_for_smoke
46+
needs: [wait_for_smoke, discover_versions]
4347
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
4448
uses: ./.github/workflows/build-wolfprovider.yml
4549
with:
@@ -50,15 +54,15 @@ jobs:
5054
strategy:
5155
fail-fast: false
5256
matrix:
53-
wolfssl_ref: [ 'v5.8.4-stable' ]
54-
openssl_ref: [ 'openssl-3.5.4' ]
57+
wolfssl_ref: ${{ fromJson(needs.discover_versions.outputs.wolfssl_ref_array) }}
58+
openssl_ref: ${{ fromJson(needs.discover_versions.outputs.openssl_ref_array) }}
5559
fips_ref: [ 'FIPS', 'non-FIPS' ]
5660
replace_default: [ true ]
5761

5862
test_grpc:
5963
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
6064
runs-on: ubuntu-22.04
61-
needs: build_wolfprovider
65+
needs: [build_wolfprovider, discover_versions]
6266
container:
6367
image: ghcr.io/${{ github.event.pull_request && github.event.pull_request.head.repo.owner.login || github.repository_owner }}/wolfprovider-test-deps:bookworm
6468
env:
@@ -76,8 +80,8 @@ jobs:
7680
ssl_transport_security_test ssl_transport_security_utils_test
7781
test_core_security_ssl_credentials_test test_cpp_end2end_ssl_credentials_test
7882
h2_ssl_cert_test h2_ssl_session_reuse_test
79-
wolfssl_ref: [ 'v5.8.4-stable' ]
80-
openssl_ref: [ 'openssl-3.5.4' ]
83+
wolfssl_ref: ${{ fromJson(needs.discover_versions.outputs.wolfssl_ref_array) }}
84+
openssl_ref: ${{ fromJson(needs.discover_versions.outputs.openssl_ref_array) }}
8185
fips_ref: [ 'FIPS', 'non-FIPS' ]
8286
replace_default: [ true ]
8387
# force_fail collapsed into sequential runs in the test step

0 commit comments

Comments
 (0)