Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DD4hep
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cepc
externals
mirroring
DD4hep
Commits
f00165dd
Commit
f00165dd
authored
1 year ago
by
Andre Sailer
Browse files
Options
Downloads
Patches
Plain Diff
CI: adding test result upload
parent
039aaadd
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.github/workflows/linux.yml
+59
-6
59 additions, 6 deletions
.github/workflows/linux.yml
.github/workflows/test-result-comment.yml
+46
-0
46 additions, 0 deletions
.github/workflows/test-result-comment.yml
with
105 additions
and
6 deletions
.github/workflows/linux.yml
+
59
−
6
View file @
f00165dd
...
...
@@ -45,7 +45,7 @@ jobs:
ninja install
. ../bin/thisdd4hep.sh
echo "::group::Test"
ctest --output-on-failure -j4
ctest --output-on-failure -j4
--output-junit TestResults_1.xml
echo "::group::CMakeExamples"
cd ../examples/
mkdir build
...
...
@@ -57,7 +57,21 @@ jobs:
echo "::group::CompileExamples"
ninja install
echo "::group::TestExamples"
ctest --output-on-failure -j2
ctest --output-on-failure -j2 --output-junit TestResults_2.xml
-
name
:
Prepare Artifact Name
if
:
success() || failure()
run
:
|
artifact_name="${{ matrix.LCG }}"
artifact_name=$(echo -n "${artifact_name}" | sed -e 's@/@@g')
echo "ARTIFACT_NAME=${artifact_name}" >> $GITHUB_ENV
-
name
:
Upload test results
if
:
success() || failure()
uses
:
actions/upload-artifact@v3
with
:
name
:
Test Results ${{ env.ARTIFACT_NAME }}
path
:
|
/home/runner/work/DD4hep/DD4hep/build/TestResults_1.xml
/home/runner/work/DD4hep/DD4hep/examples/build/TestResults_2.xml
key4hep
:
...
...
@@ -97,7 +111,7 @@ jobs:
ninja install
. ../bin/thisdd4hep.sh
echo "::group::Test"
ctest --output-on-failure -j4
ctest --output-on-failure -j4
--output-junit TestResults_1.xml
echo "::group::CMakeExamples"
cd ../examples/
mkdir build
...
...
@@ -109,7 +123,21 @@ jobs:
echo "::group::CompileExamples"
ninja install
echo "::group::TestExamples"
ctest --output-on-failure -j2
ctest --output-on-failure -j2 --output-junit TestResults_2.xml
-
name
:
Prepare Artifact Name
if
:
success() || failure()
run
:
|
artifact_name="${{ matrix.LCG }}"
artifact_name=$(echo -n "${artifact_name}" | sed -e 's@/@@g')
echo "ARTIFACT_NAME=${artifact_name}" >> $GITHUB_ENV
-
name
:
Upload test results
if
:
success() || failure()
uses
:
actions/upload-artifact@v3
with
:
name
:
Test Results ${{ env.ARTIFACT_NAME }}
path
:
|
/home/runner/work/DD4hep/DD4hep/build/TestResults_1.xml
/home/runner/work/DD4hep/DD4hep/examples/build/TestResults_2.xml
non-shared
:
runs-on
:
ubuntu-latest
...
...
@@ -182,7 +210,7 @@ jobs:
ninja install
. ../bin/thisdd4hep.sh
echo "::group::Test"
ctest --output-on-failure -j4
ctest --output-on-failure -j4
--output-junit TestResults_1.xml
echo "::group::CMakeExamples"
cd ../examples/
mkdir build
...
...
@@ -194,4 +222,29 @@ jobs:
echo "::group::CompileExamples"
ninja install
echo "::group::TestExamples"
ctest --output-on-failure -j2
ctest --output-on-failure -j2 --output-junit TestResults_2.xml
-
name
:
Prepare Artifact Name
if
:
success() || failure()
run
:
|
artifact_name="${{ matrix.LCG }}"
artifact_name=$(echo -n "${artifact_name}" | sed -e 's@/@@g')
echo "ARTIFACT_NAME=${artifact_name}" >> $GITHUB_ENV
-
name
:
Upload test results
if
:
success() || failure()
uses
:
actions/upload-artifact@v3
with
:
name
:
Test Results ${{ env.ARTIFACT_NAME }}
path
:
|
/home/runner/work/DD4hep/DD4hep/build/TestResults_1.xml
/home/runner/work/DD4hep/DD4hep/examples/build/TestResults_2.xml
event_file
:
if
:
github.repository_owner == 'aidasoft' || github.event_name == 'pull_request'
name
:
"
Upload
Event
Payload"
runs-on
:
ubuntu-latest
steps
:
-
name
:
Upload
uses
:
actions/upload-artifact@v3
with
:
name
:
Event File
path
:
${{ github.event_path }}
This diff is collapsed.
Click to expand it.
.github/workflows/test-result-comment.yml
0 → 100644
+
46
−
0
View file @
f00165dd
name
:
Test Summary PR comment
on
:
workflow_run
:
# do NOT use quotes: https://stackoverflow.com/a/72551795/17876693
workflows
:
[
linux
]
types
:
-
completed
permissions
:
{}
jobs
:
comment-test-results
:
name
:
Publish Test Results
if
:
github.event.workflow_run.event == 'pull_request'
runs-on
:
ubuntu-latest
permissions
:
checks
:
write
pull-requests
:
write
actions
:
read
steps
:
-
name
:
Download and Extract Artifacts
env
:
GITHUB_TOKEN
:
${{ secrets.GITHUB_TOKEN }}
run
:
|
mkdir -p artifacts && cd artifacts
artifacts_url=${{ github.event.workflow_run.artifacts_url }}
gh api --paginate "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while read artifact
do
IFS=$'\t' read name url <<< "$artifact"
gh api $url > "$name.zip"
unzip -d "$name" "$name.zip"
done
-
name
:
Publish Test Results
uses
:
EnricoMi/publish-unit-test-result-action@v2
with
:
commit
:
${{ github.event.workflow_run.head_sha }}
event_file
:
artifacts/Event File/event.json
event_name
:
${{ github.event.workflow_run.event }}
files
:
"
artifacts/**/*.xml"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment