Skip to content

Commit b68653b

Browse files
author
Bridger Voss
committed
test github actions for libhashkit2
1 parent f494d08 commit b68653b

1 file changed

Lines changed: 100 additions & 0 deletions

File tree

.github/workflows/libhashkit2.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: libhashkit2 Tests
2+
3+
# START OF COMMON SECTION
4+
on:
5+
push:
6+
branches: [ '*' ] #'master', 'main', 'release/**' ]
7+
pull_request:
8+
branches: [ '*' ]
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
# END OF COMMON SECTION
14+
15+
jobs:
16+
build_wolfprovider:
17+
uses: ./.github/workflows/build-wolfprovider.yml
18+
with:
19+
wolfssl_ref: ${{ matrix.wolfssl_ref }}
20+
openssl_ref: ${{ matrix.openssl_ref }}
21+
strategy:
22+
matrix:
23+
wolfssl_ref: [ 'master', 'v5.8.0-stable' ]
24+
openssl_ref: [ 'openssl-3.5.0' ]
25+
26+
test_libhashkit2:
27+
runs-on: ubuntu-22.04
28+
needs: build_wolfprovider
29+
# This should be a safe limit for the tests to run.
30+
timeout-minutes: 20
31+
strategy:
32+
matrix:
33+
libhashkit2_ref: [ 'v1.x', '1.1.4' ]
34+
wolfssl_ref: [ 'master', 'v5.8.0-stable' ]
35+
openssl_ref: [ 'openssl-3.5.0' ]
36+
force_fail: [ 'WOLFPROV_FORCE_FAIL=1', '' ]
37+
exclude:
38+
- libhashkit2_ref: 'v1.x'
39+
force_fail: 'WOLFPROV_FORCE_FAIL=1'
40+
steps:
41+
- name: Checkout wolfProvider
42+
uses: actions/checkout@v4
43+
with:
44+
fetch-depth: 1
45+
46+
- name: Retrieving wolfProvider from cache
47+
uses: actions/cache/restore@v4
48+
id: wolfprov-cache-restore
49+
with:
50+
path: |
51+
wolfssl-install
52+
wolfprov-install
53+
openssl-install/lib64
54+
openssl-install/include
55+
openssl-install/bin
56+
57+
key: wolfprov-${{ matrix.wolfssl_ref }}-${{ matrix.openssl_ref }}-${{ github.sha }}
58+
fail-on-cache-miss: true
59+
60+
- name: Install libmemcached dependencies
61+
run: |
62+
sudo apt-get update
63+
sudo apt-get install cmake build-essential bison flex memcached libc6
64+
65+
- name: Download libmemcached
66+
uses: actions/checkout@v4
67+
with:
68+
repository: awesomized/libmemcached
69+
ref: ${{ matrix.libhashkit2_ref }}
70+
path: libmemcached
71+
fetch-depth: 1
72+
73+
- name: Build libmemcached
74+
working-directory: libmemcached
75+
run: |
76+
# OPENSSL_ROOT_DIR is needed for cmake to find OpenSSL headers
77+
export OPENSSL_ROOT_DIR=$GITHUB_WORKSPACE/openssl-install/include
78+
# Build libmemcached with OpenSSL support
79+
mkdir build
80+
cd build
81+
cmake -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Debug -DENABLE_OPENSSL_CRYPTO=ON ..
82+
make
83+
84+
- name: Run libhashkit2 tests
85+
working-directory: libmemcached/build
86+
run: |
87+
# Set up the environment for wolfProvider
88+
source $GITHUB_WORKSPACE/scripts/env-setup
89+
export ${{ matrix.force_fail }}
90+
91+
# Run tests
92+
make test 2>&1 | tee libhashkit2-test.log
93+
if grep -q "(Failed)" libhashkit2-test.log; then
94+
TEST_RESULT=1
95+
else
96+
TEST_RESULT=0
97+
fi
98+
echo "TEST_RESULT = $TEST_RESULT"
99+
100+
$GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT ${{ matrix.force_fail }} libhashkit2

0 commit comments

Comments
 (0)