Skip to content

Commit

Permalink
test: migrate to tt
Browse files Browse the repository at this point in the history
  • Loading branch information
DifferentialOrange committed Oct 23, 2023
1 parent dbae963 commit 4e53277
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 25 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,19 @@ jobs:
with:
tarantool-version: '2.11'

- name: Prepare apt repo
run: curl -L https://tarantool.io/release/2/installer.sh | bash

- name: Install tt cli
run: sudo apt install -y tt
env:
DEBIAN_FRONTEND: noninteractive

# Make a release
- run: echo TAG=${GITHUB_REF##*/} >> $GITHUB_ENV
- run: tarantoolctl rocks new_version --tag ${{ env.TAG }}
- run: tarantoolctl rocks install ddl-${{ env.TAG }}-1.rockspec
- run: tarantoolctl rocks pack ddl ${{ env.TAG }}
- run: tt rocks new_version --tag ${{ env.TAG }}
- run: tt rocks install ddl-${{ env.TAG }}-1.rockspec
- run: tt rocks pack ddl ${{ env.TAG }}

- uses: tarantool/rocks.tarantool.org/github-action@master
with:
Expand Down
47 changes: 28 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,34 +28,35 @@ jobs:
with:
tarantool-version: ${{ matrix.tarantool }}

- name: Prepare apt repo
run: curl -L https://tarantool.io/release/2/installer.sh | bash

- name: Install tt cli
run: sudo apt install -y tt
env:
DEBIAN_FRONTEND: noninteractive

# Setup luatest and luacheck
- name: Cache rocks
uses: actions/cache@v3
id: cache-rocks
with:
path: .rocks/
key: cache-rocks-${{ matrix.runs-on }}-06
-
run: tarantoolctl rocks install luacheck
if: steps.cache-rocks.outputs.cache-hit != 'true'
-
run: tarantoolctl rocks install luatest
if: steps.cache-rocks.outputs.cache-hit != 'true'
-
run: tarantoolctl rocks install luacov
if: steps.cache-rocks.outputs.cache-hit != 'true'
-
run: tarantoolctl rocks install luacov-coveralls 0.2.3-1 --server=https://luarocks.org
key: cache-rocks-${{ matrix.runs-on }}-07

- name: Install test dependencies
run: ./deps.sh
if: steps.cache-rocks.outputs.cache-hit != 'true'

- run: echo $PWD/.rocks/bin >> $GITHUB_PATH

- run: tarantoolctl rocks list
- run: tarantoolctl rocks install cartridge
- run: tt rocks list
- run: tt rocks install cartridge
env:
CMAKE_DUMMY_WEBUI: true
- run: tarantoolctl rocks remove ddl --force
- run: tt rocks remove ddl --force

- run: tarantoolctl rocks make
- run: tt rocks make
- run: cmake -S . -B build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -71,8 +72,8 @@ jobs:
if: ${{ matrix.coveralls }}

# Cleanup cached paths
- run: tarantoolctl rocks remove cartridge
- run: tarantoolctl rocks remove ddl
- run: tt rocks remove cartridge
- run: tt rocks remove ddl
benchmark:
strategy:
fail-fast: false
Expand All @@ -92,6 +93,14 @@ jobs:
with:
tarantool-version: ${{ matrix.tarantool }}

- name: Prepare apt repo
run: curl -L https://tarantool.io/release/2/installer.sh | bash

- name: Install tt cli
run: sudo apt install -y tt
env:
DEBIAN_FRONTEND: noninteractive

# Setup luatest
- name: Cache rocks
uses: actions/cache@v3
Expand All @@ -100,7 +109,7 @@ jobs:
path: .rocks/
key: cache-rocks-${{ matrix.runs-on }}-bench-01

- run: tarantoolctl rocks install luatest
- run: tt rocks install luatest
if: steps.cache-rocks.outputs.cache-hit != 'true'

- run: tarantool ./test/bench_cache.lua
24 changes: 21 additions & 3 deletions deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,25 @@

set -e

if ! [ -x "$(command -v tt)" ]; then
TTCTL=tarantoolctl
else
TTCTL=tt
fi

# Test dependencies:
tarantoolctl rocks install luatest
tarantoolctl rocks install luacov 0.13.0
tarantoolctl rocks install luacheck 0.26.0
${TTCTL} rocks install luatest
${TTCTL} rocks install luacov 0.13.0
${TTCTL} rocks install luacheck 0.26.0

# Most of this code is the workaround for
# https://github.com/moteus/luacov-coveralls/pull/30
# Remove it, when the pull request will be merged.
TMPDIR="$(mktemp -d)"
LUACOV_COVERALLS_ROCKSPEC_URL="https://raw.githubusercontent.com/moteus/luacov-coveralls/master/rockspecs/luacov-coveralls-scm-0.rockspec"
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}"
$TTCTL rocks install "${LUACOV_COVERALLS_ROCKSPEC_FILE}"
rm "${LUACOV_COVERALLS_ROCKSPEC_FILE}"
rmdir "${TMPDIR}"

0 comments on commit 4e53277

Please sign in to comment.