Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@ on:
tags: ['*']

jobs:
version-check:
# We need this job to run only on push with tag.
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-20.04
steps:
- name: Check module version for api
uses: tarantool/actions/check-module-version@master
with:
module-name: 'sharded_queue.api'
- name: Check module version for storage
uses: tarantool/actions/check-module-version@master
with:
module-name: 'sharded_queue.storage'

publish-rockspec-scm-1:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
runs-on: ubuntu-20.04
Expand Down
1 change: 1 addition & 0 deletions sharded-queue-scm-1.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ build = {
['sharded_queue.utils'] = 'sharded_queue/utils.lua',
['sharded_queue.state'] = 'sharded_queue/state.lua',
['sharded_queue.statistics'] = 'sharded_queue/statistics.lua',
['sharded_queue.version'] = 'sharded_queue/version.lua',
},
},
build_pass = false,
Expand Down
1 change: 1 addition & 0 deletions sharded_queue/api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ return {
peek = queue_action_wrapper('peek'),
drop = queue_action_wrapper('drop'),
statistics = sharded_queue.statistics,
_VERSION = require('sharded_queue.version'),

dependencies = {
'cartridge.roles.vshard-router',
Expand Down
2 changes: 2 additions & 0 deletions sharded_queue/storage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ return {
init = init,
apply_config = apply_config,
validate_config = validate_config,
_VERSION = require('sharded_queue.version'),

dependencies = {
'cartridge.roles.vshard-storage',
},
Expand Down
4 changes: 4 additions & 0 deletions sharded_queue/version.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- Сontains the module version.
-- Requires manual update in case of release commit.

return '0.0.0'
16 changes: 16 additions & 0 deletions test/api_test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,19 @@ g.test_role_statistics_read_only_router = function()
t.assert_type(result_ro, 'table')
t.assert_equals(result_m, result_ro)
end

g.test_api_version = function()
local api_conn = config.cluster:server('queue-router').net_box
local storage_conn = config.cluster:server('queue-storage-1-0').net_box

local api_version = api_conn:eval(
"return require('sharded_queue.api')._VERSION"
)
local storage_version = storage_conn:eval(
"return require('sharded_queue.storage')._VERSION"
)

t.assert_equals(api_version, storage_version)
t.assert_not_equals(string.find(api_version, "^%d+%.%d+%.%d+$"), nil)
t.assert_not_equals(string.find(storage_version, "^%d+%.%d+%.%d+$"), nil)
end