Skip to content
Closed
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
112 changes: 12 additions & 100 deletions .github/workflows/build-wolfprovider.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,141 +12,53 @@ on:
outputs:
cache_key:
description: "Cache key for the build artifacts"
value: ${{ jobs.build_wolfprovider_common.outputs.cache_key }}
value: ${{ jobs.build_wolfprovider.outputs.cache_key }}

jobs:
build_wolfprovider_common:
build_wolfprovider:
name: Build wolfProvider
runs-on: ubuntu-22.04
timeout-minutes: 20
outputs:
cache_key: wolfprov-${{ inputs.wolfssl_ref }}-${{ inputs.openssl_ref }}-${{ github.sha }}
cache_key: wolfprov-${{ inputs.wolfssl_ref }}-${{ github.sha }}
steps:
- name: Checkout wolfProvider
uses: actions/checkout@v4

# Check if this version of wolfssl/wolfprovider has already been built,
# mark to cache these items on post if we do end up building
# On a push, the first workflow(s) will complete the build and cache it
# and any delayed workflow will be able to utilize it.
# This is not designed to cache builds across commits.
- name: Checking wolfSSL/wolfProvider in cache
uses: actions/cache@v4
id: wolfprov-cache
with:
path: |
scripts
wolfssl-source
wolfssl-install
wolfprov-install
openssl-install
provider.conf

key: wolfprov-${{ inputs.wolfssl_ref }}-${{ inputs.openssl_ref }}-${{ github.sha }}
key: wolfprov-${{ inputs.wolfssl_ref }}-${{ github.sha }}
lookup-only: true

# if cache hit, exit the workflow
- name: Exit workflow if cache hit
if: steps.wolfprov-cache.outputs.cache-hit == 'true'
run: |
echo "Found cached build, exiting workflow"
exit 0

- name: Checkout wolfProvider
if: steps.wolfprov-cache.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
fetch-depth: 1

# Convert OpenSSL branch name to commit hash if needed
- name: Get OpenSSL commit hash
if: steps.wolfprov-cache.outputs.cache-hit != 'true'
id: openssl-ref
run: |
if [[ "${{ inputs.openssl_ref }}" =~ ^[0-9a-f]{40}$ ]]; then
echo "ref=${{ inputs.openssl_ref }}" >> $GITHUB_OUTPUT
else
sha=$(curl -s "https://api.github.com/repos/openssl/openssl/commits/${{ inputs.openssl_ref }}" | jq -r '.sha')
echo "ref=$sha" >> $GITHUB_OUTPUT
echo "OpenSSL ref ${{ inputs.openssl_ref }} is commit $sha"
fi

# Look for a cached version of OpenSSL
# If wolfssl/wolfprovider have not yet been built, pull ossl from cache
- name: Checking OpenSSL in cache
if: steps.wolfprov-cache.outputs.cache-hit != 'true'
uses: actions/cache/restore@v4
uses: actions/cache@v4
id: openssl-cache
with:
path: |
openssl-source
openssl-install

key: ossl-depends-${{ steps.openssl-ref.outputs.ref }}
lookup-only: false

# Convert WolfSSL branch name to commit hash if needed
- name: Get WolfSSL commit hash
if: steps.wolfprov-cache.outputs.cache-hit != 'true'
id: wolfssl-ref
run: |
if [[ "${{ inputs.wolfssl_ref }}" =~ ^[0-9a-f]{40}$ ]]; then
echo "ref=${{ inputs.wolfssl_ref }}" >> $GITHUB_OUTPUT
else
sha=$(curl -s "https://api.github.com/repos/wolfssl/wolfssl/commits/${{ inputs.wolfssl_ref }}" | jq -r '.sha')
echo "ref=$sha" >> $GITHUB_OUTPUT
echo "WolfSSL ref ${{ inputs.wolfssl_ref }} is commit $sha"
fi

# Look for a cached version of WolfSSL
- name: Checking WolfSSL in cache
if: steps.wolfprov-cache.outputs.cache-hit != 'true'
uses: actions/cache/restore@v4
id: wolfssl-cache
with:
path: |
wolfssl-source
wolfssl-install

key: wolfssl-depends-${{ steps.wolfssl-ref.outputs.ref }}
lookup-only: false
key: ossl-depends-${{ inputs.openssl_ref }}-${{ github.sha }}
lookup-only: true

