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 126c428 commit bc0fd55
Show file tree
Hide file tree
Showing 2 changed files with 127 additions and 10 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
76 changes: 66 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,33 @@ on:
pull_request:

jobs:
test:
tests-ce:
strategy:
fail-fast: false
matrix:
tarantool: ['1.10', '2.10', '2.11', '3.1', '3.2']
coveralls: [false]
include:
- tarantool: '2.11'
coveralls: true
runs-on: [ubuntu-20.04]
steps:
- uses: actions/checkout@master
- uses: tarantool/setup-tarantool@v3
with:
tarantool-version: ${{ matrix.tarantool }}

- name: Prepare the repo
- name: Prepare the repo for v1
run: curl -L https://tarantool.io/release/1.10/installer.sh | bash
if: startsWith(${{ matrix.tarantool }}, '1')
env:
DEBIAN_FRONTEND: noninteractive

- name: Prepare the repo for v2
run: curl -L https://tarantool.io/release/2/installer.sh | bash
if: startsWith(${{ matrix.tarantool }}, '2')
env:
DEBIAN_FRONTEND: noninteractive

- name: Prepare the repo for v3
run: curl -L https://tarantool.io/release/3/installer.sh | bash
if: startsWith(${{ matrix.tarantool }}, '3')
env:
DEBIAN_FRONTEND: noninteractive

Expand Down Expand Up @@ -52,8 +61,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 bc0fd55

Please sign in to comment.