diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 8302850..3d02be8 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -50,7 +50,7 @@ jobs: continue-on-error: true run: | cd appdaemon - test/generate_badges.sh + test/continuous_integration.sh - name: Setup Pages uses: actions/configure-pages@v3 diff --git a/appdaemon/test/continuous_integration.sh b/appdaemon/test/continuous_integration.sh index 08d1366..7e5ce8f 100755 --- a/appdaemon/test/continuous_integration.sh +++ b/appdaemon/test/continuous_integration.sh @@ -5,13 +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 |& echo -n -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 |& echo -n +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 ${appdaemon_dir}/htmlcov/index.html -echo "Analysing code with pylint..." -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 |& echo -n +echo ${test_dir}/htmlcov/index.html +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 \ No newline at end of file diff --git a/appdaemon/test/requirements.txt b/appdaemon/test/requirements.txt index 8c752e8..bc34e8f 100644 --- a/appdaemon/test/requirements.txt +++ b/appdaemon/test/requirements.txt @@ -1,3 +1,4 @@ +anybadge appdaemon coverage esphome