Skip to content

Commit

Permalink
ci: use tt to install rocks and EE
Browse files Browse the repository at this point in the history
tt is a modern cli to deal with various things, including rocks and
Tarantool EE install.
  • Loading branch information
DifferentialOrange committed Dec 8, 2022
1 parent 56214bf commit 16d16dc
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 29 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/check_on_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
42 changes: 30 additions & 12 deletions .github/workflows/test_on_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,21 @@ 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
./deps.sh
- 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 }}
Expand Down Expand Up @@ -91,13 +98,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
Expand All @@ -114,28 +128,32 @@ jobs:
matrix:
tarantool-version:
- "1.10.13-48-ga3a42eec7-r508"
- "2.10.2-0-gf4228cb7d-r508-linux-x86_64"
- "2.10.2-0-gf4228cb7d-r508"
metrics-version: ["", "0.12.0"]
fail-fast: false
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master

- name: Install requirements for enterprise
- name: Setup tt
run: |
curl -O -L https://tarantool:${{ secrets.DOWNLOAD_TOKEN }}@download.tarantool.io/enterprise/tarantool-enterprise-bundle-${{ matrix.tarantool-version }}.tar.gz
tar -xzf tarantool-enterprise-bundle-${{ matrix.tarantool-version }}.tar.gz
rm -f tarantool-enterprise-bundle-${{ matrix.tarantool-version }}.tar.gz
sudo cp tarantool-enterprise/tarantool /usr/bin/tarantool
source tarantool-enterprise/env.sh
curl -L https://tarantool.io/release/2/installer.sh | bash
sudo apt-get update
sudo apt-get install -y tt
tt version
- name: Install Tarantool EE
run: |
# Rework when https://github.com/tarantool/tt/issues/279 will be resolved
echo "tarantool:${{ secrets.DOWNLOAD_TOKEN }}" > /tmp/creds
sudo sed -i 's/ee: null/ee:/; s/# credential_path:.*/credential_path: \/tmp\/creds/' /etc/tarantool/tarantool.yaml
sudo tt install tarantool-ee=${{ matrix.tarantool-version }}
tarantool --version
./deps.sh
- 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
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,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" "tt rocks install tuple-keydef 0.0.2"
)

execute_process(
COMMAND bash "-c" "tarantoolctl rocks install tuple-merger 0.0.2"
COMMAND bash "-c" "tt rocks install tuple-merger 0.0.2"
)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ 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})
```
* 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.
Expand Down
24 changes: 12 additions & 12 deletions deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
set -e

# Test dependencies:
tarantoolctl rocks install luatest 0.5.7
tarantoolctl rocks install luacheck 0.25.0
tarantoolctl rocks install luacov 0.13.0
tt rocks install luatest 0.5.7
tt rocks install luacheck 0.25.0
tt 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
tt rocks install https://raw.githubusercontent.com/mpeterv/cluacov/master/cluacov-scm-1.rockspec
tt rocks install https://raw.githubusercontent.com/LuaDist/dkjson/master/dkjson-2.5-2.rockspec
tt rocks install https://raw.githubusercontent.com/keplerproject/luafilesystem/master/luafilesystem-scm-1.rockspec
tt 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
Expand All @@ -22,12 +22,12 @@ 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}"
tt rocks install "${LUACOV_COVERALLS_ROCKSPEC_FILE}"
rm "${LUACOV_COVERALLS_ROCKSPEC_FILE}"
rmdir "${TMPDIR}"

tarantoolctl rocks install cartridge 2.7.4
tarantoolctl rocks install ddl 1.6.2
tarantoolctl rocks install migrations 0.4.2
tt rocks install cartridge 2.7.4
tt rocks install ddl 1.6.2
tt rocks install migrations 0.4.2

tarantoolctl rocks make
tt rocks make

0 comments on commit 16d16dc

Please sign in to comment.