Skip to content

Commit

Permalink
component-test - simplify error message
Browse files Browse the repository at this point in the history
  • Loading branch information
essobedo committed May 31, 2023
1 parent 64f76e9 commit 0287c52
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 32 deletions.
33 changes: 3 additions & 30 deletions .github/actions/component-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,39 +77,12 @@ runs:
with:
github-token: ${{ inputs.github-token }}
script: |
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{ inputs.run-id }}
});
console.log("########")
console.log(artifacts)
console.log(artifacts.data)
console.log(artifacts.data.artifacts)
for (int i = 0; i < 30 && artifacts.data.artifacts.length == 0; i++) {
console.log("No artifacts yet, let's try again")
await setTimeout(1000);
artifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{ inputs.run-id }}
});
console.log("########")
console.log(artifacts)
console.log(artifacts.data)
console.log(artifacts.data.artifacts)
}
**Result** :x: The tests failed please check the logs below:
`
for (const artifact in artifacts.data.artifacts) {
message += `* [*${artifact.name}*](${artifact.url})
`
}
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ inputs.pr-id }},
comment_id: ${{ inputs.comment-id }},
body: message
body: `${{ inputs.comment-body }}
**Result** :x: The tests failed please [check the logs](https://github.com/apache/camel/actions/runs/${{ inputs.run-id }})`
});
4 changes: 2 additions & 2 deletions .github/actions/component-test/component-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ function main() {

if [[ ${fastBuild} = "true" ]] ; then
echo "Launching a fast build against the projects ${pl} and their dependencies"
$mavenBinary -l $log -Pfastinstall installo -pl "$pl" -am
$mavenBinary -l $log -Pfastinstall install -pl "$pl" -am
else
echo "Launching tests of the projects ${pl}"
$mavenBinary -l $log installo -pl "$pl"
$mavenBinary -l $log install -pl "$pl"
fi
}

Expand Down

0 comments on commit 0287c52

Please sign in to comment.