Skip to content

Commit 121eb87

Browse files
ylobankovTotktonada
authored andcommitted
github-ci: add reusable testing workflow
The idea of this workflow is to be a part of the 'integration.yml' workflow from the tarantool repo to verify the integration of the mysql module with an arbitrary tarantool version. This workflow is not triggered on a push to the repo and cannot be run manually since it has only the 'workflow_call' trigger. This workflow will be included in the tarantool development cycle and called by the 'integration.yml' workflow from the tarantool project on a push to the master and release branches for verifying integration of tarantool with mysql module. Part of tarantool/tarantool#6577 Part of tarantool/tarantool#5265 Part of tarantool/tarantool#6056
1 parent 7985963 commit 121eb87

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: reusable_testing
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
artifact_name:
7+
description: The name of the tarantool build artifact
8+
default: ubuntu-focal
9+
required: false
10+
type: string
11+
12+
jobs:
13+
run_tests:
14+
runs-on: ubuntu-20.04
15+
16+
env:
17+
MYSQL_HOST: 127.0.0.1
18+
MYSQL_PORT: 3306
19+
MYSQL_USER: tarantool
20+
MYSQL_DATABASE: tarantool_mysql_test
21+
22+
steps:
23+
- name: Clone the mysql module
24+
uses: actions/checkout@v2
25+
with:
26+
repository: ${{ github.repository_owner }}/mysql
27+
submodules: recursive
28+
29+
- name: Download the tarantool build artifact
30+
uses: actions/download-artifact@v2
31+
with:
32+
name: ${{ inputs.artifact_name }}
33+
34+
- name: Install tarantool
35+
# Now we're lucky: all dependencies are already installed. Check package
36+
# dependencies when migrating to other OS version.
37+
run: sudo dpkg -i tarantool*.deb
38+
39+
# Workaround to avoid issue https://github.com/tarantool/mysql/issues/47.
40+
- name: Update mysql server config
41+
run: |
42+
sudo sed -i 's/\[mysqld\]/\[mysqld\]\ncharacter-set-server = utf8/' \
43+
/etc/mysql/mysql.conf.d/mysqld.cnf
44+
sudo systemctl restart mysql
45+
46+
- name: Prepare test environment
47+
run: |
48+
sudo mysql -proot -e "CREATE USER ${MYSQL_USER}@${MYSQL_HOST};"
49+
sudo mysql -proot -e "GRANT ALL PRIVILEGES ON *.* \
50+
TO ${MYSQL_USER}@${MYSQL_HOST};"
51+
sudo mysql -proot -e "ALTER USER ${MYSQL_USER}@${MYSQL_HOST} \
52+
IDENTIFIED WITH mysql_native_password BY '';"
53+
sudo mysql -proot -e "CREATE DATABASE ${MYSQL_DATABASE};"
54+
55+
- run: cmake . && make
56+
- run: make check
57+
env:
58+
MYSQL: '${{ env.MYSQL_HOST }}:${{ env.MYSQL_PORT }}:${{
59+
env.MYSQL_USER }}::${{ env.MYSQL_DATABASE }}'

0 commit comments

Comments
 (0)