Skip to content

Commit f6167d2

Browse files
authored
Move Data Generator to own repository (#1)
1 parent 1e03ab0 commit f6167d2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+4794
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
paths:
6+
- 'src/data_generator/**'
7+
- 'src/modules/**'
8+
9+
name: tag_build_and_push
10+
11+
jobs:
12+
build-and-deploy:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@master
16+
with:
17+
fetch-depth: '0'
18+
- name: "Bump version and push tag"
19+
id: bumptag
20+
uses: anothrNick/github-tag-action@master
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
DEFAULT_BUMP: patch
24+
WITH_V: true
25+
- name: 'Build and push image'
26+
uses: azure/docker-login@v1
27+
with:
28+
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
29+
username: ${{ secrets.REGISTRY_USERNAME }}
30+
password: ${{ secrets.REGISTRY_PASSWORD }}
31+
- run: |
32+
docker build -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/data-generator:${{ steps.bumptag.outputs.new_tag }} .
33+
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/data-generator:${{ steps.bumptag.outputs.new_tag }}
34+

.github/workflows/code_quality.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
on:
2+
pull_request:
3+
branches:
4+
- master
5+
paths:
6+
- 'src/**'
7+
8+
name: code_quality
9+
10+
jobs:
11+
static_code_analysis:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up Python
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: '3.x'
19+
- name: Install dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install -r src/test/requirements.txt
23+
- name: Lint with flake8
24+
run: |
25+
# stop the build if there are Python syntax errors or undefined names
26+
flake8 ./src/ --count --select=E9,F63,F7,F82 --show-source --statistics
27+
# exit-zero treats all errors as warnings.
28+
flake8 ./src/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
29+
unit_tests:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v2
33+
- name: Set up Python
34+
uses: actions/setup-python@v2
35+
with:
36+
python-version: '3.x'
37+
- name: Install dependencies
38+
run: |
39+
python -m pip install --upgrade pip
40+
pip install -r src/test/requirements.txt
41+
- name: Test with pytest
42+
run: |
43+
pytest ./src/test/
44+
code_coverage:
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v2
48+
- name: Set up Python
49+
uses: actions/setup-python@v2
50+
with:
51+
python-version: '3.x'
52+
- name: Install dependencies
53+
run: |
54+
python -m pip install --upgrade pip
55+
pip install -r src/test/requirements.txt
56+
- name: Measure code coverage
57+
run: |
58+
percentage=$(pytest --cov=./src/modules/ --cov-report term ./src/test | grep -E '[TOTAL]' | awk '{print $4}' | tr -d % )
59+
if [ -z "$percentage" ];then
60+
echo "pytest failed, no code coverage result"
61+
exit -1;
62+
fi;
63+
if (("$percentage" < 95));then
64+
echo "Coverage failed because percentage is lower than 95%: $percentage%"
65+
exit -1;
66+
fi;

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.vscode
2+
local_testing
3+
.idea
4+
__pycache__/
5+
/coverage/
6+
/.coverage
7+
/coverage.xml
8+
venv

0 commit comments

Comments
 (0)