Skip to content

Commit 9f47ffd

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. `reusable_testing.yml`: * Deleted, replaced by reusable-run.yml. `testing.yml`: * Split run-tests-ce into run-tests-on-ubuntu-22-04 (for Tarantool 1.10) and run-tests-on-ubuntu-latest (for Tarantool 2.11, 3.4, and master). * Both new jobs leverage the reusable-run.yml workflow. * The testing_mac_os job remains. * Updated actions/checkout to v5, actions/cache to v4, and actions/setup-go to v5.
1 parent 44917a0 commit 9f47ffd

File tree

4 files changed

+148
-165
lines changed

4 files changed

+148
-165
lines changed

.github/workflows/check.yaml

Lines changed: 10 additions & 10 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-latest
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-latest
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,16 +57,16 @@ 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-latest
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
7070

7171
- name: Run codespell
72-
run: make codespell
72+
run: make 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/reusable_testing.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)