Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/actions/setup-tarantool/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Setup Tarantool
description: Install or build Tarantool

inputs:
tarantool_version:
description: Tarantool version or release-<branch>
required: true

runs:
using: composite
steps:
- name: Install tarantool ${{ inputs.tarantool_version }}
if: startsWith(inputs.tarantool_version, 'release') != true
uses: tarantool/setup-tarantool@v3
with:
tarantool-version: ${{ inputs.tarantool_version }}

- name: Create variables for Tarantool ${{ inputs.tarantool_version }}
if: startsWith(inputs.tarantool_version, 'release')
run: |
branch=$(echo ${{ inputs.tarantool_version }} | cut -d- -f2)
commit_hash=$(git ls-remote \
https://github.com/tarantool/tarantool.git \
--branch ${branch} | head -c 8)
echo "TNT_BRANCH=${branch}" >> $GITHUB_ENV
echo "VERSION_POSTFIX=-${commit_hash}" >> $GITHUB_ENV
shell: bash

- name: Cache tarantool build
if: startsWith(inputs.tarantool_version, 'release')
id: cache-tnt-release
uses: actions/cache@v3
with:
path: /home/runner/tnt-release
key: cache-tnt-${{ inputs.tarantool_version }}${{ env.VERSION_POSTFIX }}

- name: Clone tarantool ${{ inputs.tarantool_version }}
if: |
startsWith(inputs.tarantool_version, 'release') &&
steps.cache-tnt-release.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: tarantool/tarantool
ref: ${{ env.TNT_BRANCH }}
path: tarantool
fetch-depth: 0
submodules: true

- name: Build tarantool ${{ inputs.tarantool_version }}
if: |
startsWith(inputs.tarantool_version, 'release') &&
steps.cache-tnt-release.outputs.cache-hit != 'true'
run: |
sudo apt-get -y install \
build-essential cmake make zlib1g-dev libreadline-dev \
libncurses5-dev libssl-dev libunwind-dev libicu-dev python3 \
python3-yaml python3-six python3-gevent
cd ${GITHUB_WORKSPACE}/tarantool
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_DIST=ON
make && make DESTDIR=/home/runner/tnt-release install
shell: bash

