From 70134b31c3ba84396d467e1f78dba7169a057639 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Mon, 16 Dec 2024 23:55:20 +0100 Subject: [PATCH] Exchanged 'echo' with 'printf'. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit co-authored-by: Sven Köhler --- .github/workflows/ApplicationTesting.yml | 4 +- .github/workflows/BuildTheDocs.yml | 2 +- .github/workflows/CheckDocumentation.yml | 4 +- .github/workflows/CoverageCollection.yml | 4 +- .github/workflows/NightlyRelease.yml | 166 +++++++++--------- .github/workflows/PublishTestResults.yml | 2 +- .github/workflows/TestReleaser.yml | 20 +-- .github/workflows/UnitTesting.yml | 4 +- .../workflows/_Checking_ArtifactCleanup.yml | 4 +- .github/workflows/_Checking_Nightly.yml | 10 +- 10 files changed, 110 insertions(+), 110 deletions(-) diff --git a/.github/workflows/ApplicationTesting.yml b/.github/workflows/ApplicationTesting.yml index 5196901..266c412 100644 --- a/.github/workflows/ApplicationTesting.yml +++ b/.github/workflows/ApplicationTesting.yml @@ -231,10 +231,10 @@ jobs: cd "${{ inputs.root_directory || '.' }}" [ -n '${{ inputs.apptest_xml_artifact }}' ] && PYTEST_ARGS='--junitxml=report/unit/TestReportSummary.xml' || unset PYTEST_ARGS if [ -n '${{ inputs.coverage_config }}' ]; then - echo "coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.apptest_directory }}" + printf "%s\n" "coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.apptest_directory }}" coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.apptest_directory }} else - echo "python -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.apptest_directory }}" + printf "%s\n" "python -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.apptest_directory }}" python -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.apptest_directory }} fi diff --git a/.github/workflows/BuildTheDocs.yml b/.github/workflows/BuildTheDocs.yml index 330cd3c..1507b48 100644 --- a/.github/workflows/BuildTheDocs.yml +++ b/.github/workflows/BuildTheDocs.yml @@ -38,7 +38,7 @@ jobs: steps: - name: '❗ Deprecation message' - run: echo "::warning title=Deprecated::'BuildTheDocs.yml' is not maintained anymore. Please switch to 'SphinxDocumentation.yml', 'LaTeXDocumentation.yml' and 'ExtractConfiguration.yml'." + run: printf "%s\n" "::warning title=Deprecated::'BuildTheDocs.yml' is not maintained anymore. Please switch to 'SphinxDocumentation.yml', 'LaTeXDocumentation.yml' and 'ExtractConfiguration.yml'." - name: ⏬ Checkout repository uses: actions/checkout@v4 diff --git a/.github/workflows/CheckDocumentation.yml b/.github/workflows/CheckDocumentation.yml index 3a9fa1f..89255e1 100644 --- a/.github/workflows/CheckDocumentation.yml +++ b/.github/workflows/CheckDocumentation.yml @@ -64,9 +64,9 @@ jobs: - name: Run 'interrogate' Documentation Coverage Check continue-on-error: true run: | - interrogate -c pyproject.toml --fail-under=${{ inputs.fail_under }} && echo "::error title=interrogate::Insufficient documentation quality (goal: ${{ inputs.fail_under }})" + interrogate -c pyproject.toml --fail-under=${{ inputs.fail_under }} && printf "%s\n" "::error title=interrogate::Insufficient documentation quality (goal: ${{ inputs.fail_under }})" - name: Run 'docstr_coverage' Documentation Coverage Check continue-on-error: true run: | - docstr-coverage -v 2 --fail-under=${{ inputs.fail_under }} ${{ inputs.directory }} && echo "::error title=docstr-coverage::Insufficient documentation quality (goal: ${{ inputs.fail_under }})" + docstr-coverage -v 2 --fail-under=${{ inputs.fail_under }} ${{ inputs.directory }} && printf "%s\n" "::error title=docstr-coverage::Insufficient documentation quality (goal: ${{ inputs.fail_under }})" diff --git a/.github/workflows/CoverageCollection.yml b/.github/workflows/CoverageCollection.yml index 3bdf272..a9df9dc 100644 --- a/.github/workflows/CoverageCollection.yml +++ b/.github/workflows/CoverageCollection.yml @@ -72,7 +72,7 @@ jobs: steps: - name: '❗ Deprecation message' - run: echo "::warning title=Deprecated::'CoverageCollection.yml' is not maintained anymore. Please switch to 'UnitTesting.yml', 'PublishCoverageResults.yml' and 'PublishTestResults.yml'." + run: printf "%s\n" "::warning title=Deprecated::'CoverageCollection.yml' is not maintained anymore. Please switch to 'UnitTesting.yml', 'PublishCoverageResults.yml' and 'PublishTestResults.yml'." - name: ⏬ Checkout repository uses: actions/checkout@v4 @@ -150,7 +150,7 @@ jobs: ABSDIR=$(pwd) cd "${{ inputs.tests_directory || '.' }}" [ -n '${{ inputs.coverage_config }}' ] && PYCOV_ARGS="--cov-config=${ABSDIR}/${{ inputs.coverage_config }}" || unset PYCOV_ARGS - echo "python -m pytest -rA --cov=${ABSDIR} ${PYCOV_ARGS} ${{ inputs.unittest_directory }} --color=yes" + printf "%s\n" "python -m pytest -rA --cov=${ABSDIR} ${PYCOV_ARGS} ${{ inputs.unittest_directory }} --color=yes" python -m pytest -rA --cov=${ABSDIR} $PYCOV_ARGS ${{ inputs.unittest_directory }} --color=yes - name: Convert to cobertura format diff --git a/.github/workflows/NightlyRelease.yml b/.github/workflows/NightlyRelease.yml index b5e4fe4..6264a67 100644 --- a/.github/workflows/NightlyRelease.yml +++ b/.github/workflows/NightlyRelease.yml @@ -97,23 +97,23 @@ jobs: run: | set +e - ANSI_LIGHT_RED="\e[91m" - ANSI_LIGHT_GREEN="\e[92m" - ANSI_LIGHT_YELLOW="\e[93m" - ANSI_NOCOLOR="\e[0m" + ANSI_LIGHT_RED=$'\x1b[91m' + ANSI_LIGHT_GREEN=$'\x1b[92m' + ANSI_LIGHT_YELLOW=$'\x1b[93m' + ANSI_NOCOLOR=$'\x1b[0m' export GH_TOKEN=${{ github.token }} - echo -n "Deleting release '${{ inputs.nightly_name }}' ... " + printf "%s" "Deleting release '${{ inputs.nightly_name }}' ... " message="$(gh release delete ${{ inputs.nightly_name }} --yes 2>&1)" if [[ $? -eq 0 ]]; then - echo -e "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}" + printf "%s\n" "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}" elif [[ "${message}" == "release not found" ]]; then - echo -e "${ANSI_LIGHT_YELLOW}[NOT FOUND]${ANSI_NOCOLOR}" + printf "%s\n" "${ANSI_LIGHT_YELLOW}[NOT FOUND]${ANSI_NOCOLOR}" else - echo -e "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}" - echo -e "${ANSI_LIGHT_RED}Couldn't delete release '${{ inputs.nightly_name }}' -> Error: '${message}'.${ANSI_NOCOLOR}" - echo "::error title=InternalError::Couldn't delete release '${{ inputs.nightly_name }}' -> Error: '${message}'." + printf "%s\n" "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}" + printf "%s\n" "${ANSI_LIGHT_RED}Couldn't delete release '${{ inputs.nightly_name }}' -> Error: '${message}'.${ANSI_NOCOLOR}" + printf "%s\n" "::error title=InternalError::Couldn't delete release '${{ inputs.nightly_name }}' -> Error: '${message}'." exit 1 fi @@ -122,9 +122,9 @@ jobs: run: | set +e - ANSI_LIGHT_RED="\e[91m" - ANSI_LIGHT_GREEN="\e[92m" - ANSI_NOCOLOR="\e[0m" + ANSI_LIGHT_RED=$'\x1b[91m' + ANSI_LIGHT_GREEN=$'\x1b[92m' + ANSI_NOCOLOR=$'\x1b[0m' export GH_TOKEN=${{ github.token }} @@ -166,14 +166,14 @@ jobs: Published from [${{ github.workflow }}](https://github.com/Paebbels/ghdl/actions/runs/${{ github.run_id }}) workflow triggered by @${{ github.actor }} on $(date '+%Y-%m-%d %H:%M:%S'). EOF - echo "Creating release '${{ inputs.nightly_name }}' ... " + printf "%s\n" "Creating release '${{ inputs.nightly_name }}' ... " message="$(gh release create "${{ inputs.nightly_name }}" --verify-tag $addDraft $addPreRelease $addLatest "${addTitle[@]}" "${addNotes[@]}" 2>&1)" if [[ $? -eq 0 ]]; then - echo -e "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}" + printf "%s\n" "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}" else - echo -e "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}" - echo -e "${ANSI_LIGHT_RED}Couldn't create release '${{ inputs.nightly_name }}' -> Error: '${message}'.${ANSI_NOCOLOR}" - echo "::error title=InternalError::Couldn't create release '${{ inputs.nightly_name }}' -> Error: '${message}'." + printf "%s\n" "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}" + printf "%s\n" "${ANSI_LIGHT_RED}Couldn't create release '${{ inputs.nightly_name }}' -> Error: '${message}'.${ANSI_NOCOLOR}" + printf "%s\n" "::error title=InternalError::Couldn't create release '${{ inputs.nightly_name }}' -> Error: '${message}'." exit 1 fi @@ -182,10 +182,10 @@ jobs: run: | set +e - ANSI_LIGHT_RED="\e[91m" - ANSI_LIGHT_GREEN="\e[92m" - ANSI_LIGHT_YELLOW="\e[93m" - ANSI_NOCOLOR="\e[0m" + ANSI_LIGHT_RED=$'\x1b[91m' + ANSI_LIGHT_GREEN=$'\x1b[92m' + ANSI_LIGHT_YELLOW=$'\x1b[93m' + ANSI_NOCOLOR=$'\x1b[0m' export GH_TOKEN=${{ github.token }} @@ -199,7 +199,7 @@ jobs: replacement="${patternLine#*=}" line="${line//"%$pattern%"/"$replacement"}" done <<<'${{ inputs.replacements }}' - echo "$line" + printf "%s\n" "$line" } ERRORS=0 @@ -226,96 +226,96 @@ jobs: asset="$(Replace "${asset}")" title="$(Replace "${title}")" - echo "Publish asset '${asset}' from artifact '${artifact}' with title '${title}'" - echo -n " Checked asset for duplicates ... " + printf "%s\n" "Publish asset '${asset}' from artifact '${artifact}' with title '${title}'" + printf "%s" " Checked asset for duplicates ... " if [[ -n "${assetFilenames[$asset]}" ]]; then - echo -e "${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}" - echo "::error title=DuplicateAsset::Asset '${asset}' from artifact '${artifact}' was already uploaded to release '${{ inputs.nightly_name }}'." + printf "%s\n" "${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}" + printf "%s\n" "::error title=DuplicateAsset::Asset '${asset}' from artifact '${artifact}' was already uploaded to release '${{ inputs.nightly_name }}'." ERRORS=1 continue else - echo -e "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}" + printf "%s\n" "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}" assetFilenames[$asset]=1 fi # Download artifact by artifact name if [[ -n "${downloadedArtifacts[$artifact]}" ]]; then - echo -e " downloading '${artifact}' ... ${ANSI_LIGHT_YELLOW}[SKIPPED]${ANSI_NOCOLOR}" + printf "%s\n" " downloading '${artifact}' ... ${ANSI_LIGHT_YELLOW}[SKIPPED]${ANSI_NOCOLOR}" else echo " downloading '${artifact}' ... " - echo -n " gh run download $GITHUB_RUN_ID --dir \"${artifact}\" --name \"${artifact}\" " + printf "%s" " gh run download $GITHUB_RUN_ID --dir \"${artifact}\" --name \"${artifact}\" " gh run download $GITHUB_RUN_ID --dir "${artifact}" --name "${artifact}" if [[ $? -eq 0 ]]; then - echo -e "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}" + printf "%s\n" "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}" else - echo -e "${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}" - echo -e "${ANSI_LIGHT_RED}Couldn't download artifact '${artifact}'.${ANSI_NOCOLOR}" - echo "::error title=ArtifactNotFound::Couldn't download artifact '${artifact}'." + printf "%s\n" "${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}" + printf "%s\n" "${ANSI_LIGHT_RED}Couldn't download artifact '${artifact}'.${ANSI_NOCOLOR}" + printf "%s\n" "::error title=ArtifactNotFound::Couldn't download artifact '${artifact}'." ERRORS=1 continue fi downloadedArtifacts[$artifact]=1 - echo -n " Checking for embedded tarball ... " + printf "%s" " Checking for embedded tarball ... " if [[ -f "${artifact}/${{ inputs.tarball-name }}" ]]; then - echo -e "${ANSI_LIGHT_GREEN}[FOUND]${ANSI_NOCOLOR}" + printf "%s\n" "${ANSI_LIGHT_GREEN}[FOUND]${ANSI_NOCOLOR}" pushd "${artifact}" > /dev/null - echo -n " Extracting embedded tarball ... " + printf "%s" " Extracting embedded tarball ... " tar -xf "${{ inputs.tarball-name }}" if [[ $? -ne 0 ]]; then - echo -e "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}" + printf "%s\n" "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}" else - echo -e "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}" + printf "%s\n" "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}" fi - echo -n " Removing temporary tarball ... " + printf "%s" " Removing temporary tarball ... " rm -f "${{ inputs.tarball-name }}" if [[ $? -ne 0 ]]; then - echo -e "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}" + printf "%s\n" "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}" else - echo -e "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}" + printf "%s\n" "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}" fi popd > /dev/null else - echo -e "${ANSI_LIGHT_YELLOW}[SKIPPED]${ANSI_NOCOLOR}" + printf "%s\n" "${ANSI_LIGHT_YELLOW}[SKIPPED]${ANSI_NOCOLOR}" fi fi # Check if artifact should be compressed (zip, tgz) or if asset was part of the downloaded artifact. - echo -n " checking asset '${artifact}/${asset}' ... " + printf "%s" " checking asset '${artifact}/${asset}' ... " if [[ "${asset}" == !*.zip ]]; then - echo -e "${ANSI_LIGHT_GREEN}[ZIP]${ANSI_NOCOLOR}" + printf "%s\n" "${ANSI_LIGHT_GREEN}[ZIP]${ANSI_NOCOLOR}" asset="${asset##*!}" - echo " Compressing artifact '${artifact}' to '${asset}' ..." + printf "%s\n" " Compressing artifact '${artifact}' to '${asset}' ..." ( cd "${artifact}" && \ zip -r "../${asset}" * ) if [[ $? -eq 0 ]]; then - echo -e " Compression ${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}" + printf "%s\n" " Compression ${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}" uploadFile="${asset}" else - echo -e " Compression ${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}" - echo -e "${ANSI_LIGHT_RED}Couldn't compress '${artifact}' to zip file '${asset}'.${ANSI_NOCOLOR}" - echo "::error title=CompressionError::Couldn't compress '${artifact}' to zip file '${asset}'." + printf "%s\n" " Compression ${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}" + printf "%s\n" "${ANSI_LIGHT_RED}Couldn't compress '${artifact}' to zip file '${asset}'.${ANSI_NOCOLOR}" + printf "%s\n" "::error title=CompressionError::Couldn't compress '${artifact}' to zip file '${asset}'." ERRORS=1 continue fi elif [[ "${asset}" == !*.tgz || "${asset}" == !*.tar.gz || "${asset}" == \$*.tgz || "${asset}" == \$*.tar.gz ]]; then - echo -e "${ANSI_LIGHT_GREEN}[TAR/GZ]${ANSI_NOCOLOR}" + printf "%s\n" "${ANSI_LIGHT_GREEN}[TAR/GZ]${ANSI_NOCOLOR}" if [[ "${asset:0:1}" == "\$" ]]; then asset="${asset##*$}" dirName="${asset%.*}" - echo " Compressing artifact '${artifact}' to '${asset}' ..." + printf "%s\n" " Compressing artifact '${artifact}' to '${asset}' ..." tar -c --gzip --owner=0 --group=0 --file="${asset}" --directory="${artifact}" --transform "s|^\.|${dirName%.tar}|" . retCode=$? else asset="${asset##*!}" - echo " Compressing artifact '${artifact}' to '${asset}' ..." + printf "%s\n" " Compressing artifact '${artifact}' to '${asset}' ..." ( cd "${artifact}" && \ tar -c --gzip --owner=0 --group=0 --file="../${asset}" * @@ -324,27 +324,27 @@ jobs: fi if [[ $retCode -eq 0 ]]; then - echo -e " Compression ${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}" + printf "%s\n" " Compression ${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}" uploadFile="${asset}" else - echo -e " Compression ${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}" - echo -e "${ANSI_LIGHT_RED}Couldn't compress '${artifact}' to tgz file '${asset}'.${ANSI_NOCOLOR}" - echo "::error title=CompressionError::Couldn't compress '${artifact}' to tgz file '${asset}'." + printf "%s\n" " Compression ${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}" + printf "%s\n" "${ANSI_LIGHT_RED}Couldn't compress '${artifact}' to tgz file '${asset}'.${ANSI_NOCOLOR}" + printf "%s\n" "::error title=CompressionError::Couldn't compress '${artifact}' to tgz file '${asset}'." ERRORS=1 continue fi elif [[ "${asset}" == !*.tzst || "${asset}" == !*.tar.zst || "${asset}" == \$*.tzst || "${asset}" == \$*.tar.zst ]]; then - echo -e "${ANSI_LIGHT_GREEN}[ZST]${ANSI_NOCOLOR}" + printf "%s\n" "${ANSI_LIGHT_GREEN}[ZST]${ANSI_NOCOLOR}" if [[ "${asset:0:1}" == "\$" ]]; then asset="${asset##*$}" dirName="${asset%.*}" - echo " Compressing artifact '${artifact}' to '${asset}' ..." + printf "%s\n" " Compressing artifact '${artifact}' to '${asset}' ..." tar -c --zstd --owner=0 --group=0 --file="${asset}" --directory="${artifact}" --transform "s|^\.|${dirName%.tar}|" . retCode=$? else asset="${asset##*!}" - echo " Compressing artifact '${artifact}' to '${asset}' ..." + printf "%s\n" " Compressing artifact '${artifact}' to '${asset}' ..." ( cd "${artifact}" && \ tar -c --zstd --owner=0 --group=0 --file="../${asset}" * @@ -353,45 +353,45 @@ jobs: fi if [[ $retCode -eq 0 ]]; then - echo -e " Compression ${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}" + printf "%s\n" " Compression ${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}" uploadFile="${asset}" else - echo -e " Compression ${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}" - echo -e "${ANSI_LIGHT_RED}Couldn't compress '${artifact}' to zst file '${asset}'.${ANSI_NOCOLOR}" - echo "::error title=CompressionError::Couldn't compress '${artifact}' to zst file '${asset}'." + printf "%s\n" " Compression ${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}" + printf "%s\n" "${ANSI_LIGHT_RED}Couldn't compress '${artifact}' to zst file '${asset}'.${ANSI_NOCOLOR}" + printf "%s\n" "::error title=CompressionError::Couldn't compress '${artifact}' to zst file '${asset}'." ERRORS=1 continue fi elif [[ -e "${artifact}/${asset}" ]]; then - echo -e "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}" + printf "%s\n" "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}" uploadFile="${artifact}/${asset}" else - echo -e "${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}" - echo -e "${ANSI_LIGHT_RED}Couldn't find asset '${asset}' in artifact '${artifact}'.${ANSI_NOCOLOR}" - echo "::error title=FileNotFound::Couldn't find asset '${asset}' in artifact '${artifact}'." + printf "%s\n" "${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}" + printf "%s\n" "${ANSI_LIGHT_RED}Couldn't find asset '${asset}' in artifact '${artifact}'.${ANSI_NOCOLOR}" + printf "%s\n" "::error title=FileNotFound::Couldn't find asset '${asset}' in artifact '${artifact}'." ERRORS=1 continue fi # Upload asset to existing release page - echo -n " uploading asset '${asset}' from '${uploadFile}' with title '${title}' ... " + printf "%s" " uploading asset '${asset}' from '${uploadFile}' with title '${title}' ... " gh release upload ${{ inputs.nightly_name }} "${uploadFile}#${title}" --clobber if [[ $? -eq 0 ]]; then - echo -e "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}" + printf "%s\n" "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}" else - echo -e "${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}" - echo -e "${ANSI_LIGHT_RED}Couldn't upload asset '${asset}' from '${uploadFile}' to release '${{ inputs.nightly_name }}'.${ANSI_NOCOLOR}" - echo "::error title=UploadError::Couldn't upload asset '${asset}' from '${uploadFile}' to release '${{ inputs.nightly_name }}'." + printf "%s\n" "${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}" + printf "%s\n" "${ANSI_LIGHT_RED}Couldn't upload asset '${asset}' from '${uploadFile}' to release '${{ inputs.nightly_name }}'.${ANSI_NOCOLOR}" + printf "%s\n" "::error title=UploadError::Couldn't upload asset '${asset}' from '${uploadFile}' to release '${{ inputs.nightly_name }}'." ERRORS=1 continue fi done <<<'${{ inputs.assets }}' - echo "Inspecting downloaded artifacts ..." + printf "%s\n" "Inspecting downloaded artifacts ..." tree -L 3 . if [[ $ERROR -ne 0 ]]; then - echo -e "${ANSI_LIGHT_RED}Errors detected in previous steps.${ANSI_NOCOLOR}" + printf "%s\n" "${ANSI_LIGHT_RED}Errors detected in previous steps.${ANSI_NOCOLOR}" exit 1 fi @@ -400,19 +400,19 @@ jobs: run: | set +e - ANSI_LIGHT_RED="\e[91m" - ANSI_LIGHT_GREEN="\e[92m" - ANSI_NOCOLOR="\e[0m" + ANSI_LIGHT_RED=$'\x1b[91m' + ANSI_LIGHT_GREEN=$'\x1b[92m' + ANSI_NOCOLOR=$'\x1b[0m' export GH_TOKEN=${{ github.token }} # Remove draft-state from release page - echo -n "Remove draft-state from release '${title}' ... " + printf "%s" "Remove draft-state from release '${title}' ... " gh release edit --draft=false "${{ inputs.nightly_name }}" if [[ $? -eq 0 ]]; then - echo -e "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}" + printf "%s\n" "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}" else - echo -e "${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}" - echo -e "${ANSI_LIGHT_RED}Couldn't remove draft-state from release '${{ inputs.nightly_name }}'.${ANSI_NOCOLOR}" - echo "::error title=ReleasePage::Couldn't remove draft-state from release '${{ inputs.nightly_name }}'." + printf "%s\n" "${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}" + printf "%s\n" "${ANSI_LIGHT_RED}Couldn't remove draft-state from release '${{ inputs.nightly_name }}'.${ANSI_NOCOLOR}" + printf "%s\n" "::error title=ReleasePage::Couldn't remove draft-state from release '${{ inputs.nightly_name }}'." fi diff --git a/.github/workflows/PublishTestResults.yml b/.github/workflows/PublishTestResults.yml index 2d8d4a9..b76b8c8 100644 --- a/.github/workflows/PublishTestResults.yml +++ b/.github/workflows/PublishTestResults.yml @@ -89,7 +89,7 @@ jobs: - name: 🔁 Merge JUnit Unit Test Summaries run: | pyedaa-reports -v unittest "--merge=pyTest-JUnit:junit/*.xml" ${{ inputs.additional_merge_args }} "--output=pyTest-JUnit:Unittesting.xml" - echo "cat Unittesting.xml" + printf "%s\n" "cat Unittesting.xml" cat Unittesting.xml - name: 📊 Publish Unit Test Results diff --git a/.github/workflows/TestReleaser.yml b/.github/workflows/TestReleaser.yml index 8b7056a..b874555 100644 --- a/.github/workflows/TestReleaser.yml +++ b/.github/workflows/TestReleaser.yml @@ -64,7 +64,7 @@ jobs: steps: - uses: actions/checkout@v4 - - run: echo "Build some tool and generate some (versioned) artifacts" > artifact-$(date -u +"%Y-%m-%dT%H-%M-%SZ").txt + - run: printf "%s\n" "Build some tool and generate some (versioned) artifacts" > artifact-$(date -u +"%Y-%m-%dT%H-%M-%SZ").txt - name: Single uses: ./releaser/composite @@ -84,7 +84,7 @@ jobs: - name: Add artifacts/*.txt run: | mkdir artifacts - echo "Build some tool and generate some artifacts" > artifacts/artifact.txt + printf "%s\n" "Build some tool and generate some artifacts" > artifacts/artifact.txt touch artifacts/empty_file.txt - name: Single in subdir @@ -95,8 +95,8 @@ jobs: - name: Add artifacts/*.md run: | - echo "releaser hello" > artifacts/hello.md - echo "releaser world" > artifacts/world.md + printf "%s\n" "releaser hello" > artifacts/hello.md + printf "%s\n" "releaser world" > artifacts/world.md - name: Directory wildcard uses: ./releaser/composite @@ -107,7 +107,7 @@ jobs: - name: Add artifacts/subdir run: | mkdir artifacts/subdir - echo "Test recursive glob" > artifacts/subdir/deep_file.txt + printf "%s\n" "Test recursive glob" > artifacts/subdir/deep_file.txt - name: Directory wildcard (recursive) uses: ./releaser/composite @@ -124,7 +124,7 @@ jobs: steps: - uses: actions/checkout@v4 - - run: echo "Build some tool and generate some (versioned) artifacts" > artifact-$(date -u +"%Y-%m-%dT%H-%M-%SZ").txt + - run: printf "%s\n" "Build some tool and generate some (versioned) artifacts" > artifact-$(date -u +"%Y-%m-%dT%H-%M-%SZ").txt - name: Single uses: ./releaser @@ -144,7 +144,7 @@ jobs: - name: Add artifacts/*.txt run: | mkdir artifacts - echo "Build some tool and generate some artifacts" > artifacts/artifact.txt + printf "%s\n" "Build some tool and generate some artifacts" > artifacts/artifact.txt touch artifacts/empty_file.txt - name: Single in subdir @@ -155,8 +155,8 @@ jobs: - name: Add artifacts/*.md run: | - echo "releaser hello" > artifacts/hello.md - echo "releaser world" > artifacts/world.md + printf "%s\n" "releaser hello" > artifacts/hello.md + printf "%s\n" "releaser world" > artifacts/world.md - name: Directory wildcard uses: ./releaser @@ -167,7 +167,7 @@ jobs: - name: Add artifacts/subdir run: | mkdir artifacts/subdir - echo "Test recursive glob" > artifacts/subdir/deep_file.txt + printf "%s\n" "Test recursive glob" > artifacts/subdir/deep_file.txt - name: Directory wildcard (recursive) uses: ./releaser diff --git a/.github/workflows/UnitTesting.yml b/.github/workflows/UnitTesting.yml index 7b32f23..ed57f5c 100644 --- a/.github/workflows/UnitTesting.yml +++ b/.github/workflows/UnitTesting.yml @@ -397,10 +397,10 @@ jobs: cd "${{ inputs.root_directory || '.' }}" [ -n '${{ inputs.unittest_xml_artifact }}' ] && PYTEST_ARGS='--junitxml=report/unit/TestReportSummary.xml' || unset PYTEST_ARGS if [ -n '${{ inputs.coverage_config }}' ]; then - echo "coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.unittest_directory }}" + printf "%s\n" "coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.unittest_directory }}" coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.unittest_directory }} else - echo "python -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.unittest_directory }}" + printf "%s\n" "python -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.unittest_directory }}" python -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.unittest_directory }} fi diff --git a/.github/workflows/_Checking_ArtifactCleanup.yml b/.github/workflows/_Checking_ArtifactCleanup.yml index f2133ff..0d40516 100644 --- a/.github/workflows/_Checking_ArtifactCleanup.yml +++ b/.github/workflows/_Checking_ArtifactCleanup.yml @@ -22,7 +22,7 @@ jobs: include: ${{ fromJson(needs.Params.outputs.python_jobs) }} steps: - name: Content creation for ${{ matrix.system }}-${{ matrix.python }} - run: echo "${{ matrix.runs-on }}-${{ matrix.python }}" >> artifact.txt + run: printf "%s\n" "${{ matrix.runs-on }}-${{ matrix.python }}" >> artifact.txt - name: 📤 Upload artifact for ${{ matrix.system }}-${{ matrix.python }} uses: pyTooling/upload-artifact@v4 @@ -39,7 +39,7 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Package creation - run: echo "Package" >> package.txt + run: printf "%s\n" "Package" >> package.txt - name: 📤 Upload artifact for ${{ matrix.system }}-${{ matrix.python }} uses: pyTooling/upload-artifact@v4 diff --git a/.github/workflows/_Checking_Nightly.yml b/.github/workflows/_Checking_Nightly.yml index 922981e..00f493f 100644 --- a/.github/workflows/_Checking_Nightly.yml +++ b/.github/workflows/_Checking_Nightly.yml @@ -12,9 +12,9 @@ jobs: steps: - name: 🖉 Build 1 run: | - echo "Document 1 $(date --utc '+%d.%m.%Y - %H:%M:%S')" > document1.txt - echo "Analysis log $(date --utc '+%d.%m.%Y - %H:%M:%S')" > analysis.log - echo "Build log $(date --utc '+%d.%m.%Y - %H:%M:%S')" > build.log + printf "%s\n" "Document 1 $(date --utc '+%d.%m.%Y - %H:%M:%S')" > document1.txt + printf "%s\n" "Analysis log $(date --utc '+%d.%m.%Y - %H:%M:%S')" > analysis.log + printf "%s\n" "Build log $(date --utc '+%d.%m.%Y - %H:%M:%S')" > build.log - name: 📤 Upload artifact uses: pyTooling/upload-artifact@v4 @@ -28,8 +28,8 @@ jobs: - name: 🖉 Program run: | - echo "Document other $(date --utc '+%d.%m.%Y - %H:%M:%S')" > document1.txt - echo "Program $(date --utc '+%d.%m.%Y - %H:%M:%S')" > program.py + printf "%s\n" "Document other $(date --utc '+%d.%m.%Y - %H:%M:%S')" > document1.txt + printf "%s\n" "Program $(date --utc '+%d.%m.%Y - %H:%M:%S')" > program.py - name: 📤 Upload artifact uses: actions/upload-artifact@v4