123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- name: memcached 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_wolfssl:
- name: Build wolfSSL
- # Just to keep it the same as the testing target
- if: github.repository_owner == 'wolfssl'
- runs-on: ubuntu-22.04
- steps:
- - name: Build wolfSSL
- uses: wolfSSL/actions-build-autotools-project@v1
- with:
- path: wolfssl
- configure: --enable-memcached
- install: true
- - name: Bundle Docker entry point
- run: cp wolfssl/.github/workflows/memcached.sh build-dir/bin
- - name: tar build-dir
- run: tar -zcf build-dir.tgz build-dir
- - name: Upload built lib
- uses: actions/upload-artifact@v4
- with:
- name: wolf-install-memcached
- path: build-dir.tgz
- retention-days: 5
- memcached_check:
- strategy:
- fail-fast: false
- matrix:
- # List of releases to test
- include:
- - ref: 1.6.22
- name: ${{ matrix.ref }}
- if: github.repository_owner == 'wolfssl'
- runs-on: ubuntu-22.04
- needs: build_wolfssl
- steps:
- - name: Download lib
- uses: actions/download-artifact@v4
- with:
- name: wolf-install-memcached
- - name: untar build-dir
- run: tar -xf build-dir.tgz
- - name: Checkout OSP
- uses: actions/checkout@v4
- with:
- repository: wolfssl/osp
- path: osp
- - name: Install dependencies
- run: |
- export DEBIAN_FRONTEND=noninteractive
- sudo apt-get update
- sudo apt-get install -y libevent-dev libevent-2.1-7 automake pkg-config make libio-socket-ssl-perl
- - name: Checkout memcached
- uses: actions/checkout@v4
- with:
- repository: memcached/memcached
- ref: 1.6.22
- path: memcached
- - name: Configure and build memcached
- run: |
- cd $GITHUB_WORKSPACE/memcached/
- patch -p1 < $GITHUB_WORKSPACE/osp/memcached/memcached_1.6.22.patch
- ./autogen.sh
- export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/build-dir/lib:$LD_LIBRARY_PATH
- PKG_CONFIG_PATH=$GITHUB_WORKSPACE/build-dir/lib/pkgconfig ./configure --enable-wolfssl
- make -j$(nproc)
- - name: Confirm memcached built with wolfSSL
- working-directory: ./memcached
- run: |
- export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/build-dir/lib:$LD_LIBRARY_PATH
- ldd memcached | grep wolfssl
- - name: Run memcached tests
- working-directory: ./memcached
- run: |
- # Retry up to three times
- # Using docker because interrupting the tests doesn't close running
- # background servers. They can become daemonized and then all re-runs
- # will always fail.
- chmod +x $GITHUB_WORKSPACE/build-dir/bin/memcached.sh
- for i in {1..3}; do
- echo "-------- RUNNING TESTS --------"
- MEMCACHED_RES=0 # Not set when command succeeds
- # Tests should usually take less than 4 minutes. If already taking
- # 5 minutes then they are probably stuck. Interrupt and re-run.
- time timeout -s SIGKILL 5m docker run -v /:/host \
- -v $GITHUB_WORKSPACE/build-dir/bin/memcached.sh:/memcached.sh \
- -e GITHUB_WORKSPACE=$GITHUB_WORKSPACE \
- -e HOST_ROOT=/host \
- -e LD_LIBRARY_PATH=$GITHUB_WORKSPACE/build-dir/lib:$LD_LIBRARY_PATH \
- alpine:latest /memcached.sh || MEMCACHED_RES=$?
- if [ "$MEMCACHED_RES" -eq "0" ]; then
- break
- fi
- done
- echo "test ran $i times"
- if [ "$MEMCACHED_RES" -ne "0" ]; then
- exit $MEMCACHED_RES
- fi
|