Skip to content

Add CI tests for github workflows #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
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
108 changes: 108 additions & 0 deletions .github/workflows/async.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Async Tests

# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION

jobs:
build_wolfprovider:
name: Build wolfProvider
runs-on: ubuntu-22.04
timeout-minutes: 20
strategy:
matrix:
wolfssl_ref: [ 'master', 'v5.7.4-stable' ]
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
- name: Checking wolfSSL/wolfProvider in cache
uses: actions/cache@v4
id: wolfprov-cache
with:
path: |
wolfssl-source
wolfssl-install
wolfprov-install
provider.conf

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

# If wolfssl/wolfprovider have not yet been built, pull ossl from cache
- name: Checking OpenSSL in cache
if: steps.wolfprov-${{ matrix.wolfssl_ref }}-cache.hit != 'true'
uses: actions/cache@v4
id: openssl-cache
with:
path: |
openssl-source
openssl-install

key: ossl-depends

# If not yet built this version, build it now
- name: Build wolfProvider with async support
if: steps.wolfprov-${{ matrix.wolfssl_ref }}-cache.hit != 'true'
run: |
WOLFSSL_TAG=${{ matrix.wolfssl_ref }} WOLFSSL_CONFIGURE="--enable-asynccrypt" ./scripts/build-wolfprovider.sh

- name: Print errors
if: ${{ failure() }}
run: |
if [ -f test-suite.log ] ; then
cat test-suite.log
fi

test_async:
runs-on: ubuntu-22.04
needs: build_wolfprovider
# This should be a safe limit for the tests to run.
timeout-minutes: 20
strategy:
matrix:
wolfssl_ref: [ 'master', 'v5.7.4-stable' ]
steps:
- name: Retrieving OpenSSL from cache
uses: actions/cache/restore@v4
id: openssl-cache
with:
path: |
openssl-source
openssl-install

key: ossl-depends
fail-on-cache-miss: true

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

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

- name: Checkout wolfProvider
uses: actions/checkout@v4

- name: Test wolfProvider with async
run: |
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
./scripts/test-openssl.sh
139 changes: 139 additions & 0 deletions .github/workflows/bind.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
name: Bind9 Tests

# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION

jobs:
build_wolfprovider:
name: Build wolfProvider
runs-on: ubuntu-22.04
timeout-minutes: 20
strategy:
matrix:
wolfssl_ref: [ 'master', 'v5.7.4-stable' ]
steps:
- name: Checkout wolfProvider
uses: actions/checkout@v4

# Check if this version of wolfssl/wolfprovider has already been built
- name: Checking wolfSSL/wolfProvider in cache
uses: actions/cache@v4
id: wolfprov-cache
with:
path: |
wolfssl-source
wolfssl-install
wolfprov-install
provider.conf

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

# 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@v4
id: openssl-cache
with:
path: |
openssl-source
openssl-install

key: ossl-depends
fail-on-cache-miss: false

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

- name: Print errors
if: ${{ failure() }}
run: |
if [ -f test-suite.log ] ; then
cat test-suite.log
fi

test_bind:
runs-on: ubuntu-22.04
needs: build_wolfprovider
# This should be a safe limit for the tests to run.
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
bind_ref: [ '9.18.0', '9.18.28' ]
wolfssl_ref: [ 'master', 'v5.7.4-stable' ]
steps:
- name: Retrieving OpenSSL from cache
uses: actions/cache/restore@v4
id: openssl-cache
with:
path: |
openssl-source
openssl-install

key: ossl-depends
fail-on-cache-miss: false

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

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

- name: Install dependencies
run: |
# Don't prompt for anything
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
# bind9 dependencies
sudo apt-get install -y libuv1-dev libnghttp2-dev libcap-dev libcmocka-dev

- name: Checkout bind9
uses: actions/checkout@v4
with:
repository: isc-projects/bind9
path: bind9
ref: v${{ matrix.bind_ref }}

- name: Build and test bind9 with wolfProvider
working-directory: bind9
run: |
# Setup environment for wolfProvider
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

# Generate configure script
autoreconf -ivf

# Configure with OpenSSL
./configure --with-openssl=$GITHUB_WORKSPACE/openssl-install

# Disable system tests and dst_test
sed -i 's/SUBDIRS = system//g' bin/tests/Makefile
sed -i 's/dst_test//g' lib/dns/tests/Makefile

# Build bind9
make -j$(nproc) V=1

# Run tests
make -j$(nproc) V=1 check
100 changes: 100 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: WolfProvider CMake Tests

# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION

jobs:
build_wolfprovider:
name: Build wolfProvider
runs-on: ubuntu-22.04
timeout-minutes: 20
strategy:
matrix:
wolfssl_ref: [ 'master', 'v5.7.4-stable' ]
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
- name: Checking wolfSSL/wolfProvider in cache
uses: actions/cache@v4
id: wolfprov-cache
with:
path: |
wolfssl-source
wolfssl-install
wolfprov-install
provider.conf

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

# If wolfssl/wolfprovider have not yet been built, pull ossl from cache
- name: Checking OpenSSL in cache
if: steps.wolfprov-${{ matrix.wolfssl_ref }}-cache.hit != 'true'
uses: actions/cache@v4
id: openssl-cache
with:
path: |
openssl-source
openssl-install

key: ossl-depends

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

- name: Print errors
if: ${{ failure() }}
run: |
if [ -f test-suite.log ] ; then
cat test-suite.log
fi

test_cmake:
name: Test CMake
runs-on: ubuntu-22.04
needs: build_wolfprovider
# This should be a safe limit for the tests to run.
timeout-minutes: 20
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build

# Build wolfProvider with standard options
- name: Build wolfProvider
run: |
mkdir build
cd build
cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/wolfprov-install" \
-DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/openssl-install;$GITHUB_WORKSPACE/install" \
-DWITH_OPENSSL3=ON \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_EXAMPLE=ON \
-DBUILD_TESTS=ON \
-DCMAKE_C_FLAGS="-Wall -Wextra -Werror" \
..
cmake --build .
ctest -j $(nproc)
cmake --install .

# clean up
cd ..
rm -rf build

Loading