Skip to content

Commit d536887

Browse files
ylobankovligurio
authored andcommitted
github-ci: add simple CI based on GitHub actions
In the provided workflow we install tarantool (1.10, 2.8, 2.9) and just run tests from the connector against it. Closes #114
1 parent fb84f99 commit d536887

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed

.github/workflows/testing.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: testing
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
jobs:
9+
linux:
10+
# We want to run on external PRs, but not on our own internal
11+
# PRs as they'll be run by the push to the branch.
12+
#
13+
# The main trick is described here:
14+
# https://github.com/Dart-Code/Dart-Code/pull/2375
15+
if: github.event_name == 'push' ||
16+
github.event.pull_request.head.repo.full_name != github.repository
17+
18+
runs-on: ubuntu-latest
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
tarantool:
24+
- '1.10'
25+
- '2.8'
26+
- '2.9'
27+
28+
steps:
29+
- name: Clone the connector
30+
uses: actions/checkout@v2
31+
32+
- name: Setup tarantool ${{ matrix.tarantool }}
33+
uses: tarantool/setup-tarantool@v1
34+
with:
35+
tarantool-version: ${{ matrix.tarantool }}
36+
37+
- name: Setup golang for the connector and tests
38+
uses: actions/setup-go@v2
39+
with:
40+
go-version: 1.13
41+
42+
- name: Run base tests
43+
run: |
44+
mkdir snap xlog
45+
TNT_PID=$(tarantool ./config.lua > tarantool.log 2>&1 & echo $!)
46+
go clean -testcache && go test -v
47+
kill $TNT_PID
48+
49+
# TODO(ylobankov): Uncomment this when tarantool/go-tarantool#115 is resolved.
50+
# - name: Run queue tests
51+
# working-directory: ./queue
52+
# run: |
53+
# mkdir snap xlog
54+
# tarantoolctl rocks install queue 1.1.0
55+
# TNT_PID=$(tarantool ./config.lua > tarantool.log 2>&1 & echo $!)
56+
# go clean -testcache && go test -v
57+
# kill $TNT_PID
58+
59+
- name: Run uuid tests
60+
working-directory: ./uuid
61+
run: |
62+
mkdir snap xlog
63+
TNT_PID=$(tarantool ./config.lua > tarantool.log 2>&1 & echo $!)
64+
go clean -testcache && go test -v
65+
kill $TNT_PID
66+
if: ${{ matrix.tarantool != 1.10 }}
67+
68+
- name: Run multi tests
69+
working-directory: ./multi
70+
run: |
71+
mkdir -p m1/{snap,xlog} m2/{snap,xlog}
72+
TNT_PID_1=$(tarantool ./config_m1.lua > tarantool_m1.log 2>&1 & echo $!)
73+
TNT_PID_2=$(tarantool ./config_m2.lua > tarantool_m2.log 2>&1 & echo $!)
74+
go clean -testcache && go test -v
75+
kill $TNT_PID_1 $TNT_PID_2

0 commit comments

Comments
 (0)