- name: Install tarantool ${{ inputs.tarantool_version }}
if: startsWith(inputs.tarantool_version, 'release')
# Workaround as actions/cache cannot restore data to /usr/local
run: sudo cp -rvP /home/runner/tnt-release/usr/local/* /usr/local/
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/cartridge_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
workflow_call:
inputs:
artifact_name:
description: The name of the tarantool build artifact
description: The name of the vshard rock artifact
required: true
type: string
tarantool_version:
Expand Down
50 changes: 5 additions & 45 deletions .github/workflows/catch_flaky.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,54 +11,9 @@ jobs:
if: github.event_name == 'pull_request' &&
!contains(github.event.pull_request.labels.*.name, 'noflaky')

env:
TNT_RELEASE_PATH: /home/runner/tnt-release

runs-on: ubuntu-22.04
timeout-minutes: 180
steps:
- name: Create variables for Tarantool
run: |
branch=master
commit_hash=$(git ls-remote \
https://github.com/tarantool/tarantool.git \
--branch ${branch} | head -c 8)
echo "TNT_BRANCH=${branch}" >> $GITHUB_ENV
echo "VERSION_POSTFIX=-${commit_hash}" >> $GITHUB_ENV
shell: bash

- name: Cache tarantool build
id: cache-tnt-release
uses: actions/cache@v3
with:
path: ${{ env.TNT_RELEASE_PATH }}
key: cache-tnt-release-master${{ env.VERSION_POSTFIX }}

- name: Clone tarantool
if: steps.cache-tnt-release.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: tarantool/tarantool
ref: ${{ env.TNT_BRANCH }}
path: tarantool
fetch-depth: 0
submodules: true

- name: Build tarantool
if: steps.cache-tnt-release.outputs.cache-hit != 'true'
run: |
sudo apt-get -y install build-essential cmake make zlib1g-dev \
libreadline-dev libncurses5-dev libssl-dev libunwind-dev \
libicu-dev python3 python3-yaml python3-six python3-gevent
cd ${GITHUB_WORKSPACE}/tarantool
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_DIST=ON
make && make DESTDIR=${TNT_RELEASE_PATH} install

- name: Install tarantool
# Workaround as actions/cache cannot restore data to /usr/local
run: sudo cp -rvP ${TNT_RELEASE_PATH}/usr/local/* /usr/local/

- name: Clone the module
uses: actions/checkout@v3
with:
Expand All @@ -70,6 +25,11 @@ jobs:
submodules: recursive
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup Tarantool
uses: ./.github/actions/setup-tarantool
with:
tarantool_version: release-master

- name: Install test requirements
run: pip3 install --user -r test-run/requirements.txt

Expand Down
56 changes: 5 additions & 51 deletions .github/workflows/fast_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,59 +34,8 @@ jobs:
- '3.3'
- 'release-master'

env:
TNT_RELEASE_PATH: /home/runner/tnt-release

runs-on: ubuntu-22.04
steps:
- name: Install tarantool ${{ matrix.tarantool }}
if: startsWith(matrix.tarantool, 'release') != true
uses: tarantool/setup-tarantool@v3
with:
tarantool-version: ${{ matrix.tarantool }}

- name: Create variables for Tarantool ${{ matrix.tarantool }}
if: startsWith(matrix.tarantool, 'release')
run: |
branch=$(echo ${{ matrix.tarantool }} | cut -d- -f2)
commit_hash=$(git ls-remote https://github.com/tarantool/tarantool.git --branch ${branch} | head -c 8)
echo "TNT_BRANCH=${branch}" >> $GITHUB_ENV
echo "VERSION_POSTFIX=-${commit_hash}" >> $GITHUB_ENV
shell: bash

- name: Cache tarantool build
if: startsWith(matrix.tarantool, 'release')
id: cache-tnt-release
uses: actions/cache@v3
with:
path: ${{ env.TNT_RELEASE_PATH}}
key: cache-tnt-${{ matrix.tarantool }}${{ env.VERSION_POSTFIX }}

- name: Clone tarantool ${{ matrix.tarantool }}
if: startsWith(matrix.tarantool, 'release') && steps.cache-tnt-release.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: tarantool/tarantool
ref: ${{ env.TNT_BRANCH }}
path: tarantool
fetch-depth: 0
submodules: true

- name: Build tarantool ${{ matrix.tarantool }}
if: startsWith(matrix.tarantool, 'release') && steps.cache-tnt-release.outputs.cache-hit != 'true'
run: |
sudo apt-get -y install build-essential cmake make zlib1g-dev libreadline-dev libncurses5-dev \
libssl-dev libunwind-dev libicu-dev python3 python3-yaml python3-six python3-gevent
cd ${GITHUB_WORKSPACE}/tarantool
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_DIST=ON
make && make DESTDIR=${TNT_RELEASE_PATH} install

- name: Install tarantool ${{ matrix.tarantool }}
if: startsWith(matrix.tarantool, 'release')
# Workaround as actions/cache cannot restore data to /usr/local
run: sudo cp -rvP ${TNT_RELEASE_PATH}/usr/local/* /usr/local/

- name: Clone the module
uses: actions/checkout@v3
with:
Expand All @@ -97,6 +46,11 @@ jobs:
# for running tests.
submodules: recursive

- name: Setup Tarantool ${{ matrix.tarantool }}
uses: ./.github/actions/setup-tarantool
with:
tarantool_version: ${{ matrix.tarantool }}

- name: Install test requirements
run: pip3 install --user -r test-run/requirements.txt

Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,10 @@ jobs:
with:
artifact_name: vshard-${{ needs.vshard.outputs.sha }}
tarantool_version: '2.11'

tarantool:
needs: vshard
uses: ./.github/workflows/tarantool_integration.yml
with:
artifact_name: vshard-${{ needs.vshard.outputs.sha }}
tarantool_version: 'release-master'
91 changes: 91 additions & 0 deletions .github/workflows/tarantool_integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: tarantool_integration

on:
workflow_call:
inputs:
artifact_name:
description: The name of the vshard rock artifact
required: true
type: string
tarantool_version:
description: Version for the Tarantool binary
required: false
default: 'release-master'
type: string

jobs:
run_tests:
runs-on: ubuntu-22.04
timeout-minutes: 60

env:
# Mirroring tarantool's own CI.
VARDIR: /tmp/t
TEST_RUN_RETRIES: 3
SERVER_START_TIMEOUT: 290
REPLICATION_SYNC_TIMEOUT: 300
TEST_TIMEOUT: 310
NO_OUTPUT_TIMEOUT: 320

steps:
- name: Check out vshard
uses: actions/checkout@v4

- name: Resolve Tarantool branch
id: tnt
run: echo "branch=${TNT_VERSION#release-}" >> "$GITHUB_OUTPUT"
env:
TNT_VERSION: ${{ inputs.tarantool_version }}

# test-run.py runs Tarantool's own config-luatest suite, so the sources
# must be present. setup-tarantool only clones them on a build-cache
# miss, so check them out here to have them available in every case.
- name: Check out Tarantool sources
uses: actions/checkout@v4
with:
repository: tarantool/tarantool
ref: ${{ steps.tnt.outputs.branch }}
path: tarantool
fetch-depth: 0
submodules: recursive

- name: Setup Tarantool ${{ inputs.tarantool_version }}
uses: ./.github/actions/setup-tarantool
with:
tarantool_version: ${{ inputs.tarantool_version }}

- name: Install test requirements
run: pip3 install --user -r tarantool/test-run/requirements.txt

- name: Download the vshard build artifact
uses: actions/download-artifact@v4
with:
name: ${{ inputs.artifact_name }}

- name: Setup tt
run: |
curl -L https://tarantool.io/release/2/installer.sh | sudo bash
sudo apt install -y tt
tt version

- name: Install vshard
working-directory: tarantool
run: sudo tt rocks --tree /usr/local install ../vshard*.all.rock

# Only config tests can depend on vshard.
- name: Run config-luatest tests
run: |
cd tarantool/test
./test-run.py \
--force \
--verbose \
--executable "$(command -v tarantool)" \
config-luatest/

- name: Upload Tarantool test artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: tarantool-vshard-integration-artifacts
if-no-files-found: warn
path: /tmp/t
Loading