Skip to content

Commit

Permalink
Upload and Check Integration test results (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
laeubi authored Sep 19, 2021
1 parent 8220d71 commit 43501b4
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 11 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Unit Test Results

on:
workflow_run:
workflows: ["Build Tycho"]
types:
- completed

jobs:
unit-test-results:
name: Unit Test Results
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion != 'skipped'

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 "$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 Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
with:
commit: ${{ github.event.workflow_run.head_sha }}
files: "artifacts/**/*.xml"
19 changes: 8 additions & 11 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,11 @@ jobs:
cp toolchains-gh.xml ~/.m2/toolchains.xml
mvn -U -V -e clean install --file pom.xml
- name: Run Integration Tests
run: mvn -U -V -e -Pits clean install --file tycho-its/pom.xml
# TODO add -Dmaven.test.failure.ignore=true if we have configured the Publish Integration Test Results below
# this currently will require additional setup see:
# https://github.com/marketplace/actions/publish-unit-test-results#support-fork-repositories-and-dependabot-branches
# - name: Publish Integration Test Results
# uses: EnricoMi/publish-unit-test-result-action@v1
# with:
# files: |
# 'tycho-its/target/surefire-reports/*.xml'


run: mvn -U -V -e -Pits -Dmaven.test.failure.ignore=true clean install --file tycho-its/pom.xml
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v2
with:
name: Integration Test Results
path: |
'tycho-its/target/surefire-reports/*.xml'

0 comments on commit 43501b4

Please sign in to comment.