diff --git a/.github/workflows/reusable-ci-workflows.yml b/.github/workflows/reusable-ci-workflows.yml index f51ddb8..f025a93 100644 --- a/.github/workflows/reusable-ci-workflows.yml +++ b/.github/workflows/reusable-ci-workflows.yml @@ -41,37 +41,37 @@ jobs: - name: Run pylint run: | - pylint --score=yes --load-plugins=pylint.extensions.mccabe --max-complexity=$COMPLEXITY_MAX_SCORE $SOURCE_DIRS | tee pylint-${{ matrix.python-version }}.log - PYLINT_SCORE=$(tail -n 2 pylint-${{ matrix.python-version }}.log | grep -o '[0-9]\{1,2\}\.[0-9]\{2\}' | head -n 1) + pylint --score=yes --load-plugins=pylint.extensions.mccabe --max-complexity=$COMPLEXITY_MAX_SCORE $SOURCE_DIRS | tee pylint-${{ inputs.python-version }}.log + PYLINT_SCORE=$(tail -n 2 pylint-${{ inputs.python-version }}.log | grep -o '[0-9]\{1,2\}\.[0-9]\{2\}' | head -n 1) echo "Pylint score: $PYLINT_SCORE" exit $(echo "$PYLINT_SCORE < $PYLINT_MIN_SCORE" | bc) - name: Upload pylint results uses: actions/upload-artifact@v4 with: - name: pylint-results-${{ matrix.python-version }} - path: pylint-${{ matrix.python-version }}.log + name: pylint-results-${{ inputs.python-version }} + path: pylint-${{ inputs.python-version }}.log - name: Run mypy run: | - mypy --namespace-packages $SOURCE_DIRS | tee mypy-${{ matrix.python-version }}.log - if [ -n "$(tail -n 1 mypy-${{ matrix.python-version }}.log | grep -e '^Succes')" ]; then RESULT="pass"; else RESULT="fail"; fi + mypy --namespace-packages $SOURCE_DIRS | tee mypy-${{ inputs.python-version }}.log + if [ -n "$(tail -n 1 mypy-${{ inputs.python-version }}.log | grep -e '^Succes')" ]; then RESULT="pass"; else RESULT="fail"; fi echo "Mypy result: $RESULT" exit $([[ "$RESULT" == "pass" ]] && echo 0 || echo 1) - name: Upload mypy results uses: actions/upload-artifact@v4 with: - name: mypy-results-${{ matrix.python-version }} - path: mypy-${{ matrix.python-version }}.log + name: mypy-results-${{ inputs.python-version }} + path: mypy-${{ inputs.python-version }}.log - name: Run coverage run: | coverage run --branch --source=$SOURCE_DIRS -m unittest discover --start-directory=tests --pattern="test_*.py" - coverage report --show-missing --fail-under=$COVERAGE_MIN_PERC | tee coverage-${{ matrix.python-version }}.log - COVERAGE_PERC=$(grep "TOTAL" coverage-${{ matrix.python-version }}.log | grep -Eo '[0-9.]+%' | sed 's/%//') + coverage report --show-missing --fail-under=$COVERAGE_MIN_PERC | tee coverage-${{ inputs.python-version }}.log + COVERAGE_PERC=$(grep "TOTAL" coverage-${{ inputs.python-version }}.log | grep -Eo '[0-9.]+%' | sed 's/%//') echo "Coverage: $COVERAGE_PERC%" exit $(echo "$COVERAGE_PERC < $COVERAGE_MIN_PERC" | bc) - name: Upload coverage results uses: actions/upload-artifact@v4 with: - name: coverage-results-${{ matrix.python-version }} - path: coverage-${{ matrix.python-version }}.log + name: coverage-results-${{ inputs.python-version }} + path: coverage-${{ inputs.python-version }}.log