Skip to content

Commit

Permalink
ci: improve tests_local workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
leahaeusel committed Jan 21, 2025
1 parent d9cb01f commit c9fe69d
Showing 1 changed file with 40 additions and 6 deletions.
46 changes: 40 additions & 6 deletions .github/workflows/tests_local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
name: tests_local

on:
schedule:
- cron: '0 1 * * *'
pull_request:
push:
branches:
Expand Down Expand Up @@ -37,19 +39,51 @@ jobs:
uses: ./.github/actions/create_python_environment
- name: Get Python package manager
run: echo "PYTHON_PACKAGE_MANAGER=${{steps.environment.outputs.ppm}}" >> $GITHUB_ENV
- name: Check compatibility of licenses of dependencies
id: license_check_report
uses: pilosus/action-pip-license-checker@v2
with:
requirements: requirements.txt,dev-requirements.txt
fail: StrongCopyleft,NetworkCopyleft
exclude: '(?i)^(pylint|yamllint)'
- name: Print report
run: echo "${{ steps.license_check_report.outputs.report }}"
- name: Codechecks
run: |
$PYTHON_PACKAGE_MANAGER activate queens
isort --check-only queens tests > track_isort.txt 2>&1
black --check queens tests > track_black.txt 2>&1
pylint --rcfile=.pylintrc_ci queens tests | tee track_pylint.txt 2>&1
pylint queens tests --rcfile=.pylintrc --output-format=json:pylint_warnings.json --fail-under 0
python .gitlab/pipeline_utils/code_quality_creator.py pylint_warnings.json
pydocstyle --match-dir='^(?!.*test).*$' queens > track_pydocstyle.txt 2>&1
echo "::group::Run isort..."
isort --check-only queens tests
echo "::endgroup::"
echo "::group::Run black..."
black --check queens tests
echo "::endgroup::"
echo "::group::Run pylint..."
pylint --rcfile=.pylintrc_ci queens tests
# pylint queens tests --rcfile=.pylintrc --output-format=json:pylint_warnings.json --fail-under 0
echo "::endgroup::"
# echo "::group::Create code quality report..."
# python .gitlab/pipeline_utils/code_quality_creator.py pylint_warnings.json
# pydocstyle --match-dir='^(?!.*test).*$' queens
# echo "::endgroup::"
echo "::group::Create an rc file for the license header check..."
python .gitlab/pipeline_utils/create_licenserc.py --template_file ".gitlab/pipeline_utils/.licenserc_template.yaml" --text_file "license_header.tmpl" --output_file ".licenserc.yaml" --placeholder "license_header"
echo "::endgroup::"
- name: Check License headers
uses: apache/skywalking-eyes/[email protected]
- name: Run pytest
run: |
$PYTHON_PACKAGE_MANAGER activate queens
pytest -v -m "unit_tests or integration_tests or integration_tests_fourc" --cov --cov-report=term --cov-report=html:html_coverage_report --cov-report=xml:xml_coverage_report.xml $TEST_TIMING_OPTION --color=yes -o junit_logging=all --junitxml=test_junit.xml
- name: Upload coverage report
uses: actions/upload-pages-artifact@v3
with:
path: html_coverage_report
retention-days: 7
- name: Publish junit pytest report
uses: mikepenz/action-junit-report@v5
if: success() || failure() # always run even if the previous step fails
Expand Down

0 comments on commit c9fe69d

Please sign in to comment.