From 88ab815aa1483b76534245ec3840c76642a934c9 Mon Sep 17 00:00:00 2001 From: themilchenko Date: Fri, 8 Nov 2024 12:11:33 +0300 Subject: [PATCH] ci: add tests running on ee 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. --- .../actions/prepare-ee-test-env/action.yml | 61 ++++++++++++++++ .github/workflows/test.yml | 72 +++++++++++++++++-- 2 files changed, 127 insertions(+), 6 deletions(-) create mode 100644 .github/actions/prepare-ee-test-env/action.yml diff --git a/.github/actions/prepare-ee-test-env/action.yml b/.github/actions/prepare-ee-test-env/action.yml new file mode 100644 index 0000000..2eafc30 --- /dev/null +++ b/.github/actions/prepare-ee-test-env/action.yml @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6e60f8c..2f1ceb3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,7 +6,7 @@ on: pull_request: jobs: - test: + tests-ce: strategy: fail-fast: false matrix: @@ -22,8 +22,21 @@ jobs: 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 @@ -52,8 +65,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 }}