mirror of
https://github.com/pyTooling/Actions.git
synced 2026-02-12 02:56:56 +08:00
Report errors also to Pipeline message log.
This commit is contained in:
6
.github/workflows/ApplicationTesting.yml
vendored
6
.github/workflows/ApplicationTesting.yml
vendored
@@ -124,7 +124,11 @@ jobs:
|
|||||||
requirements = "${{ inputs.requirements }}"
|
requirements = "${{ inputs.requirements }}"
|
||||||
if requirements.startswith("-r"):
|
if requirements.startswith("-r"):
|
||||||
requirementsFile = Path(requirements[2:].lstrip())
|
requirementsFile = Path(requirements[2:].lstrip())
|
||||||
dependencies = loadRequirementsFile(requirementsFile)
|
try:
|
||||||
|
dependencies = loadRequirementsFile(requirementsFile)
|
||||||
|
except FileNotFoundError as ex:
|
||||||
|
print(f"::error title=FileNotFoundError::{ex}")
|
||||||
|
exit(1)
|
||||||
else:
|
else:
|
||||||
dependencies = [req.strip() for req in requirements.split(" ")]
|
dependencies = [req.strip() for req in requirements.split(" ")]
|
||||||
|
|
||||||
|
|||||||
6
.github/workflows/CoverageCollection.yml
vendored
6
.github/workflows/CoverageCollection.yml
vendored
@@ -102,7 +102,9 @@ jobs:
|
|||||||
htmlDirectory = pyProjectSettings["tool"]["coverage"]["html"]["directory"]
|
htmlDirectory = pyProjectSettings["tool"]["coverage"]["html"]["directory"]
|
||||||
xmlFile = pyProjectSettings["tool"]["coverage"]["xml"]["output"]
|
xmlFile = pyProjectSettings["tool"]["coverage"]["xml"]["output"]
|
||||||
else:
|
else:
|
||||||
print(f"File '{pyProjectFile}' not found and no ' .coveragerc' file specified.")
|
print(f"File '{pyProjectFile}' not found.")
|
||||||
|
print(f"::error title=FileNotFoundError::File '{pyProjectFile}' not found.")
|
||||||
|
exit(1)
|
||||||
|
|
||||||
# Read output paths from '.coveragerc' file
|
# Read output paths from '.coveragerc' file
|
||||||
elif len(coverageRC) > 0:
|
elif len(coverageRC) > 0:
|
||||||
@@ -115,6 +117,8 @@ jobs:
|
|||||||
xmlFile = coverageRCSettings["xml"]["output"]
|
xmlFile = coverageRCSettings["xml"]["output"]
|
||||||
else:
|
else:
|
||||||
print(f"File '{coverageRCFile}' not found.")
|
print(f"File '{coverageRCFile}' not found.")
|
||||||
|
print(f"::error title=FileNotFoundError::File '{coverageRCFile}' not found.")
|
||||||
|
exit(1)
|
||||||
|
|
||||||
# Write jobs to special file
|
# Write jobs to special file
|
||||||
github_output = Path(getenv("GITHUB_OUTPUT"))
|
github_output = Path(getenv("GITHUB_OUTPUT"))
|
||||||
|
|||||||
10
.github/workflows/PublishCoverageResults.yml
vendored
10
.github/workflows/PublishCoverageResults.yml
vendored
@@ -102,7 +102,9 @@ jobs:
|
|||||||
xmlFile = Path(pyProjectSettings["tool"]["coverage"]["xml"]["output"])
|
xmlFile = Path(pyProjectSettings["tool"]["coverage"]["xml"]["output"])
|
||||||
jsonFile = Path(pyProjectSettings["tool"]["coverage"]["json"]["output"])
|
jsonFile = Path(pyProjectSettings["tool"]["coverage"]["json"]["output"])
|
||||||
else:
|
else:
|
||||||
print(f"File '{pyProjectFile}' not found and no '.coveragerc' file specified.")
|
print(f"File '{pyProjectFile}' not found.")
|
||||||
|
print(f"::error title=FileNotFoundError::File '{pyProjectFile}' not found.")
|
||||||
|
exit(1)
|
||||||
|
|
||||||
# Read output paths from '.coveragerc' file
|
# Read output paths from '.coveragerc' file
|
||||||
elif len(coverageRC) > 0:
|
elif len(coverageRC) > 0:
|
||||||
@@ -116,6 +118,8 @@ jobs:
|
|||||||
jsonFile = Path(coverageRCSettings["json"]["output"])
|
jsonFile = Path(coverageRCSettings["json"]["output"])
|
||||||
else:
|
else:
|
||||||
print(f"File '{coverageRCFile}' not found.")
|
print(f"File '{coverageRCFile}' not found.")
|
||||||
|
print(f"::error title=FileNotFoundError::File '{coverageRCFile}' not found.")
|
||||||
|
exit(1)
|
||||||
|
|
||||||
# Write jobs to special file
|
# Write jobs to special file
|
||||||
github_output = Path(getenv("GITHUB_OUTPUT"))
|
github_output = Path(getenv("GITHUB_OUTPUT"))
|
||||||
@@ -131,8 +135,10 @@ jobs:
|
|||||||
|
|
||||||
- name: Rename .coverage files and collect them all to coverage/
|
- name: Rename .coverage files and collect them all to coverage/
|
||||||
run: |
|
run: |
|
||||||
|
ls -lAh artifacts/
|
||||||
|
ls -lAh artifacts/*/.coverage
|
||||||
mkdir -p coverage
|
mkdir -p coverage
|
||||||
find . -type f -path "*artifacts*SQLite*.coverage" -exec sh -c 'cp -v $0 "coverage/$(basename $0).$(basename $(dirname $0))"' {} ';'
|
find artifacts/ -type f -path "*SQLite*.coverage" -exec sh -c 'cp -v $0 "coverage/$(basename $0).$(basename $(dirname $0))"' {} ';'
|
||||||
tree -a coverage
|
tree -a coverage
|
||||||
|
|
||||||
- name: Combine SQLite files (using Coverage.py)
|
- name: Combine SQLite files (using Coverage.py)
|
||||||
|
|||||||
6
.github/workflows/SphinxDocumentation.yml
vendored
6
.github/workflows/SphinxDocumentation.yml
vendored
@@ -121,7 +121,9 @@ jobs:
|
|||||||
xmlFile = Path(pyProjectSettings["tool"]["coverage"]["xml"]["output"])
|
xmlFile = Path(pyProjectSettings["tool"]["coverage"]["xml"]["output"])
|
||||||
jsonFile = Path(pyProjectSettings["tool"]["coverage"]["json"]["output"])
|
jsonFile = Path(pyProjectSettings["tool"]["coverage"]["json"]["output"])
|
||||||
else:
|
else:
|
||||||
print(f"File '{pyProjectFile}' not found and no '.coveragerc' file specified.")
|
print(f"File '{pyProjectFile}' not found.")
|
||||||
|
print(f"::error title=FileNotFoundError::File '{pyProjectFile}' not found.")
|
||||||
|
exit(1)
|
||||||
|
|
||||||
# Read output paths from '.coveragerc' file
|
# Read output paths from '.coveragerc' file
|
||||||
elif len(coverageRC) > 0:
|
elif len(coverageRC) > 0:
|
||||||
@@ -135,6 +137,8 @@ jobs:
|
|||||||
jsonFile = Path(coverageRCSettings["json"]["output"])
|
jsonFile = Path(coverageRCSettings["json"]["output"])
|
||||||
else:
|
else:
|
||||||
print(f"File '{coverageRCFile}' not found.")
|
print(f"File '{coverageRCFile}' not found.")
|
||||||
|
print(f"::error title=FileNotFoundError::File '{coverageRCFile}' not found.")
|
||||||
|
exit(1)
|
||||||
|
|
||||||
# Write jobs to special file
|
# Write jobs to special file
|
||||||
github_output = Path(getenv("GITHUB_OUTPUT"))
|
github_output = Path(getenv("GITHUB_OUTPUT"))
|
||||||
|
|||||||
13
.github/workflows/UnitTesting.yml
vendored
13
.github/workflows/UnitTesting.yml
vendored
@@ -197,7 +197,11 @@ jobs:
|
|||||||
requirements = "${{ inputs.requirements }}"
|
requirements = "${{ inputs.requirements }}"
|
||||||
if requirements.startswith("-r"):
|
if requirements.startswith("-r"):
|
||||||
requirementsFile = Path(requirements[2:].lstrip())
|
requirementsFile = Path(requirements[2:].lstrip())
|
||||||
dependencies = loadRequirementsFile(requirementsFile)
|
try:
|
||||||
|
dependencies = loadRequirementsFile(requirementsFile)
|
||||||
|
except FileNotFoundError as ex:
|
||||||
|
print(f"::error title=FileNotFoundError::{ex}")
|
||||||
|
exit(1)
|
||||||
else:
|
else:
|
||||||
dependencies = [req.strip() for req in requirements.split(" ")]
|
dependencies = [req.strip() for req in requirements.split(" ")]
|
||||||
|
|
||||||
@@ -344,7 +348,9 @@ jobs:
|
|||||||
xmlFile = Path(pyProjectSettings["tool"]["coverage"]["xml"]["output"])
|
xmlFile = Path(pyProjectSettings["tool"]["coverage"]["xml"]["output"])
|
||||||
jsonFile = Path(pyProjectSettings["tool"]["coverage"]["json"]["output"])
|
jsonFile = Path(pyProjectSettings["tool"]["coverage"]["json"]["output"])
|
||||||
else:
|
else:
|
||||||
print(f"File '{pyProjectFile}' not found and no '.coveragerc' file specified.")
|
print(f"File '{pyProjectFile}' not found.")
|
||||||
|
print(f"::error title=FileNotFoundError::File '{pyProjectFile}' not found.")
|
||||||
|
exit(1)
|
||||||
|
|
||||||
# Read output paths from '.coveragerc' file
|
# Read output paths from '.coveragerc' file
|
||||||
elif len(coverageRC) > 0:
|
elif len(coverageRC) > 0:
|
||||||
@@ -358,6 +364,8 @@ jobs:
|
|||||||
jsonFile = Path(coverageRCSettings["json"]["output"])
|
jsonFile = Path(coverageRCSettings["json"]["output"])
|
||||||
else:
|
else:
|
||||||
print(f"File '{coverageRCFile}' not found.")
|
print(f"File '{coverageRCFile}' not found.")
|
||||||
|
print(f"::error title=FileNotFoundError::File '{coverageRCFile}' not found.")
|
||||||
|
exit(1)
|
||||||
|
|
||||||
# Write jobs to special file
|
# Write jobs to special file
|
||||||
github_output = Path(getenv("GITHUB_OUTPUT"))
|
github_output = Path(getenv("GITHUB_OUTPUT"))
|
||||||
@@ -452,6 +460,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: ${{ inputs.coverage_sqlite_artifact }}-${{ matrix.system }}-${{ matrix.runtime }}-${{ matrix.python }}
|
name: ${{ inputs.coverage_sqlite_artifact }}-${{ matrix.system }}-${{ matrix.runtime }}-${{ matrix.python }}
|
||||||
path: .coverage
|
path: .coverage
|
||||||
|
include-hidden-files: true
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,11 @@ def loadRequirementsFile(requirementsFile: Path):
|
|||||||
requirements = "-r ../tests/requirements.txt"
|
requirements = "-r ../tests/requirements.txt"
|
||||||
if requirements.startswith("-r"):
|
if requirements.startswith("-r"):
|
||||||
requirementsFile = Path(requirements[2:].lstrip())
|
requirementsFile = Path(requirements[2:].lstrip())
|
||||||
dependencies = loadRequirementsFile(requirementsFile)
|
try:
|
||||||
|
dependencies = loadRequirementsFile(requirementsFile)
|
||||||
|
except FileNotFoundError as ex:
|
||||||
|
print(f"::error title=FileNotFound::{ex}")
|
||||||
|
exit(1)
|
||||||
else:
|
else:
|
||||||
dependencies = [req.strip() for req in requirements.split(" ")]
|
dependencies = [req.strip() for req in requirements.split(" ")]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user