From 9cdaa9c7cb0f398d14136e3392d3fd561a4087e1 Mon Sep 17 00:00:00 2001 From: Georgy Moiseev Date: Mon, 27 Mar 2023 14:21:12 +0300 Subject: [PATCH 1/6] cd: clarify conditions Trigger only on "push to master" and "tag push" instead of "any action with master" branch and "any action with tag". For now, it doesn't change anything since the workflow is triggered only on push, but it is possible that it would be extended in the future. --- .github/workflows/push_rockspec.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push_rockspec.yaml b/.github/workflows/push_rockspec.yaml index 668ff0ca..91ece686 100644 --- a/.github/workflows/push_rockspec.yaml +++ b/.github/workflows/push_rockspec.yaml @@ -23,7 +23,7 @@ jobs: push-scm-rockspec: runs-on: ubuntu-20.04 - if: github.ref == 'refs/heads/master' + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} steps: - uses: actions/checkout@master @@ -34,7 +34,7 @@ jobs: push-tagged-rockspec: runs-on: ubuntu-20.04 - if: startsWith(github.ref, 'refs/tags') + if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }} needs: version-check steps: - uses: actions/checkout@master From 2ec334d9daaedf5ce34a56a3c4fc15c8170a5555 Mon Sep 17 00:00:00 2001 From: Georgy Moiseev Date: Mon, 27 Mar 2023 14:23:03 +0300 Subject: [PATCH 2/6] cd: reuse rock name --- .github/workflows/push_rockspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push_rockspec.yaml b/.github/workflows/push_rockspec.yaml index 91ece686..f859651d 100644 --- a/.github/workflows/push_rockspec.yaml +++ b/.github/workflows/push_rockspec.yaml @@ -19,7 +19,7 @@ jobs: - name: Check module version uses: tarantool/actions/check-module-version@master with: - module-name: 'crud' + module-name: ${{ env.ROCK_NAME }} push-scm-rockspec: runs-on: ubuntu-20.04 From d70393867916c35dd637bae294d40a64ad74d47c Mon Sep 17 00:00:00 2001 From: Georgy Moiseev Date: Mon, 27 Mar 2023 14:24:25 +0300 Subject: [PATCH 3/6] ci: bump metrics version --- .github/workflows/test_on_push.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_on_push.yaml b/.github/workflows/test_on_push.yaml index 2d66b699..3ed3078a 100644 --- a/.github/workflows/test_on_push.yaml +++ b/.github/workflows/test_on_push.yaml @@ -19,7 +19,7 @@ jobs: remove-merger: [false] include: - tarantool-version: "1.10" - metrics-version: "0.16.0" + metrics-version: "0.17.0" cartridge-version: "2.7.8" - tarantool-version: "2.7" remove-merger: true @@ -34,7 +34,7 @@ jobs: cartridge-version: "1.2.0" - tarantool-version: "2.10" coveralls: true - metrics-version: "0.16.0" + metrics-version: "0.17.0" cartridge-version: "2.7.8" fail-fast: false # Can't install older versions on 22.04, From e33147d18d49a5a38c867bb567782a56116150f2 Mon Sep 17 00:00:00 2001 From: Georgy Moiseev Date: Mon, 27 Mar 2023 14:45:53 +0300 Subject: [PATCH 4/6] cmake: use tt Tarantool CLI - new modern command line utility for managing Tarantool packages and Tarantool-based applications [1]. It will replace tarantoolctl some day. 1. https://github.com/tarantool/tt --- CMakeLists.txt | 6 ++++-- cmake/FindTTCtl.cmake | 11 +++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 cmake/FindTTCtl.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 3485b788..097faff1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,6 +77,8 @@ add_custom_target(coveralls ## Install #################################################################### ############################################################################### +find_package(TTCtl) + if(NOT DEFINED TARANTOOL_INSTALL_LUADIR) set(TARANTOOL_INSTALL_LUADIR "${PROJECT_SOURCE_DIR}/.rocks/share/tarantool") endif() @@ -99,9 +101,9 @@ install( # Don't include to rockspec as some Tarantool versions (e.g. 2.2 and 2.3) # don't have symbols required by "tuple-merger" and "tuple-keydef" modules. execute_process( - COMMAND bash "-c" "tarantoolctl rocks install tuple-keydef 0.0.2" + COMMAND bash "-c" "${TTCTL} rocks install tuple-keydef 0.0.2" ) execute_process( - COMMAND bash "-c" "tarantoolctl rocks install tuple-merger 0.0.2" + COMMAND bash "-c" "${TTCTL} rocks install tuple-merger 0.0.2" ) diff --git a/cmake/FindTTCtl.cmake b/cmake/FindTTCtl.cmake new file mode 100644 index 00000000..d162d9b9 --- /dev/null +++ b/cmake/FindTTCtl.cmake @@ -0,0 +1,11 @@ +find_program(TTCTL + NAMES tt tarantoolctl + DOC "Utility for managing Tarantool packages" +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(TTCtl + REQUIRED_VARS TTCTL +) + +mark_as_advanced(TTCTL) From 2b924ef35679a3336657eb175560eca973db0c21 Mon Sep 17 00:00:00 2001 From: Georgy Moiseev Date: Mon, 27 Mar 2023 14:46:16 +0300 Subject: [PATCH 5/6] ci: use tt to install rocks --- .github/workflows/check_on_push.yaml | 9 +++++++- .github/workflows/reusable_test.yml | 9 +++++++- .github/workflows/test_on_push.yaml | 29 ++++++++++++++++++++---- deps.sh | 34 ++++++++++++++++++---------- 4 files changed, 62 insertions(+), 19 deletions(-) diff --git a/.github/workflows/check_on_push.yaml b/.github/workflows/check_on_push.yaml index b4dc696f..5f2e6f26 100644 --- a/.github/workflows/check_on_push.yaml +++ b/.github/workflows/check_on_push.yaml @@ -18,8 +18,15 @@ jobs: with: tarantool-version: '2.10' + - name: Setup tt + run: | + curl -L https://tarantool.io/release/2/installer.sh | bash + sudo apt-get update + sudo apt-get install -y tt + tt version + - name: Setup luacheck - run: tarantoolctl rocks install luacheck 0.25.0 + run: tt rocks install luacheck 0.25.0 - run: cmake -S . -B build diff --git a/.github/workflows/reusable_test.yml b/.github/workflows/reusable_test.yml index 21b72f4b..6436a911 100644 --- a/.github/workflows/reusable_test.yml +++ b/.github/workflows/reusable_test.yml @@ -31,11 +31,18 @@ jobs: sudo dpkg -i tarantool_*.deb tarantool-common_*.deb tarantool-dev_*.deb tarantool --version + - name: Setup tt + run: | + curl -L https://tarantool.io/release/2/installer.sh | bash + sudo apt-get update + sudo apt-get install -y tt + tt version + - name: Install requirements run: ./deps.sh - name: Install metrics - run: tarantoolctl rocks install metrics 0.12.0 + run: tt rocks install metrics 0.12.0 # This server starts and listen on 8084 port that is used for tests - name: Stop Mono server diff --git a/.github/workflows/test_on_push.yaml b/.github/workflows/test_on_push.yaml index 3ed3078a..7a4d2fc7 100644 --- a/.github/workflows/test_on_push.yaml +++ b/.github/workflows/test_on_push.yaml @@ -53,6 +53,13 @@ jobs: run: | sudo patch -p1 /usr/share/tarantool/luarocks/manif.lua luarocks.patch + - name: Setup tt + run: | + curl -L https://tarantool.io/release/2/installer.sh | bash + sudo apt-get update + sudo apt-get install -y tt + tt version + - name: Install requirements for community run: | tarantool --version @@ -62,7 +69,7 @@ jobs: - name: Install metrics if: matrix.metrics-version != '' - run: tarantoolctl rocks install metrics ${{ matrix.metrics-version }} + run: tt rocks install metrics ${{ matrix.metrics-version }} - name: Remove external merger if needed if: ${{ matrix.remove-merger }} @@ -101,13 +108,20 @@ jobs: with: tarantool-version: ${{ matrix.tarantool-version }} + - name: Setup tt + run: | + curl -L https://tarantool.io/release/2/installer.sh | bash + sudo apt-get update + sudo apt-get install -y tt + tt version + - name: Install requirements for community run: | tarantool --version ./deps.sh - name: Install metrics - run: tarantoolctl rocks install metrics ${{ matrix.metrics-version }} + run: tt rocks install metrics ${{ matrix.metrics-version }} # This server starts and listen on 8084 port that is used for tests - name: Stop Mono server @@ -133,6 +147,13 @@ jobs: steps: - uses: actions/checkout@master + - name: Setup tt + run: | + curl -L https://tarantool.io/release/2/installer.sh | bash + sudo apt-get update + sudo apt-get install -y tt + tt version + - name: Install requirements for enterprise run: | curl -O -L https://tarantool:${{ secrets.DOWNLOAD_TOKEN }}@download.tarantool.io/enterprise/release/linux/x86_64/${{ matrix.tarantool-version.folder }}/${{ matrix.tarantool-version.bundle }}.tar.gz @@ -145,9 +166,7 @@ jobs: - name: Install metrics if: matrix.metrics-version != '' - run: | - source tarantool-enterprise/env.sh - tarantoolctl rocks install metrics ${{ matrix.metrics-version }} + run: tt rocks install metrics ${{ matrix.metrics-version }} # This server starts and listen on 8084 port that is used for tests - name: Stop Mono server diff --git a/deps.sh b/deps.sh index d9f45e2b..00dc81ac 100755 --- a/deps.sh +++ b/deps.sh @@ -3,16 +3,26 @@ set -e +TTCTL="" +if command -v tt; then + TTCTL=tt +elif command -v tarantoolctl; then + TTCTL=tarantoolctl +else + printf "tt or tarantoolctl is required" 1>&2 + exit 1 +fi + # Test dependencies: -tarantoolctl rocks install luatest 0.5.7 -tarantoolctl rocks install luacheck 0.25.0 -tarantoolctl rocks install luacov 0.13.0 +"$TTCTL" rocks install luatest 0.5.7 +"$TTCTL" rocks install luacheck 0.25.0 +"$TTCTL" rocks install luacov 0.13.0 # cluacov, luacov-coveralls and dependencies -tarantoolctl rocks install https://raw.githubusercontent.com/mpeterv/cluacov/master/cluacov-scm-1.rockspec -tarantoolctl rocks install https://raw.githubusercontent.com/LuaDist/dkjson/master/dkjson-2.5-2.rockspec -tarantoolctl rocks install https://raw.githubusercontent.com/keplerproject/luafilesystem/master/luafilesystem-scm-1.rockspec -tarantoolctl rocks install https://raw.githubusercontent.com/moteus/lua-path/master/rockspecs/lua-path-scm-0.rockspec +"$TTCTL" rocks install https://raw.githubusercontent.com/mpeterv/cluacov/master/cluacov-scm-1.rockspec +"$TTCTL" rocks install https://raw.githubusercontent.com/LuaDist/dkjson/master/dkjson-2.5-2.rockspec +"$TTCTL" rocks install https://raw.githubusercontent.com/keplerproject/luafilesystem/master/luafilesystem-scm-1.rockspec +"$TTCTL" rocks install https://raw.githubusercontent.com/moteus/lua-path/master/rockspecs/lua-path-scm-0.rockspec # Most of this code is the workaround for # https://github.com/moteus/luacov-coveralls/pull/30 @@ -22,14 +32,14 @@ LUACOV_COVERALLS_ROCKSPEC_URL="https://raw.githubusercontent.com/moteus/luacov-c LUACOV_COVERALLS_ROCKSPEC_FILE="${TMPDIR}/luacov-coveralls-scm-0.rockspec" curl -fsSL "${LUACOV_COVERALLS_ROCKSPEC_URL}" > "${LUACOV_COVERALLS_ROCKSPEC_FILE}" sed -i -e 's@git://@git+https://@' "${LUACOV_COVERALLS_ROCKSPEC_FILE}" -tarantoolctl rocks install "${LUACOV_COVERALLS_ROCKSPEC_FILE}" +"$TTCTL" rocks install "${LUACOV_COVERALLS_ROCKSPEC_FILE}" rm "${LUACOV_COVERALLS_ROCKSPEC_FILE}" rmdir "${TMPDIR}" CARTRIDGE_VERSION="${CARTRIDGE_VERSION:-2.7.8}" -tarantoolctl rocks install cartridge "$CARTRIDGE_VERSION" -tarantoolctl rocks install ddl 1.6.2 -tarantoolctl rocks install migrations 0.4.2 +"$TTCTL" rocks install cartridge "$CARTRIDGE_VERSION" +"$TTCTL" rocks install ddl 1.6.2 +"$TTCTL" rocks install migrations 0.4.2 -tarantoolctl rocks make +"$TTCTL" rocks make From 9e3b6e521d60bc6117dfe6fedda02b5ffc9f949f Mon Sep 17 00:00:00 2001 From: Georgy Moiseev Date: Mon, 27 Mar 2023 14:46:27 +0300 Subject: [PATCH 6/6] doc: use tt in examples --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 51e65e03..2b4bdf91 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ project: ```shell $ git clone https://github.com/tarantool/crud.git $ cd crud - $ tarantoolctl rocks make + $ tt rocks make $ ./doc/playground.lua tarantool> crud.select('customers', {{'<=', 'age', 35}}, {first = 10}) tarantool> crud.select('developers', nil, {first = 6}) @@ -63,7 +63,7 @@ project: * Install crud into a current directory: ```shell - $ tarantoolctl rocks install crud + $ tt rocks install crud ``` And add the [initialization code](#API) to storage and router instance files.