Skip to content

Commit eef370e

Browse files
committed
ci: update GitHub Actions workflows (runners, fixes, stability)
1 parent 5f9d1b4 commit eef370e

14 files changed

+237
-85
lines changed

.github/pull_request_template.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
What has been done? Why? What problem is being solved?
2+
3+
I didn't forget about
4+
5+
- [ ] Tests
6+
- [ ] Changelog
7+
- [ ] Documentation
8+
9+
Closes #???

.github/workflows/fast_testing.yaml

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -17,41 +17,42 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
tarantool:
21-
- '1.10'
22-
- '2.4'
23-
- '2.5'
24-
- '2.6'
25-
- '2.7'
26-
- '2.8'
27-
- '2.10'
28-
cartridge-version:
29-
- ''
30-
- '2.7.4'
31-
metrics-version:
32-
- ''
33-
- '0.10.0'
34-
- '0.11.0'
35-
- '0.13.0'
36-
coveralls: [false]
20+
# tarantool:
21+
# - '1.10'
22+
# - '2.10'
23+
# - '2.11'
24+
# cartridge-version:
25+
# - ''
26+
# - '2.16.3'
27+
# metrics-version:
28+
# - ''
29+
# - '1.5.0'
30+
# coveralls: [false]
3731
include:
38-
- tarantool: '2.10'
39-
cartridge-version: '2.7.4'
40-
metrics-version: '0.13.0'
41-
coveralls: true
42-
- tarantool: 'debug-master'
32+
# - tarantool: '2.11'
33+
# cartridge-version: ''
34+
# coveralls: true
35+
- tarantool: '3.0'
4336
cartridge-version: ''
44-
metrics-version: '0.13.0'
4537
coveralls: false
38+
# - tarantool: '3.1'
39+
# cartridge-version: ''
40+
# coveralls: false
41+
# - tarantool: '3.2'
42+
# cartridge-version: ''
43+
# coveralls: false
44+
# - tarantool: '3.3'
45+
# cartridge-version: ''
46+
# coveralls: false
4647

4748
env:
4849
TNT_DEBUG_PATH: /home/runner/tnt-debug
4950

50-
runs-on: ubuntu-20.04
51+
runs-on: ubuntu-24.04
5152
steps:
5253
- name: Install tarantool ${{ matrix.tarantool }}
5354
if: startsWith(matrix.tarantool, 'debug') != true
54-
uses: tarantool/setup-tarantool@v1
55+
uses: tarantool/setup-tarantool@v4
5556
with:
5657
tarantool-version: ${{ matrix.tarantool }}
5758

@@ -74,7 +75,7 @@ jobs:
7475

