Skip to content

Commit

Permalink
Add fork repositories support for regression tests report
Browse files Browse the repository at this point in the history
  • Loading branch information
makz00 committed Nov 10, 2023
1 parent 99f3749 commit c8f7fa3
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 6 deletions.
28 changes: 22 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ on:
workflow_dispatch:

jobs:
event_file:
name: Event file
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v3
with:
name: Event File
path: ${{ github.event_path }}

build-regression-tests:
name: Build regression tests
runs-on: ubuntu-latest
Expand Down Expand Up @@ -68,12 +78,18 @@ jobs:
. venv/bin/activate
scripts/run_tests.py -a regression
- name: Test Report
uses: EnricoMi/publish-unit-test-result-action@v2
# - name: Test Report
# uses: EnricoMi/publish-unit-test-result-action@v2
# with:
# files: test/regression/cocotb/results.xml
# check_name: cocotb test results
# comment_mode: off

- name: Upload tests results
uses: actions/upload-artifact@v3
with:
files: test/regression/cocotb/results.xml
check_name: cocotb test results
comment_mode: off
name: Tests results
path: test/regression/cocotb/results.xml

unit-test:
name: Run unit tests
Expand Down Expand Up @@ -102,7 +118,7 @@ jobs:
run: ./scripts/run_tests.py --verbose

- name: Check traces
run: ./scripts/run_tests.py -t -c 1 TestCore
run: ./scripts/run_tests.py -t -c 1 TestCore

lint:
name: Check code formatting and typing
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/tests_results.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Tests results

on:
workflow_run:
workflows: ["CI"]
types:
- completed
permissions: {}

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

permissions:
checks: write

# needed unless run with comment_mode: off
pull-requests: write

# only needed for private repository
contents: read

# only needed for private repository
issues: read

# required by download step to access artifacts API
actions: read

steps:
- name: Download and Extract Artifacts
uses: dawidd6/action-download-artifact@246dbf436b23d7c49e21a7ab8204ca9ecd1fe615
with:
run_id: ${{ github.event.workflow_run.id }}
path: artifacts

- name: Publish tests 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: test/regression/cocotb/results.xml

0 comments on commit c8f7fa3

Please sign in to comment.