Skip to content
This repository was archived by the owner on Jan 1, 2024. It is now read-only.

Commit dc70dae

Browse files
authored
CI: Move to GH Actions (#123)
1 parent a7f3daa commit dc70dae

File tree

8 files changed

+181
-174
lines changed

8 files changed

+181
-174
lines changed
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
---
2+
name: Molecule tests
3+
4+
on:
5+
push:
6+
pull_request:
7+
8+
env:
9+
CARTRIDGE_CLI_VERSION: '2.4.0'
10+
11+
jobs:
12+
molecule-tests-ce:
13+
if: |
14+
github.event_name == 'push' ||
15+
github.event_name == 'pull_request' && github.event.pull_request.head.repo.owner.login != 'tarantool'
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
tarantool-version: ["1.10", "2.5"]
20+
fail-fast: false
21+
steps:
22+
- uses: actions/checkout@v2
23+
with:
24+
path: '${{ github.repository }}'
25+
26+
- name: Setup python
27+
uses: actions/setup-python@v2
28+
with:
29+
python-version: '3.x'
30+
31+
- name: Install molecule requirements
32+
run: |
33+
pip3 install --upgrade \
34+
ansible==2.8 \
35+
molecule==3.0.2 \
36+
docker \
37+
flake8==3.8.1 \
38+
testinfra
39+
40+
- name: Cache test packages
41+
id: cache-packages
42+
uses: actions/cache@v2
43+
with:
44+
path: '${{ github.repository }}/packages'
45+
key: ce-${{ matrix.tarantool-version }}-${{ env.CARTRIDGE_CLI_VERSION }}
46+
47+
- name: Create test packages
48+
if: steps.cache-packages.outputs.cache-hit != 'true'
49+
working-directory: '${{ github.repository }}'
50+
run: |
51+
sudo apt -y update
52+
sudo apt -y install git gcc make cmake unzip
53+
git config --global user.email "[email protected]" \
54+
&& git config --global user.name "Tar Antool"
55+
56+
curl -L https://tarantool.io/release/${{ matrix.tarantool-version }}/installer.sh | bash
57+
sudo apt install -y cartridge-cli ${{ env.CARTRIDGE_CLI_VERSION }}
58+
59+
tarantool --version
60+
cartridge version
61+
62+
./create-packages.sh
63+
64+
- name: Molecule tests
65+
working-directory: '${{ github.repository }}'
66+
run: molecule test
67+
68+
molecule-tests-ee:
69+
if: github.event_name == 'push'
70+
runs-on: ubuntu-latest
71+
strategy:
72+
matrix:
73+
sdk-version: ["2.6.1-0-gcfe0d1a55-r356"]
74+
fail-fast: false
75+
steps:
76+
- uses: actions/checkout@v2
77+
with:
78+
path: '${{ github.repository }}'
79+
80+
- name: Setup python
81+
uses: actions/setup-python@v2
82+
with:
83+
python-version: '3.x'
84+
85+
- name: Install molecule requirements
86+
run: |
87+
pip3 install --upgrade \
88+
ansible==2.8 \
89+
molecule==3.0.2 \
90+
docker \
91+
flake8==3.8.1 \
92+
testinfra
93+
94+
- name: Cache test packages
95+
id: cache-packages
96+
uses: actions/cache@v2
97+
with:
98+
path: '${{ github.repository }}/packages'
99+
key: sdk-${{ matrix.sdk-version }}
100+
101+
- name: Create test packages
102+
if: steps.cache-packages.outputs.cache-hit != 'true'
103+
working-directory: '${{ github.repository }}'
104+
run: |
105+
sudo apt -y update
106+
sudo apt -y install git gcc make cmake unzip
107+
git config --global user.email "[email protected]" \
108+
&& git config --global user.name "Tar Antool"
109+
110+
ARCHIVE_NAME=tarantool-enterprise-bundle-${{ matrix.sdk-version }}.tar.gz
111+
curl -O -L \
112+
https://tarantool:${{ secrets.SDK_DOWNLOAD_TOKEN }}@download.tarantool.io/enterprise/${ARCHIVE_NAME}
113+
tar -xzf ${ARCHIVE_NAME}
114+
rm -f ${ARCHIVE_NAME}
115+
source tarantool-enterprise/env.sh
116+
117+
tarantool --version
118+
cartridge version
119+
120+
./create-packages.sh
121+
122+
- name: Molecule tests
123+
working-directory: '${{ github.repository }}'
124+
run: molecule test

.github/workflows/publish-role.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: Push rockspec
3+
4+
on:
5+
push:
6+
tags:
7+
- '*'
8+
9+
jobs:
10+
publish-role:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- name: Publish role to Ansible Galaxy
16+
uses: robertdebock/[email protected]
17+
with:
18+
galaxy_api_key: ${{ secrets.GALAXY_API_KEY }}

.github/workflows/unit-tests.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: Unit tests
3+
4+
on:
5+
push:
6+
pull_request:
7+
8+
jobs:
9+
unit-tests:
10+
if: |
11+
github.event_name == 'push' ||
12+
github.event_name == 'pull_request' && github.event.pull_request.head.repo.owner.login != 'tarantool'
13+
runs-on: ubuntu-latest
14+
env:
15+
TARANTOOL_VERSION: '1.10'
16+
steps:
17+
- uses: actions/checkout@v2
18+
19+
- name: Setup python
20+
uses: actions/setup-python@v2
21+
with:
22+
python-version: '3.x'
23+
24+
- name: Install requirements
25+
run: |
26+
curl -L https://tarantool.io/JRceXH/release/2.4/installer.sh | bash
27+
pip3 install -r unit/requirements.txt
28+
29+
- name: Run linter
30+
run: python3 -m flake8 library unit
31+
32+
- name: Run unit tests
33+
run: python3 -m unittest discover -v unit

.gitlab-ci.yml

Lines changed: 0 additions & 169 deletions
This file was deleted.

.yamllint

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ rules:
99
indentation:
1010
spaces: 2
1111
indent-sequences: consistent
12+
truthy:
13+
check-keys: false
14+
comments-indentation: disable

create-packages.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ cartridge create --name ${appname}
3030

3131
sed -i '/cartridge.cfg({/a \ \ \ \ vshard_groups = {hot = { bucket_count = 20000 }},' myapp/init.lua
3232

33-
cartridge pack rpm --quiet --version ${version} ${pack_flags} ${appname}
34-
cartridge pack deb --quiet --version ${version} ${pack_flags} ${appname}
33+
cartridge pack rpm --version ${version} ${pack_flags} ${appname}
34+
cartridge pack deb --version ${version} ${pack_flags} ${appname}
3535

3636
rm -rf ${appname}
3737

molecule/default/converge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
- name: Converge
33
hosts: cluster
44
roles:
5-
- role: tarantool-cartridge
5+
- role: ansible-cartridge
66
become: true
77
become_user: root

molecule/default/molecule.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ platforms:
1818
- 8081-8090:8081-8090/tcp
1919
networks:
2020
- name: cartridge-network
21-
purge_networks: true
2221
- name: vm2
2322
image: jrei/systemd-ubuntu:18.04
2423
command: /lib/systemd/systemd
@@ -31,7 +30,6 @@ platforms:
3130
- 8091-8099:8091-8099/tcp
3231
networks:
3332
- name: cartridge-network
34-
purge_networks: true
3533
privileged: true
3634

3735
lint: |

0 commit comments

Comments
 (0)