Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grafana demo #25

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/azure-build-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
on:
push:
branches:
- master
paths:
- 'src/data_generator/**'
- 'src/modules/**'

name: tag_build_and_push

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: '0'
- name: "Bump version and push tag"
id: bumptag
uses: anothrNick/github-tag-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BUMP: patch
WITH_V: true
- name: 'Build and push image'
uses: azure/docker-login@v1
with:
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- run: |
docker build -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/data-generator:${{ steps.bumptag.outputs.new_tag }} .
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/data-generator:${{ steps.bumptag.outputs.new_tag }}

66 changes: 66 additions & 0 deletions .github/workflows/code_quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
on:
pull_request:
branches:
- master
paths:
- 'src/**'

name: code_quality

jobs:
static_code_analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r src/test/requirements.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 ./src/ --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings.
flake8 ./src/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
unit_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r src/test/requirements.txt
- name: Test with pytest
run: |
pytest ./src/test/
code_coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r src/test/requirements.txt
- name: Measure code coverage
run: |
percentage=$(pytest --cov=./src/modules/ --cov-report term ./src/test | grep -E '[TOTAL]' | awk '{print $4}' | tr -d % )
if [ -z "$percentage" ];then
echo "pytest failed, no code coverage result"
exit -1;
fi;
if (("$percentage" < 95));then
echo "Coverage failed because percentage is lower than 95%: $percentage%"
exit -1;
fi;
Loading
Loading