Skip to content

github-ci: add reusable testing workflow #112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 8, 2021
Merged
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
74 changes: 74 additions & 0 deletions .github/workflows/reusable_testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: reusable_testing

on:
workflow_call:
inputs:
artifact_name:
description: The name of the tarantool build artifact
default: ubuntu-focal
required: false
type: string

jobs:
run_tests:
runs-on: ubuntu-20.04
steps:
- name: Clone the go-tarantool connector
uses: actions/checkout@v2
with:
repository: ${{ github.repository_owner }}/go-tarantool

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

- name: Install tarantool
# Now we're lucky: all dependencies are already installed. Check package
# dependencies when migrating to other OS version.
run: sudo dpkg -i tarantool*.deb

- name: Get the tarantool version
run: |
TNT_VERSION=$(tarantool --version | grep -e '^Tarantool')
echo "TNT_VERSION=$TNT_VERSION" >> $GITHUB_ENV

- name: Setup golang for connector and tests
uses: actions/setup-go@v2
with:
go-version: 1.13

- name: Run base tests
run: |
mkdir snap xlog
TNT_PID=$(tarantool ./config.lua > tarantool.log 2>&1 & echo $!)
go clean -testcache && go test -v
kill $TNT_PID

# TODO(ylobankov): Uncomment this when tarantool/go-tarantool#115 is resolved.
# - name: Run queue tests
# working-directory: ./queue
# run: |
# mkdir snap xlog
# tarantoolctl rocks install queue 1.1.0
# TNT_PID=$(tarantool ./config.lua > tarantool.log 2>&1 & echo $!)
# go clean -testcache && go test -v
# kill $TNT_PID

- name: Run uuid tests
working-directory: ./uuid
run: |
mkdir snap xlog
TNT_PID=$(tarantool ./config.lua > tarantool.log 2>&1 & echo $!)
go clean -testcache && go test -v
kill $TNT_PID
if: ${{ !startsWith(env.TNT_VERSION, 'Tarantool 1.10') }}

- name: Run multi tests
working-directory: ./multi
run: |
mkdir -p m1/{snap,xlog} m2/{snap,xlog}
TNT_PID_1=$(tarantool ./config_m1.lua > tarantool_m1.log 2>&1 & echo $!)
TNT_PID_2=$(tarantool ./config_m2.lua > tarantool_m2.log 2>&1 & echo $!)
go clean -testcache && go test -v
kill $TNT_PID_1 $TNT_PID_2