Skip to content

Commit

Permalink
Workaround to allow checks run against forked repos
Browse files Browse the repository at this point in the history
  • Loading branch information
greens committed Apr 28, 2023
1 parent 17cebc2 commit 4ab1090
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 9 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/publish-test-results.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish test results
on:
workflow_run:
workflows: [Run driver tests]
types:
- completed

jobs:
publish-test-results:
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: dawidd6/action-download-artifact@v2
with:
workflow: run-tests.yml
run_id: ${{ github.event.workflow_run.id }}
- run: echo "pr_number=$(cat pr_number/pr_number.txt)" >> $GITHUB_ENV
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v1
with:
commit: ${{ github.event.workflow_run.head_sha }}
event_file: event-file/event.json
event_name: ${{ github.event.workflow_run.event }}
files: "tests/*.xml"
- name: Publish coverage results
uses: 5monkeys/cobertura-action@master
with:
pull_request_number: ${{ env.pr_number }}
path: "coverage/*.xml"
minimum_coverage: 90
34 changes: 27 additions & 7 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,33 @@ jobs:
run: python tools/run_driver_tests_p.py ${{ steps.changed-drivers.outputs.all_modified_files }}
env:
LUA_PATH: ${{ steps.lua_path.outputs.lua_path }}
- name: Check code coverage
uses: 5monkeys/cobertura-action@master
- name: Upload test artifact
if: always()
uses: actions/upload-artifact@v3
with:
path: tools/coverage_output/*_coverage.xml
minimum_coverage: 90
- name: Publish Test Results
name: tests
path: |
tools/test_output/*.xml
- name: Upload coverage artifact
if: always()
uses: EnricoMi/publish-unit-test-result-action@v2
uses: actions/upload-artifact@v3
with:
name: coverage
path: |
tools/coverage_output/*_coverage.xml
event-file:
runs-on: ubuntu-latest
steps:
- name: Upload event file artifact
uses: actions/upload-artifact@v2
with:
name: event-file
path: ${{ github.event_path }}
- run: echo ${{ github.event.number }} > pr_number.txt
- name: Upload pr number artifact
uses: actions/upload-artifact@v3
with:
junit_files: "tools/test_output/*.xml"
name: pr_number
path: |
pr_number.txt
4 changes: 2 additions & 2 deletions .github/workflows/upload-driver-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- run: echo ${{ github.event.number }} > pr_number.txt
- name: Upload packaged driver artifact
- name: Upload pr number artifact
uses: actions/upload-artifact@v3
with:
name: pr_number
path: |
pr_number.txt
- run: echo ${{ github.head_ref }} > head_ref.txt
- name: Upload packaged driver artifact
- name: Upload head ref artifact
uses: actions/upload-artifact@v3
with:
name: head_ref
Expand Down

0 comments on commit 4ab1090

Please sign in to comment.