Skip to content

Commit f01f90d

Browse files
committed
github-ci: add reusable testing workflow
The idea of this workflow is to be a part of the 'integration.yml' workflow from the tarantool repo to verify the integration of the go-tarantool connector with an arbitrary tarantool version. This workflow is not triggered on a push to the repo and cannot be run manually since it has only the 'workflow_call' trigger. This workflow will be included in the tarantool development cycle and called by the 'integration.yml' workflow from the tarantool project on a push to the master and release branches for verifying integration of tarantool with go-tarantool.
1 parent 981fa6f commit f01f90d

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed
+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: reusable_testing
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
artifact_name:
7+
description: The name of the tarantool build artifact
8+
default: ubuntu-focal
9+
required: false
10+
type: string
11+
12+
jobs:
13+
run_tests:
14+
runs-on: ubuntu-20.04
15+
steps:
16+
- name: Clone the go-tarantool connector
17+
uses: actions/checkout@v2
18+
with:
19+
repository: ${{ github.repository_owner }}/go-tarantool
20+
21+
- name: Download the tarantool build artifact
22+
uses: actions/download-artifact@v2
23+
with:
24+
name: ${{ inputs.artifact_name }}
25+
26+
- name: Install tarantool
27+
# Now we're lucky: all dependencies are already installed. Check package
28+
# dependencies when migrating to other OS version.
29+
run: sudo dpkg -i tarantool*.deb
30+
31+
- name: Get the tarantool version
32+
run: |
33+
TNT_VERSION=$(tarantool --version | grep -e '^Tarantool')
34+
echo "TNT_VERSION=$TNT_VERSION" >> $GITHUB_ENV
35+
36+
- name: Setup golang for connector and tests
37+
uses: actions/setup-go@v2
38+
with:
39+
go-version: 1.13
40+
41+
- name: Run base tests
42+
run: |
43+
mkdir snap xlog
44+
TNT_PID=$(tarantool ./config.lua > tarantool.log 2>&1 & echo $!)
45+
go clean -testcache && go test -v
46+
kill $TNT_PID
47+
48+
# TODO(ylobankov): Uncomment this when tarantool/go-tarantool#115 is resolved.
49+
# - name: Run queue tests
50+
# working-directory: ./queue
51+
# run: |
52+
# mkdir snap xlog
53+
# tarantoolctl rocks install queue 1.1.0
54+
# TNT_PID=$(tarantool ./config.lua > tarantool.log 2>&1 & echo $!)
55+
# go clean -testcache && go test -v
56+
# kill $TNT_PID
57+
58+
- name: Run uuid tests
59+
working-directory: ./uuid
60+
run: |
61+
mkdir snap xlog
62+
TNT_PID=$(tarantool ./config.lua > tarantool.log 2>&1 & echo $!)
63+
go clean -testcache && go test -v
64+
kill $TNT_PID
65+
if: ${{ !startsWith(env.TNT_VERSION, 'Tarantool 1.10') }}
66+
67+
- name: Run multi tests
68+
working-directory: ./multi
69+
run: |
70+
mkdir -p m1/{snap,xlog} m2/{snap,xlog}
71+
TNT_PID_1=$(tarantool ./config_m1.lua > tarantool_m1.log 2>&1 & echo $!)
72+
TNT_PID_2=$(tarantool ./config_m2.lua > tarantool_m2.log 2>&1 & echo $!)
73+
go clean -testcache && go test -v
74+
kill $TNT_PID_1 $TNT_PID_2

0 commit comments

Comments
 (0)