# If not yet built this version, build it now
- name: Build wolfProvider
if: steps.wolfprov-cache.outputs.cache-hit != 'true'
run: |
OPENSSL_TAG=${{ inputs.openssl_ref }} WOLFSSL_TAG=${{ inputs.wolfssl_ref }} ./scripts/build-wolfprovider.sh

# This is potentially chewing up a lot of cache space.
# Could investigate reducing the size of this cache.
# Note that we use actions/cache/save and actions/cache/restore instead of
# actions/cache to reduce the chance of a cache lock issue.
- name: Save wolfProvider into cache
if: steps.wolfprov-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
wolfssl-source
wolfssl-install
wolfprov-install
openssl-install
provider.conf
key: wolfprov-${{ inputs.wolfssl_ref }}-${{ inputs.openssl_ref }}-${{ github.sha }}

# If openssl cache miss, save it to the cache
- name: Save OpenSSL into cache
if: steps.openssl-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
openssl-source
openssl-install
key: ossl-depends-${{ steps.openssl-ref.outputs.ref }}

- name: Save WolfSSL into cache
if: steps.wolfssl-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
wolfssl-source
wolfssl-install
key: wolfssl-depends-${{ steps.wolfssl-ref.outputs.ref }}

- name: Print errors
if: ${{ failure() }}
run: |
Expand Down
41 changes: 29 additions & 12 deletions .github/workflows/cjose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: cjose Tests
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
branches: ['*'] # [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]

Expand All @@ -20,7 +20,7 @@ jobs:
openssl_ref: ${{ matrix.openssl_ref }}
strategy:
matrix:
wolfssl_ref: [ 'master', 'v5.8.0-stable' ]
wolfssl_ref: [ 'v5.8.0-stable' ]
openssl_ref: [ 'openssl-3.5.0' ]

test_cjose:
Expand All @@ -31,28 +31,39 @@ jobs:
strategy:
matrix:
cjose_ref: [ 'master', 'v0.6.2.1' ]
wolfssl_ref: [ 'master', 'v5.8.0-stable' ]
wolfssl_ref: [ 'v5.8.0-stable' ]
openssl_ref: [ 'openssl-3.5.0' ]
force_fail: [ 'WOLFPROV_FORCE_FAIL=1', '' ]
steps:
# Checkout the source so we can run the check-workflow-result script
- name: Checkout wolfProvider
uses: actions/checkout@v4
with:
fetch-depth: 1
sparse-checkout: |
.github

- name: Retrieving wolfProvider from cache
- name: Retrieving OpenSSL from cache
uses: actions/cache/restore@v4
id: wolfprov-cache-restore
id: openssl-cache
with:
path: |
openssl-source
openssl-install

key: ossl-depends-${{ matrix.openssl_ref }}-${{ github.sha }}
fail-on-cache-miss: true

- name: Retrieving wolfSSL/wolfProvider from cache
uses: actions/cache/restore@v4
id: wolfprov-cache
with:
path: |
scripts
wolfssl-source
wolfssl-install
wolfprov-install
openssl-install
provider.conf

key: wolfprov-${{ matrix.wolfssl_ref }}-${{ matrix.openssl_ref }}-${{ github.sha }}
key: wolfprov-${{ matrix.wolfssl_ref }}-${{ github.sha }}
fail-on-cache-miss: true

- name: Install cjose dependencies
Expand All @@ -67,13 +78,12 @@ jobs:
repository: OpenIDC/cjose
ref: ${{ matrix.cjose_ref }}
path: cjose
fetch-depth: 1

- name: Build cjose
working-directory: cjose
run: |
# Configure with OpenSSL
./configure CFLAGS="-Wno-error=deprecated-declarations" --with-openssl=/git/wolfProvider/openssl-install
./configure CFLAGS="-Wno-error=deprecated-declarations" --with-openssl=/git/wolfProvider/openssl-install

# Build cjose
make
Expand All @@ -82,8 +92,15 @@ jobs:
working-directory: cjose
run: |
# Set up the environment for wolfProvider
source $GITHUB_WORKSPACE/scripts/env-setup
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/wolfssl-install/lib:$GITHUB_WORKSPACE/openssl-install/lib64
export OPENSSL_CONF=$GITHUB_WORKSPACE/provider.conf
export OPENSSL_MODULES=$GITHUB_WORKSPACE/wolfprov-install/lib
export ${{ matrix.force_fail }}
export SHELL=/bin/bash

