Skip to content

Commit f04be8a

Browse files
committed
sub
1 parent 7b067d2 commit f04be8a

File tree

2 files changed

+133
-99
lines changed

2 files changed

+133
-99
lines changed

.github/workflows/reusable-run.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Reusable Test Run
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
os:
7+
required: true
8+
type: string
9+
tarantool-version:
10+
required: true
11+
type: string
12+
go-version:
13+
required: true
14+
type: string
15+
coveralls:
16+
required: false
17+
type: boolean
18+
default: false
19+
fuzzing:
20+
required: false
21+
type: boolean
22+
default: false
23+
24+
jobs:
25+
run-tests:
26+
runs-on: ${{ inputs.os }}
27+
steps:
28+
- name: Clone the connector
29+
uses: actions/checkout@v3
30+
31+
- name: Setup tt
32+
run: |
33+
curl -L https://tarantool.io/release/2/installer.sh | sudo bash
34+
sudo apt install -y tt
35+
36+
- name: Setup tt environment
37+
run: tt init
38+
39+
# https://github.com/tarantool/checks/issues/64
40+
- name: Install specific CMake version
41+
run: pip3 install cmake==3.15.3
42+
43+
- name: Setup Tarantool ${{ inputs.tarantool-version }}
44+
if: inputs.tarantool-version != 'master'
45+
uses: tarantool/setup-tarantool@v4
46+
with:
47+
tarantool-version: ${{ inputs.tarantool-version }}
48+
49+
- name: Get Tarantool master commit
50+
if: inputs.tarantool-version == 'master'
51+
run: |
52+
commit_hash=$(git ls-remote https://github.com/tarantool/tarantool.git --branch master | head -c 8)
53+
echo "LATEST_COMMIT=${commit_hash}" >> $GITHUB_ENV
54+
shell: bash
55+
56+
- name: Cache Tarantool master
57+
if: inputs.tarantool-version == 'master'
58+
id: cache-latest
59+
uses: actions/cache@v4
60+
with:
61+
path: |
62+
${{ github.workspace }}/bin
63+
${{ github.workspace }}/include
64+
key: cache-latest-${{ env.LATEST_COMMIT }}
65+
66+
- name: Setup Tarantool master
67+
if: inputs.tarantool-version == 'master' && steps.cache-latest.outputs.cache-hit != 'true'
68+
run: |
69+
sudo pip3 install cmake==3.15.3
70+
sudo tt install tarantool master
71+
72+
- name: Add Tarantool master to PATH
73+
if: inputs.tarantool-version == 'master'
74+
run: echo "${GITHUB_WORKSPACE}/bin" >> $GITHUB_PATH
75+
76+
- name: Setup golang for the connector and tests
77+
uses: actions/setup-go@v3
78+
with:
79+
go-version: ${{ inputs.go-version }}
80+
81+
- name: Install test dependencies
82+
run: make deps
83+
84+
- name: Run regression tests
85+
run: make test
86+
87+
- name: Run race tests
88+
run: make testrace
89+
90+
- name: Run fuzzing tests
91+
if: ${{ inputs.fuzzing }}
92+
run: make fuzzing TAGS="go_tarantool_decimal_fuzzing"
93+
94+
- name: Run tests, collect code coverage data and send to Coveralls
95+
if: ${{ inputs.coveralls }}
96+
env:
97+
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
98+
run: |
99+
make coveralls
100+
101+
- name: Check workability of benchmark tests
102+
if: inputs.go-version == 'stable'
103+
run: make bench-deps bench DURATION=1x COUNT=1

.github/workflows/testing.yml

Lines changed: 30 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,36 @@ on:
88
workflow_dispatch:
99

1010
jobs:
11-
run-tests-ce:
12-
# We want to run on external PRs, but not on our own internal
13-
# PRs as they'll be run by the push to the branch.
14-
#
15-
# The main trick is described here:
16-
# https://github.com/Dart-Code/Dart-Code/pull/2375
17-
#
18-
# Also we want to run it always for manually triggered workflows.
11+
run-tests-on-ubuntu-22-04:
1912
if: (github.event_name == 'push') ||
2013
(github.event_name == 'pull_request' &&
2114
github.event.pull_request.head.repo.full_name != github.repository) ||
2215
(github.event_name == 'workflow_dispatch')
23-
24-
# We could replace it with ubuntu-latest after fixing the bug:
25-
# https://github.com/tarantool/setup-tarantool/issues/37
26-
runs-on: ubuntu-22.04
27-
2816
strategy:
2917
fail-fast: false
3018
matrix:
31-
golang:
32-
- '1.20'
33-
- 'stable'
34-
tarantool:
35-
- '1.10'
36-
- '2.11'
37-
- '3.4'
38-
- 'master'
19+
golang: ['1.20', 'stable']
20+
tarantool: ['1.10']
21+
coveralls: [false]
22+
fuzzing: [false]
23+
uses: ./.github/workflows/reusable-run.yml
24+
with:
25+
os: ubuntu-22.04
26+
go-version: ${{ matrix.golang }}
27+
tarantool-version: ${{ matrix.tarantool }}
28+
coveralls: ${{ matrix.coveralls }}
29+
fuzzing: ${{ matrix.fuzzing }}
30+
31+
run-tests-on-ubuntu-latest:
32+
if: (github.event_name == 'push') ||
33+
(github.event_name == 'pull_request' &&
34+
github.event.pull_request.head.repo.full_name != github.repository) ||
35+
(github.event_name == 'workflow_dispatch')
36+
strategy:
37+
fail-fast: false
38+
matrix:
39+
golang: ['1.20', 'stable']
40+
tarantool: ['2.11', '3.4', 'master']
3941
coveralls: [false]
4042
fuzzing: [false]
4143
include:
@@ -46,84 +48,13 @@ jobs:
4648
fuzzing: true
4749
golang: '1.20'
4850
coveralls: false
49-
50-
steps:
51-
- name: Clone the connector
52-
uses: actions/checkout@v3
53-
54-
- name: Setup tt
55-
run: |
56-
curl -L https://tarantool.io/release/2/installer.sh | sudo bash
57-
sudo apt install -y tt
58-
59-
- name: Setup tt environment
60-
run: tt init
61-
62-
# https://github.com/tarantool/checks/issues/64
63-
- name: Install specific CMake version
64-
run: pip3 install cmake==3.15.3
65-
66-
- name: Setup Tarantool ${{ matrix.tarantool }}
67-
if: matrix.tarantool != 'master'
68-
uses: tarantool/setup-tarantool@v4
69-
with:
70-
tarantool-version: ${{ matrix.tarantool }}
71-
72-
- name: Get Tarantool master commit
73-
if: matrix.tarantool == 'master'
74-
run: |
75-
commit_hash=$(git ls-remote https://github.com/tarantool/tarantool.git --branch master | head -c 8)
76-
echo "LATEST_COMMIT=${commit_hash}" >> $GITHUB_ENV
77-
shell: bash
78-
79-
- name: Cache Tarantool master
80-
if: matrix.tarantool == 'master'
81-
id: cache-latest
82-
uses: actions/cache@v4
83-
with:
84-
path: |
85-
${{ github.workspace }}/bin
86-
${{ github.workspace }}/include
87-
key: cache-latest-${{ env.LATEST_COMMIT }}
88-
89-
- name: Setup Tarantool master
90-
if: matrix.tarantool == 'master' && steps.cache-latest.outputs.cache-hit != 'true'
91-
run: |
92-
sudo pip3 install cmake==3.15.3
93-
sudo tt install tarantool master
94-
95-
- name: Add Tarantool master to PATH
96-
if: matrix.tarantool == 'master'
97-
run: echo "${GITHUB_WORKSPACE}/bin" >> $GITHUB_PATH
98-
99-
- name: Setup golang for the connector and tests
100-
uses: actions/setup-go@v3
101-
with:
102-
go-version: ${{ matrix.golang }}
103-
104-
- name: Install test dependencies
105-
run: make deps
106-
107-
- name: Run regression tests
108-
run: make test
109-
110-
- name: Run race tests
111-
run: make testrace
112-
113-
- name: Run fuzzing tests
114-
if: ${{ matrix.fuzzing }}
115-
run: make fuzzing TAGS="go_tarantool_decimal_fuzzing"
116-
117-
- name: Run tests, collect code coverage data and send to Coveralls
118-
if: ${{ matrix.coveralls }}
119-
env:
120-
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
121-
run: |
122-
make coveralls
123-
124-
- name: Check workability of benchmark tests
125-
if: matrix.golang == 'stable'
126-
run: make bench-deps bench DURATION=1x COUNT=1
51+
uses: ./.github/workflows/reusable-run.yml
52+
with:
53+
os: ubuntu-latest
54+
go-version: ${{ matrix.golang }}
55+
tarantool-version: ${{ matrix.tarantool }}
56+
coveralls: ${{ matrix.coveralls }}
57+
fuzzing: ${{ matrix.fuzzing }}
12758

12859
testing_mac_os:
12960
# We want to run on external PRs, but not on our own internal

0 commit comments

Comments
 (0)