Skip to content

Commit

Permalink
f ghp
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierBerger committed Sep 8, 2023
1 parent eac7ae3 commit 4ddf077
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
15 changes: 2 additions & 13 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,12 @@ jobs:
python -m pip install --upgrade pip
pip install -r appdaemon/test/requirements.txt
- name: Lint code with pylint
run: |
pylint $(git ls-files '*.py' | grep -v notifier.py | grep -v hass_driver.py)
- name: Run coverage analysis
- name: Perform QA and generate badges
continue-on-error: true
run: |
cd appdaemon
coverage run --source apps -m pytest test
coverage report -m
coverage html
test/generate_badges.sh
- name: Test with pytest
run: |
cd appdaemon/test
pytest -v
- name: Setup Pages
uses: actions/configure-pages@v3

Expand Down
12 changes: 6 additions & 6 deletions appdaemon/test/generate_badges.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ git_dir=$(realpath "${appdaemon_dir}/../")
apps_dir=$(realpath "${appdaemon_dir}/apps/")
pushd ${appdaemon_dir} > /dev/null
export PYTHONPATH=${apps_dir}
value=$(coverage run --source ${apps_dir} -m pytest | tee /dev/tty | perl -ne '/\[(.*)\]/ and print "$1\n"' | tail -1)
anybadge -l "pytest success" -v ${value} -o -f ../images/pytest.svg 70=red 80=orange 90=yellow 100=green
value=$(coverage report -m |& tee /dev/tty | perl -ne '/TOTAL.* (\S+%)/ and print "$1"')
anybadge -l coverage -v ${value} -o -f ../images/coverage.svg 70=red 80=orange 90=yellow 100=green
pytest=$(coverage run --source ${apps_dir} -m pytest | tee /dev/tty | perl -ne '/========== (.*) ==========/ and print "$1\n"' | tail -1)
coverage=$(coverage report -m |& tee /dev/tty | perl -ne '/TOTAL.* (\S+%)/ and print "$1"')
coverage html
echo ${test_dir}/htmlcov/index.html
value=$(pylint $(git ls-files '*.py' | grep -v notifier.py | grep -v hass_driver.py) --rcfile ${git_dir}/.pylintrc | tee /dev/tty | perl -ne '/at (\S+)/ and print "$1"')
anybadge -l pylint -v "${value}" -o -f ../images/pylint.svg 70=red 80=orange 90=yellow 100=green
pylint=$(pylint $(git ls-files '*.py' | grep -v notifier.py | grep -v hass_driver.py) --rcfile ${git_dir}/.pylintrc | tee /dev/tty | perl -ne '/at (\S+)/ and print "$1"')
anybadge -l pytest -v "${pytest}" -o -f ../htmlcov/pytest.svg -c "#4589CD"
anybadge -l coverage -v "${coverage}" -o -f ../htmlcov/coverage.svg 70=red 80=orange 90=yellow 100=green
anybadge -l pylint -v "${pylint}" -o -f ../htmlcov/pylint.svg 70=red 80=orange 90=yellow 100=green
popd > /dev/null

0 comments on commit 4ddf077

Please sign in to comment.