Skip to content

Commit

Permalink
ci: add tests running on ee
Browse files Browse the repository at this point in the history
Since we support SSL in this module, it is neccessary to test it on
Tararntool EE instances.

After the patch Tarantool EE test env preparation was added and changed
coveralls target from Tarantool 2.11 CE on Tarantool 3.2 EE.
  • Loading branch information
themilchenko committed Nov 8, 2024
1 parent 5ba2bc8 commit c7f494c
Show file tree
Hide file tree
Showing 2 changed files with 117 additions and 5 deletions.
61 changes: 61 additions & 0 deletions .github/actions/prepare-ee-test-env/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: "Prepare test environment with Tarantool EE"
description: "Prepares test environment with Tarantool EE"

inputs:
sdk-version:
required: true
type: string
sdk-build:
required: false
type: string
default: release
sdk-gc:
required: false
type: string
default: gc64
sdk-download-token:
required: true
type: string

runs:
using: "composite"
steps:
- name: Install build requirements
run: |
sudo apt -y update
sudo apt -y install git gcc make cmake unzip zip
shell: bash

- name: Cache Tarantool SDK
id: cache-sdk
uses: actions/cache@v3
with:
path: tarantool-enterprise
key: ${{ matrix.sdk-version }}

- name: Download Tarantool SDK
run: |
ARCHIVE_NAME=tarantool-enterprise-sdk-${{ inputs.sdk-gc }}-${{ inputs.sdk-version }}.tar.gz
ARCHIVE_PATH=$(echo ${{ inputs.sdk-version }} | sed -rn \
's/^([0-9]+)\.([0-9]+)\.([0-9]+-){2}([a-z0-9]+-)?r[0-9]+\.([a-z]+)\.([a-z0-9_]+)$/${{ inputs.sdk-build }}\/\5\/\6\/\1\.\2/p')
curl -O -L \
https://tarantool:${{ inputs.sdk-download-token }}@download.tarantool.io/enterprise/${ARCHIVE_PATH}/${ARCHIVE_NAME}
tar -xzf ${ARCHIVE_NAME}
rm -f ${ARCHIVE_NAME}
source tarantool-enterprise/env.sh
shell: bash

- name: Install tarantool headers
run: |
INCLUDE_DIR=$(./tarantool-enterprise/tarantool --version | gawk \
'/DCMAKE_INSTALL_PREFIX/ {dir=gensub(/.*-DCMAKE_INSTALL_PREFIX=(\/.*) .*/, "\\1", "g", $0); print dir}')
sudo mkdir -p ${INCLUDE_DIR}/include
sudo cp -r tarantool-enterprise/include/tarantool ${INCLUDE_DIR}/include
shell: bash

- name: Add SDK to PATH and set TARANTOOL_SDK_PATH variable
run: |
SDK_PATH="$(realpath tarantool-enterprise)"
echo "${SDK_PATH}" >> ${GITHUB_PATH}
echo "TARANTOOL_SDK_PATH=${SDK_PATH}" >> ${GITHUB_ENV}
shell: bash
61 changes: 56 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:

jobs:
test:
tests-ce:
strategy:
fail-fast: false
matrix:
Expand All @@ -26,12 +26,16 @@ jobs:
run: curl -L https://tarantool.io/release/2/installer.sh | bash
env:
DEBIAN_FRONTEND: noninteractive
shell: bash

- name: Install tt cli
run: sudo apt install -y tt=2.4.0
env:
DEBIAN_FRONTEND: noninteractive

- name: Install Tarantool
run: tt install tarantool ${{ matrix.tarantool }}

- name: Cache rocks
uses: actions/cache@v2
id: cache-rocks
Expand All @@ -52,8 +56,55 @@ jobs:

- name: Run tests without code coverage analysis
run: make -C build luatest
if: matrix.coveralls != true

- name: Send code coverage to coveralls.io
run: make -C build coveralls
if: ${{ matrix.coveralls }}
# tests-ee:
# strategy:
# fail-fast: false
# matrix:
# coveralls: [false]
# sdk-version:
# - "2.11.2-0-r609.linux.x86_64"
# - "3.2.0-0-r40.linux.x86_64"
# include:
# - tarantool: "3.2.0-0-r40.linux.x86_64"
# coveralls: true
# runs-on: [ubuntu-20.04]
# steps:
# - uses: actions/checkout@master
#
# - name: Prepare EE env
# uses: ./.github/actions/prepare-ee-test-env
# with:
# sdk-version: '${{ matrix.sdk-version }}'
# sdk-download-token: '${{ secrets.SDK_DOWNLOAD_TOKEN }}'
#
# - name: Install tt cli
# run: sudo apt install -y tt=2.4.0
# env:
# DEBIAN_FRONTEND: noninteractive
#
# - name: Cache rocks
# uses: actions/cache@v2
# id: cache-rocks
# with:
# path: .rocks/
# key: cache-rocks-${{ matrix.tarantool }}-05
#
# - run: echo $PWD/.rocks/bin >> $GITHUB_PATH
#
# - run: ./deps.sh
#
# - name: Build module
# run: |
# cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -S . -B build
# make -C build
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#
# - name: Run tests without code coverage analysis
# run: make -C build luatest
# if: matrix.coveralls != true
#
# - name: Send code coverage to coveralls.io
# run: make -C build coveralls
# if: ${{ matrix.coveralls }}

0 comments on commit c7f494c

Please sign in to comment.