Skip to content

Commit

Permalink
feat: test result
Browse files Browse the repository at this point in the history
  • Loading branch information
arifBurakDemiray committed Sep 22, 2023
1 parent bb5b0c7 commit 6b1036f
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,24 @@ jobs:
- name: Build and Test with Gradle
run: ./gradlew build

- name: HTML Preview
id: html_preview
uses: pavi2410/html-preview-action@v2
- name: Upload Test Results
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
html_file: 'sdk-java/build/reports/tests/test/index.html'
name: test-results
path: sdk-java/build/reports/tests/

- name: Comment on PR with HTML Report Link
if: ${{ always() }}
uses: actions/github-script@v6
with:
script: |
const workspaceUrl = '${{ github.workspace }}/sdk-java/build/reports/tests/test/index.html'
const artifactLink = `<a href=${workspaceUrl}` target="_blank">HTML Test Report</a>`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Test report is available here: ${artifactLink}`,
});

0 comments on commit 6b1036f

Please sign in to comment.