Skip to content

Commit 21d59b6

Browse files
committed
ci: update GitHub Actions workflows
`check.yaml`: * All jobs now run on ubuntu-latest instead of ubuntu-22.04. * Updated actions/checkout to v5, tarantool/setup-tarantool to v4, and actions/setup-go to v5. * Upgraded luacheck's Tarantool version to 3.4. `reusable-run.yml`: * Created a new reusable workflow to centralize testing logic, accepting os, tarantool-version, go-version, coveralls, and fuzzing as inputs. * Uses actions/checkout@v5 and actions/setup-go@v5. `testing.yml`: * Split run-tests-ce into run-tests-tarantool-1-10 (for Tarantool 1.10) and run-tests (for Tarantool 2.11, 3.4, and master). * Both new jobs leverage the reusable-run.yml workflow. * Updated actions/checkout to v5, actions/cache to v4, and actions/setup-go to v5.
1 parent 44917a0 commit 21d59b6

File tree

4 files changed

+618
-112
lines changed

4 files changed

+618
-112
lines changed

.github/workflows/check.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ on:
66

77
jobs:
88
luacheck:
9-
runs-on: ubuntu-22.04
9+
runs-on: ubuntu-24.04
1010
if: |
1111
github.event_name == 'push' ||
1212
github.event_name == 'pull_request' &&
1313
github.event.pull_request.head.repo.full_name != github.repository
1414
steps:
15-
- uses: actions/checkout@master
15+
- uses: actions/checkout@v5
1616

1717
- name: Setup Tarantool
18-
uses: tarantool/setup-tarantool@v2
18+
uses: tarantool/setup-tarantool@v4
1919
with:
20-
tarantool-version: '2.8'
20+
tarantool-version: '3.4'
2121

2222
- name: Setup tt
2323
run: |
@@ -32,15 +32,15 @@ jobs:
3232
run: ./.rocks/bin/luacheck .
3333

3434
golangci-lint:
35-
runs-on: ubuntu-22.04
35+
runs-on: ubuntu-24.04
3636
if: |
3737
github.event_name == 'push' ||
3838
github.event_name == 'pull_request' &&
3939
github.event.pull_request.head.repo.full_name != github.repository
4040
steps:
41-
- uses: actions/setup-go@v2
41+
- uses: actions/setup-go@v5
4242

43-
- uses: actions/checkout@v2
43+
- uses: actions/checkout@v5
4444

4545
- name: golangci-lint
4646
uses: golangci/golangci-lint-action@v3
@@ -57,13 +57,13 @@ jobs:
5757
args: --out-${NO_FUTURE}format colored-line-number --config=.golangci.yaml
5858

5959
codespell:
60-
runs-on: ubuntu-22.04
60+
runs-on: ubuntu-24.04
6161
if: |
6262
github.event_name == 'push' ||
6363
github.event_name == 'pull_request' &&
6464
github.event.pull_request.head.repo.full_name != github.repository
6565
steps:
66-
- uses: actions/checkout@master
66+
- uses: actions/checkout@v5
6767

6868
- name: Install codespell
6969
run: pip3 install codespell

.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@v5
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@v5
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: 34 additions & 103 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-tarantool-1-10:
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.8'
37-
- '2.10'
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:
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@v2
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@v3
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-24.04
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
@@ -165,12 +96,12 @@ jobs:
16596
runs-on: ${{ matrix.runs-on }}
16697
steps:
16798
- name: Clone the connector
168-
uses: actions/checkout@v3
99+
uses: actions/checkout@v5
169100
with:
170101
path: ${{ env.SRCDIR }}
171102

172103
- name: Restore cache of tarantool ${{ env.T_VERSION }}
173-
uses: actions/cache@v3
104+
uses: actions/cache@v4
174105
id: cache
175106
with:
176107
path: ${{ env.T_TARDIR }}
@@ -186,7 +117,7 @@ jobs:
186117
if: matrix.tarantool != 'brew' && steps.cache.outputs.cache-hit != 'true'
187118

188119
- name: Clone tarantool ${{ env.T_VERSION }}
189-
uses: actions/checkout@v3
120+
uses: actions/checkout@v5
190121
with:
191122
repository: tarantool/tarantool
192123
ref: ${{ env.T_VERSION }}
@@ -257,7 +188,7 @@ jobs:
257188
if: matrix.tarantool != 'brew' && matrix.tarantool != 'master'
258189

259190
- name: Setup golang for the connector and tests
260-
uses: actions/setup-go@v3
191+
uses: actions/setup-go@v5
261192
with:
262193
go-version: ${{ matrix.golang }}
263194

0 commit comments

Comments
 (0)