Skip to content

Commit b1876ed

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 4c78e0a commit b1876ed

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed
+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
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: Setup node.js for tests
42+
uses: actions/setup-node@v2
43+
with:
44+
node-version: 10.19.0
45+
46+
- name: Run base tests
47+
run: |
48+
mkdir snap xlog
49+
TNT_PID=$(tarantool ./config.lua > tarantool.log 2>&1 & echo $!)
50+
go clean -testcache && go test -v
51+
kill $TNT_PID
52+
53+
# - name: Run queue tests
54+
# working-directory: ./queue
55+
# run: |
56+
# mkdir snap xlog
57+
# tarantoolctl rocks install queue 1.1.0
58+
# TNT_PID=$(tarantool ./config.lua > tarantool.log 2>&1 & echo $!)
59+
# go clean -testcache && go test -v
60+
# kill $TNT_PID
61+
62+
- name: Run uuid tests
63+
working-directory: ./uuid
64+
run: |
65+
mkdir snap xlog
66+
TNT_PID=$(tarantool ./config.lua > tarantool.log 2>&1 & echo $!)
67+
go clean -testcache && go test -v
68+
kill $TNT_PID
69+
if: ${{ !startsWith(env.TNT_VERSION, 'Tarantool 1.10') }}
70+
71+
- name: Run multi tests
72+
working-directory: ./multi
73+
run: |
74+
mkdir -p m1/{snap,xlog} m2/{snap,xlog}
75+
tarantool ./config_m1.lua > tarantool_m1.log 2>&1 &
76+
tarantool ./config_m2.lua > tarantool_m2.log 2>&1 &
77+
go clean -testcache && go test -v

0 commit comments

Comments
 (0)