Converge on same comments and behaviours for forks and cancelled runs.

This commit is contained in:
Stefan Ceriu
2025-12-16 09:18:57 +02:00
committed by Stefan Ceriu
parent 5224fd0818
commit 45aec9d006
3 changed files with 28 additions and 9 deletions
+8 -3
View File
@@ -40,7 +40,7 @@ jobs:
- name: Run tests
run: bundle exec fastlane unit_tests
- name: Zip results # for faster upload
- name: Zip results # Faster uploads
if: failure()
working-directory: fastlane/test_output
run: zip -r UnitTests.zip UnitTests.xcresult PreviewTests.xcresult
@@ -56,12 +56,15 @@ jobs:
if-no-files-found: ignore
- name: Collect coverage
# Skip if cancelled and in forks
if: ${{ !cancelled() && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}
run: |
xcresultparser -q -o cobertura -t ElementX -p $(pwd) fastlane/test_output/UnitTests.xcresult > fastlane/test_output/unit-cobertura.xml
xcresultparser -q -o cobertura -t ElementX -p $(pwd) fastlane/test_output/PreviewTests.xcresult > fastlane/test_output/preview-cobertura.xml
- name: Upload coverage to Codecov
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} # Skip in forks
# Skip if cancelled and in forks
if: ${{ !cancelled() && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}
uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457 # v3.1.6
with:
report_type: coverage
@@ -70,12 +73,14 @@ jobs:
flags: unittests
- name: Collect test results
if: ${{ !cancelled() }}
# Skip if cancelled and in forks
if: ${{ !cancelled() && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}
run: |
xcresultparser -q -o junit -p $(pwd) fastlane/test_output/UnitTests.xcresult > fastlane/test_output/unit-junit.xml
xcresultparser -q -o junit -p $(pwd) fastlane/test_output/PreviewTests.xcresult > fastlane/test_output/preview-junit.xml
- name: Upload test results to Codecov
# Skip if cancelled and in forks
if: ${{ !cancelled() && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}
uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457 # v3.1.6
continue-on-error: true