Skip to content

Commit bb99816

Browse files
committed
ci: testing with a latest Tarantool's commit
Closes #246
1 parent d33e053 commit bb99816

File tree

2 files changed

+34
-4
lines changed

2 files changed

+34
-4
lines changed

.github/workflows/testing.yml

+29-3
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,43 @@ jobs:
5050
- name: Clone the connector
5151
uses: actions/checkout@v2
5252

53+
- name: Setup tt
54+
run: |
55+
curl -L https://tarantool.io/release/2/installer.sh | sudo bash
56+
sudo apt install -y tt
57+
5358
- name: Setup Tarantool ${{ matrix.tarantool }}
5459
if: matrix.tarantool != '2.x-latest'
5560
uses: tarantool/setup-tarantool@v2
5661
with:
5762
tarantool-version: ${{ matrix.tarantool }}
5863

59-
- name: Setup Tarantool 2.x (latest)
64+
- name: Get Tarantool 2.x latest commit
6065
if: matrix.tarantool == '2.x-latest'
6166
run: |
62-
curl -L https://tarantool.io/pre-release/2/installer.sh | sudo bash
63-
sudo apt install -y tarantool tarantool-dev
67+
commit_hash=$(git ls-remote https://github.com/tarantool/tarantool.git --branch master | head -c 8)
68+
echo "LATEST_COMMIT=${commit_hash}" >> $GITHUB_ENV
69+
shell: bash
70+
71+
- name: Cache Tarantool 2.x latest
72+
if: matrix.tarantool == '2.x-latest'
73+
id: cache-latest
74+
uses: actions/cache@v3
75+
with:
76+
path: "/opt/tarantool"
77+
key: cache-latest-${{ env.LATEST_COMMIT }}
78+
79+
- name: Setup Tarantool 2.x latest
80+
if: matrix.tarantool == '2.x-latest' && steps.cache-latest.outputs.cache-hit != 'true'
81+
run: |
82+
# mkdir could be removed after:
83+
# https://github.com/tarantool/tt/issues/282
84+
sudo mkdir -p /opt/tarantool
85+
sudo tt install tarantool=master
86+
87+
- name: Add Tarantool 2.x latest to PATH
88+
if: matrix.tarantool == '2.x-latest'
89+
run: echo "/opt/tarantool/bin" >> $GITHUB_PATH
6490

6591
- name: Setup golang for the connector and tests
6692
uses: actions/setup-go@v2

Makefile

+5-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ BENCH_OPTIONS := -bench=. -run=^Benchmark -benchmem -benchtime=${DURATION} -coun
1414
GO_TARANTOOL_URL := https://github.com/tarantool/go-tarantool
1515
GO_TARANTOOL_DIR := ${PROJECT_DIR}/${BENCH_PATH}/go-tarantool
1616
TAGS :=
17+
TTCTL := tt
18+
ifeq (,$(shell which tt 2>/dev/null))
19+
TTCTL := tarantoolctl
20+
endif
1721

1822
.PHONY: clean
1923
clean:
@@ -22,7 +26,7 @@ clean:
2226

2327
.PHONY: deps
2428
deps: clean
25-
( cd ./queue/testdata; tarantoolctl rocks install queue 1.2.1 )
29+
( cd ./queue/testdata; $(TTCTL) rocks install queue 1.2.1 )
2630

2731
.PHONY: datetime-timezones
2832
datetime-timezones:

0 commit comments

Comments
 (0)