7576
- name: Clone tarantool ${{ matrix.tarantool }}
7677
if: startsWith(matrix.tarantool, 'debug') && steps.cache-tnt-debug.outputs.cache-hit != 'true'
77-
uses: actions/checkout@v3
78+
uses: actions/checkout@v4
7879
with:
7980
repository: tarantool/tarantool
8081
ref: ${{ env.TNT_BRANCH }}
@@ -101,7 +102,7 @@ jobs:
101102
sudo cp -rvP ${TNT_DEBUG_PATH}/usr/local/* /usr/local/
102103
103104
- name: Clone the module
104-
uses: actions/checkout@v3
105+
uses: actions/checkout@v4
105106

106107
- name: Cache rocks
107108
uses: actions/cache@v3
@@ -120,7 +121,6 @@ jobs:
120121
121122
- name: Install requirements
122123
run: make deps
123-
if: steps.cache-rocks.outputs.cache-hit != 'true'
124124

125125
- name: Install metrics
126126
if: matrix.metrics-version != ''
@@ -136,7 +136,14 @@ jobs:
136136

137137
- run: make check
138138

139-
- run: make coverage
139+
- name: Run coverage
140+
uses: nick-fields/retry@v3
141+
with:
142+
max_attempts: 3
143+
retry_on: error
144+
retry_wait_seconds: 10
145+
timeout_minutes: 60
146+
command: make coverage
140147

141148
- name: Send code coverage to coveralls.io
142149
run: make coveralls

.github/workflows/packaging.yml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
jobs:
1313
# Run not only on tags, otherwise dependent job will skip.
1414
version-check:
15-
runs-on: ubuntu-20.04
15+
runs-on: ubuntu-22.04
1616
steps:
1717
- name: Check module version
1818
# We need this step to run only on push with tag.
@@ -22,25 +22,15 @@ jobs:
2222
module-name: 'expirationd'
2323

2424
package:
25-
runs-on: ubuntu-20.04
25+
runs-on: ubuntu-22.04
2626
needs: version-check
2727

2828
strategy:
2929
fail-fast: false
3030
matrix:
3131
platform:
3232
- { os: 'debian', dist: 'stretch' }
33-
- { os: 'debian', dist: 'buster' }
3433
- { os: 'debian', dist: 'bullseye' }
35-
- { os: 'el', dist: '7' }
36-
- { os: 'el', dist: '8' }
37-
- { os: 'fedora', dist: '30' }
38-
- { os: 'fedora', dist: '31' }
39-
- { os: 'fedora', dist: '32' }
40-
- { os: 'fedora', dist: '33' }
41-
- { os: 'fedora', dist: '34' }
42-
- { os: 'fedora', dist: '35' }
43-
- { os: 'fedora', dist: '36' }
4434
- { os: 'ubuntu', dist: 'xenial' }
4535
- { os: 'ubuntu', dist: 'bionic' }
4636
- { os: 'ubuntu', dist: 'focal' }
@@ -53,15 +43,15 @@ jobs:
5343

5444
steps:
5545
- name: Clone the module
56-
uses: actions/checkout@v3
46+
uses: actions/checkout@v4
5747
# `actions/checkout` performs shallow clone of repo. To provide
5848
# proper version of the package to `packpack` we need to have
5949
# complete repository, otherwise it will be `0.0.1`.
6050
with:
6151
fetch-depth: 0
6252

6353
- name: Clone the packpack tool
64-
uses: actions/checkout@v3
54+
uses: actions/checkout@v4
6555
with:
6656
repository: packpack/packpack
6757
path: packpack

.github/workflows/publish.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
version-check:
1010
# We need this job to run only on push with tag.
1111
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
12-
runs-on: ubuntu-20.04
12+
runs-on: ubuntu-22.04
1313
steps:
1414
- name: Check module version
1515
uses: tarantool/actions/check-module-version@master
@@ -18,9 +18,9 @@ jobs:
1818

1919
publish-rockspec-scm-1:
2020
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
21-
runs-on: ubuntu-20.04
21+
runs-on: ubuntu-22.04
2222
steps:
23-
- uses: actions/checkout@v3
23+
- uses: actions/checkout@v4
2424
- uses: tarantool/rocks.tarantool.org/github-action@master
2525
with:
2626
auth: ${{ secrets.ROCKS_AUTH }}
@@ -29,9 +29,9 @@ jobs:
2929
publish-rockspec-tag:
3030
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
3131
needs: version-check
32-
runs-on: ubuntu-20.04
32+
runs-on: ubuntu-22.04
3333
steps:
34-
- uses: actions/checkout@v3
34+
- uses: actions/checkout@v4
3535

3636
# Create a rockspec for the release.
3737
- run: printf '%s=%s\n' TAG "${GITHUB_REF##*/}" >> "${GITHUB_ENV}"
@@ -62,7 +62,7 @@ jobs:
6262
# .src.rock instead. See [1] for description of rock types.
6363
#
6464
# [1]: https://github.com/luarocks/luarocks/wiki/Types-of-rocks
65-
- uses: tarantool/setup-tarantool@v1
65+
- uses: tarantool/setup-tarantool@v4
6666
with:
6767
tarantool-version: '1.10'
6868
- run: tt rocks install expirationd-${{ env.TAG }}-1.rockspec
@@ -81,12 +81,12 @@ jobs:
8181
runs-on: ubuntu-latest
8282
steps:
8383
- name: Install Tarantool
84-
uses: tarantool/setup-tarantool@v1
84+
uses: tarantool/setup-tarantool@v4
8585
with:
86-
tarantool-version: 2.8
86+
tarantool-version: 2.11
8787

