From c7f494c5f659f1bd7afb95662be40ed9d46a8bae 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 | 61 +++++++++++++++++-- 2 files changed, 117 insertions(+), 5 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..e45f548 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: @@ -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 @@ -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 }}