Skip to content

Commit

Permalink
Merge branch 'gha-tests' of 'https://github.com/vchrombie/grimoirelab…
Browse files Browse the repository at this point in the history
…-elk'

Merges #990
Closes #990
  • Loading branch information
sduenas committed Jul 21, 2021
2 parents a809335 + 1bc77b5 commit 00b3466
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 36 deletions.
57 changes: 22 additions & 35 deletions .github/workflows/ci.yml → .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
name: build
name: tests

on: [push, pull_request]
on:
push:
branches:
- '**'
tags:
- '!*.*.*'
- '*.*.*-*'
pull_request:
branches:
- '**'

jobs:
tests:
runs-on: ubuntu-latest
services:
# How to use MySQL

# MySQL
mysql:
image: mysql:5.7
env:
Expand All @@ -24,63 +34,40 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Configure sysctl limits
- name: Install and set up Poetry
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python -
echo "PATH=$HOME/.poetry/bin:$PATH" >> $GITHUB_ENV
- name: Runs Elasticsearch ${{ matrix.elasticsearch-version }}
uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: ${{ matrix.elasticsearch-version }}

- name: Install dependencies
run: |
pip install --upgrade pip==18.1
pip install --upgrade setuptools==49.6.0
pip install --upgrade wheel
pip install -r "requirements.txt"
pip install -r "requirements_tests.txt"
pip install flake8 coveralls
- name: Verify MySQL connection
run: |
sudo apt-get install -y mysql-client libmysqlclient-dev
mysql --host 127.0.0.1 --port ${{ job.services.mysql.ports[3306] }} -uroot -proot -e "SHOW GRANTS FOR 'root'@'localhost'"
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql --host 127.0.0.1 --port ${{ job.services.mysql.ports[3306] }} -uroot -proot mysql
poetry install -vvv
poetry add -D coveralls
- name: Verify Elasticsearch connection
run: |
curl -fsSL "http://localhost:9200/_cat/health?h=status"
- name: Setup MySQL Database
env:
DB_HOST: 127.0.0.1
DB_PORT: ${{ job.services.mysql.ports[3306] }}
run: |
mysql --host $DB_HOST --port $DB_PORT -uroot -proot -e "SHOW DATABASES"
mysql --host $DB_HOST --port $DB_PORT -uroot -proot -e "CREATE DATABASE test_sh"
mysql --host $DB_HOST --port $DB_PORT -uroot -proot -e "CREATE DATABASE test_projects"
mysql --host $DB_HOST --port $DB_PORT -uroot -proot test_projects < tests/test_projects.sql
mysql --host $DB_HOST --port $DB_PORT -uroot -proot -e "SHOW DATABASES"
- name: Lint with flake8
run: flake8 . --exclude ./src

run: |
poetry run flake8
- name: Tests and Coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd tests
coverage run --source=grimoire_elk run_tests.py
# --service=github is a workaround for bug
# https://github.com/coveralls-clients/coveralls-python/issues/251
coveralls --service=github
poetry run coverage run --source=grimoire_elk run_tests.py
poetry run coveralls --service=github
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Welcome to GrimoireELK [![Build Status](https://github.com/chaoss/grimoirelab-elk/workflows/build/badge.svg)](https://github.com/chaoss/grimoirelab-elk/actions?query=workflow:build+branch:master+event:push) [![Coverage Status](https://coveralls.io/repos/github/chaoss/grimoirelab-elk/badge.svg?branch=master)](https://coveralls.io/github/chaoss/grimoirelab-elk?branch=master)
# Welcome to GrimoireELK [![Build Status](https://github.com/chaoss/grimoirelab-elk/workflows/tests/badge.svg)](https://github.com/chaoss/grimoirelab-elk/actions?query=workflow:tests+branch:master+event:push) [![Coverage Status](https://coveralls.io/repos/github/chaoss/grimoirelab-elk/badge.svg?branch=master)](https://coveralls.io/github/chaoss/grimoirelab-elk?branch=master)

GrimoireELK is the component that interacts with the ElasticSearch database. Its goal is two-fold, first it aims at offering a convenient
way to store the data coming from Perceval, second it processes and enriches the data in a format that can be consumed by Kibiter.
Expand Down

0 comments on commit 00b3466

Please sign in to comment.