echo "Checking OpenSSL providers:"
$GITHUB_WORKSPACE/openssl-install/bin/openssl list -providers | tee provider-list.log
grep -q libwolfprov provider-list.log || (echo "ERROR: libwolfprov not found in OpenSSL providers" && exit 1)

# Run tests
make test || true
Expand Down
28 changes: 21 additions & 7 deletions .github/workflows/curl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,29 @@ jobs:
steps:
- name: Checkout wolfProvider
uses: actions/checkout@v4

- name: Retrieving OpenSSL from cache
uses: actions/cache/restore@v4
id: openssl-cache
with:
fetch-depth: 1

path: |
openssl-source
openssl-install

key: ossl-depends-${{ matrix.openssl_ref }}-${{ github.sha }}
fail-on-cache-miss: true

- name: Retrieving wolfSSL/wolfProvider from cache
uses: actions/cache/restore@v4
id: wolfprov-cache
with:
path: |
scripts
wolfssl-source
wolfssl-install
wolfprov-install
openssl-install
provider.conf

key: wolfprov-${{ matrix.wolfssl_ref }}-${{ matrix.openssl_ref }}-${{ github.sha }}
key: wolfprov-${{ matrix.wolfssl_ref }}-${{ github.sha }}
fail-on-cache-miss: true

- name: Install dependencies
Expand Down Expand Up @@ -83,11 +90,18 @@ jobs:
- name: Test curl with wolfProvider
working-directory: curl
run: |
# Set up the environment for wolfProvider
source $GITHUB_WORKSPACE/scripts/env-setup
# Set environment variables
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/wolfssl-install/lib:$GITHUB_WORKSPACE/openssl-install/lib64
export OPENSSL_CONF=$GITHUB_WORKSPACE/provider.conf
export OPENSSL_MODULES=$GITHUB_WORKSPACE/wolfprov-install/lib
export PKG_CONFIG_PATH=$GITHUB_WORKSPACE/openssl-install/lib64/pkgconfig
export ${{ matrix.force_fail }}
export CURL_REF=${{ matrix.curl_ref }}

echo "Checking OpenSSL providers:"
$GITHUB_WORKSPACE/openssl-install/bin/openssl list -providers | tee provider-list.log
grep -q libwolfprov provider-list.log || (echo "ERROR: libwolfprov not found in OpenSSL providers" && exit 1)

# Run tests and save output to test.log
mkdir -p tests
make -j$(nproc) test-ci 2>&1 | tee tests/test.log
Expand Down
28 changes: 20 additions & 8 deletions .github/workflows/grpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,29 @@ jobs:
steps:
- name: Checkout wolfProvider
uses: actions/checkout@v4

- name: Retrieving OpenSSL from cache
uses: actions/cache/restore@v4
id: openssl-cache
with:
fetch-depth: 1

path: |
openssl-source
openssl-install

key: ossl-depends-${{ matrix.openssl_ref }}-${{ github.sha }}
fail-on-cache-miss: true

- name: Retrieving wolfSSL/wolfProvider from cache
uses: actions/cache/restore@v4
id: wolfprov-cache
with:
path: |
scripts
wolfssl-source
wolfssl-install
wolfprov-install
openssl-install
provider.conf

key: wolfprov-${{ matrix.wolfssl_ref }}-${{ matrix.openssl_ref }}-${{ github.sha }}
key: wolfprov-${{ matrix.wolfssl_ref }}-${{ github.sha }}
fail-on-cache-miss: true

- name: Confirm IPv4 and IPv6 support
Expand Down Expand Up @@ -87,9 +94,14 @@ jobs:
- name: Build grpc with wolfProvider
working-directory: ./grpc
run: |
# Set up the environment for wolfProvider
source $GITHUB_WORKSPACE/scripts/env-setup
export ${{ matrix.force_fail }}
# Setup environment for wolfProviders
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/wolfssl-install/lib:$GITHUB_WORKSPACE/openssl-install/lib64
export OPENSSL_CONF=$GITHUB_WORKSPACE/provider.conf
export OPENSSL_MODULES=$GITHUB_WORKSPACE/wolfprov-install/lib

echo "Checking OpenSSL providers:"
$GITHUB_WORKSPACE/openssl-install/bin/openssl list -providers | tee provider-list.log
grep -q libwolfprov provider-list.log || (echo "ERROR: libwolfprov not found in OpenSSL providers" && exit 1)

# Initialize submodules
git submodule update --init
Expand Down
Loading
Loading