Skip to content

Commit 8c13059

Browse files
authored
Avoid to create a Check Run on PRs
Avoid to create a Check Run on PRs
2 parents 9d78e23 + 17501c3 commit 8c13059

1 file changed

Lines changed: 17 additions & 12 deletions

File tree

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
name: Compile - Run - Report
1+
name: Compile - Run - Report
22
on:
3-
workflow_dispatch:
3+
workflow_dispatch:
44
pull_request:
55
branches: [main]
66
push:
77
branches: [main]
88
schedule:
99
- cron: '30 22 * * 0' # Run every Sunday at 22:30
1010

11-
permissions:
11+
permissions:
1212
contents: read
1313
actions: read
1414
checks: write
@@ -26,38 +26,43 @@ jobs:
2626
uses: actions/setup-python@v6
2727
with:
2828
python-version: '3.13'
29-
- run:
29+
30+
- name: Install Python packages
31+
run:
3032
pip install junit_reporter
31-
33+
3234
# Install vcpkg tools from the vcpkg-configuration.json and activate an Arm tools license
3335
- name: Activate vcpkg
3436
uses: ARM-software/cmsis-actions/vcpkg@v1
3537

3638
- name: Activate Arm tool license
3739
uses: ARM-software/cmsis-actions/armlm@v1
38-
39-
# Build the project, run the test and convert the log to junit format
40+
4041
- name: Build
4142
run: |
4243
echo "Building get started example ..."
43-
cbuild get_started.csolution.yml --packs --update-rte --context .debug+avh
44+
cbuild get_started.csolution.yml --packs --update-rte --context .debug+avh
4445
4546
- name: Execute
4647
run: |
4748
echo "Running get started example ..."
4849
FVP_MPS2_Cortex-M3 --simlimit 10 -f Project/fvp_config.txt -a out/Project/avh/debug/Project.axf | tee Project.avh.log
4950
5051
- name: Convert log to junit
52+
if: success() || failure()
5153
run: |
5254
echo "Converting log to junit..."
5355
python Project/report.py Project.avh.log
5456
cat Project.avh.xml
55-
57+
5658
# Upload the junit report to the check run of the workflow
5759
- name: Test Report
5860
uses: phoenix-actions/test-reporting@v16
5961
if: success() || failure() # run this step even if previous step failed
6062
with:
61-
name: Test Report # Name of the check run which will be created
62-
path: Project.avh.xml # Path to test results
63-
reporter: jest-junit # Format of test results
63+
name: Test Report # Name of the check run which will be created
64+
path: Project.avh.xml # Path to test results
65+
reporter: jest-junit # Format of test results
66+
# This keeps one workflow and avoids creating a Check Run on PRs, where fork tokens may be read-only.
67+
# After merge / push to main, it still creates the Check Run.
68+
output-to: ${{ github.event_name == 'pull_request' && 'step-summary' || 'checks' }}

0 commit comments

Comments
 (0)