8888
- name: Clone the module
89-
uses: actions/checkout@v3
89+
uses: actions/checkout@v4
9090

9191
- name: Cache rocks
9292
uses: actions/cache@v3

.github/workflows/reusable_testing.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111

1212
jobs:
1313
run_tests:
14-
runs-on: ubuntu-20.04
14+
runs-on: ubuntu-22.04
1515
steps:
1616
- name: Clone the expirationd module
1717
uses: actions/checkout@v4
@@ -36,4 +36,12 @@ jobs:
3636
3737
- run: make deps
3838
- run: echo $PWD/.rocks/bin >> $GITHUB_PATH
39-
- run: make test
39+
40+
- name: Run tests
41+
uses: nick-fields/retry@v3
42+
with:
43+
max_attempts: 3
44+
retry_on: error
45+
retry_wait_seconds: 10
46+
timeout_minutes: 60
47+
command: make test

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ tags
1010
doc/apidoc/
1111
.idea
1212
*.swp
13+
.vscode
14+
sdk

.luacheckrc

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
globals = {
2-
"box",
3-
"_TARANTOOL",
4-
}
5-
61
ignore = {
72
-- Unused argument <self>.
83
"212/self",
@@ -16,12 +11,9 @@ ignore = {
1611
"432",
1712
}
1813

19-
include_files = {
20-
'.luacheckrc',
21-
'*.rockspec',
22-
'**/*.lua',
23-
}
24-
25-
exclude_files = {
26-
'.rocks',
27-
}
14+
redefined = false
15+
globals = {'box', 'utf8', 'checkers', '_TARANTOOL'}
16+
include_files = {'**/*.lua', '*.luacheckrc', '*.rockspec'}
17+
exclude_files = {'**/*.rocks/', 'tmp/', 'sdk'}
18+
max_line_length = 120
19+
max_comment_line_length = 150

.luacov

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
local ci_node_index = os.getenv("CI_NODE_INDEX") or ""
2+
3+
return {
4+
statsfile = "luacov.stats" .. ci_node_index .. ".out",
5+
exclude = {
6+
".rocks",
7+
"test",
8+
}
9+
}

Makefile

Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,32 @@ MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
55
PROJECT_DIR := $(patsubst %/,%,$(dir $(MAKEFILE_PATH)))
66
LUACOV_REPORT := $(PROJECT_DIR)/luacov.report.out
77
LUACOV_STATS := $(PROJECT_DIR)/luacov.stats.out
8+
METRICS ?= $(METRIC_VERSION)
9+
CARTRIDGE ?= $(CARTRIDGE_VERSION)
810

911
SHELL := $(shell which bash) # Required for brace expansion used in a clean target.
1012
SEED ?= $(shell /bin/bash -c "echo $$RANDOM")
1113

14+
SHELL := /bin/bash
15+
16+
ARCH := $(shell uname -m)
17+
PLATFORM ?= $(shell uname -s | tr [:upper:] [:lower:])
18+
ifeq ($(PLATFORM), darwin)
19+
PLATFORM := macos
20+
endif
21+
22+
PWD := $(shell pwd)
23+
24+
TARANTOOL_BUNDLE_PATH ?= enterprise/dev/$(PLATFORM)/$(ARCH)/2.11/tarantool-enterprise-sdk-gc64-2.11.5-0-g74b51db7f-r662.$(PLATFORM).$(ARCH).tar.gz
25+
S3_TARANTOOL_SDK_3_PATH := enterprise/release/linux/x86_64/3.3/tarantool-enterprise-sdk-gc64-3.3.2-0-r62.linux.x86_64.tar.gz
26+
27+
VERSION_BRANCH := $(shell git branch --show-current)
28+
VERSION := $(shell git describe --tags --long | cut -d'-' -f1-2)
29+
ROCK_FILENAME := expirationd-ee-${VERSION}.all.rock
30+
31+
32+
S3_ENDPOINT_URL ?= https://hb.bizmrg.com
33+
1234
all: test
1335

1436
# The template (ldoc.tpl) is written using tarantool specific
@@ -25,7 +47,7 @@ luacheck:
2547

2648
.PHONY: test
2749
test:
28-
luatest -v --coverage --shuffle all:${SEED}
50+
.rocks/bin/luatest -f -v --coverage test/integration/tarantool_role_test.lua
2951

3052
$(LUACOV_STATS): test
3153

@@ -39,13 +61,50 @@ coveralls: $(LUACOV_STATS)
3961
luacov-coveralls --include ^expirationd --verbose --repo-token ${GITHUB_TOKEN}
4062

4163
deps:
42-
tt rocks install luatest 1.0.1
64+
tt rocks install luatest 1.2.1
4365
tt rocks install luacheck 0.26.0
4466
tt rocks install luacov 0.13.0-1
4567
tt rocks install ldoc --server=https://tarantool.github.io/LDoc/
4668
tt rocks install luacov-coveralls 0.2.3-1 --server=http://luarocks.org
4769
tt rocks make
4870

4971
deps-full: deps
50-
tt rocks install cartridge 2.7.4
51-
tt rocks install metrics 0.13.0
72+
tt rocks install cartridge 2.16.3
73+
ifneq ($(strip $(METRICS)),)
74+
tt rocks install metrics $(METRICS)
75+
endif
76+
77+
upload-test-logs-for-fstec:
78+
aws --endpoint-url "$(S3_ENDPOINT_URL)" s3 cp expirationd-ee-tests.log "s3://packages/sdk-3-fstec/reports/fstec/expirationd-ee-$(VERSION)-tests.log"
79+
80+
.SILENT: sdk
81+
sdk: ## Download and Install Tarantool SDK
82+
echo Download and Install Tarantool SDK on $(ARCH)
83+
aws --endpoint-url "$(S3_ENDPOINT_URL)" s3 cp "s3://packages/$(S3_TARANTOOL_SDK_3_PATH)" ./sdk.tar.gz \
84+
&& mkdir -p sdk \
85+
&& tar -xzvf ./sdk.tar.gz -C sdk --strip 1 \
86+
&& rm -f ./sdk.tar.gz \
87+
&& chmod 644 sdk/rocks/*
88+
89+
.rocks: sdk ## Install Rocks
90+
source sdk/env.sh \
91+
&& tt rocks install vshard 0.1.36 \
92+
&& tt rocks install luatest 1.0.1 \
93+
&& tt rocks install luacov 0.13.0 \
94+
&& tt rocks install luacov-reporters 0.1.0 \
95+
&& tt rocks install luacheck 0.26.0
96+
ifneq ($(strip $(METRICS)),)
97+
source sdk/env.sh && tt rocks install metrics $(METRICS)
98+
endif
99+
ifneq ($(strip $(CARTRIDGE)),)
100+
source sdk/env.sh && tt rocks install cartridge $(CARTRIDGE)
101+
endif
102+
103+
install-debug-helper:
104+
source sdk/env.sh && tt rocks install https://raw.githubusercontent.com/a1div0/lua-debug-helper/main/lua-debug-helper-1.0.2-1.rockspec
105+
106+
.PHONY: bootstrap
107+
bootstrap: .rocks ## Installs all dependencies
108+
109+
lint:
110+
source sdk/env.sh && .rocks/bin/luacheck .

0 commit comments

Comments
 (0)