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 cc88353384
commit 16b5f7adca
3 changed files with 28 additions and 9 deletions

View File

@@ -47,13 +47,14 @@ jobs:
- name: Check logs don't contain private messages - name: Check logs don't contain private messages
run: "! grep 'Go down in flames' /Users/Shared -R" run: "! grep 'Go down in flames' /Users/Shared -R"
- name: Zip results # for faster upload - name: Zip results # Faster upload
if: failure() if: failure()
working-directory: fastlane/test_output working-directory: fastlane/test_output
run: zip -r IntegrationTests.xcresult.zip IntegrationTests.xcresult run: zip -r IntegrationTests.xcresult.zip IntegrationTests.xcresult
- name: Archive artifacts - name: Archive artifacts
uses: actions/upload-artifact@v6 uses: actions/upload-artifact@v6
# We only care about artefacts if the tests fail
if: failure() if: failure()
with: with:
name: Results name: Results
@@ -71,9 +72,13 @@ jobs:
if-no-files-found: ignore if-no-files-found: ignore
- name: Collect coverage - 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/IntegrationTests.xcresult > fastlane/test_output/integration-cobertura.xml run: xcresultparser -q -o cobertura -t ElementX -p $(pwd) fastlane/test_output/IntegrationTests.xcresult > fastlane/test_output/integration-cobertura.xml
- name: Upload coverage to Codecov - name: Upload coverage 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 uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457 # v3.1.6
with: with:
report_type: coverage report_type: coverage
@@ -82,11 +87,13 @@ jobs:
flags: integrationtests flags: integrationtests
- name: Collect test results - 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/IntegrationTests.xcresult > fastlane/test_output/integration-junit.xml run: xcresultparser -q -o junit -p $(pwd) fastlane/test_output/IntegrationTests.xcresult > fastlane/test_output/integration-junit.xml
- name: Upload test results to Codecov - name: Upload test results to Codecov
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) }}
uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457 # v3.1.6 uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457 # v3.1.6
continue-on-error: true continue-on-error: true
with: with:

View File

@@ -46,13 +46,14 @@ jobs:
bundle exec fastlane ui_tests device:${{ matrix.device }} test_name:${{ github.event.inputs.test_name }} bundle exec fastlane ui_tests device:${{ matrix.device }} test_name:${{ github.event.inputs.test_name }}
fi fi
- name: Zip results # for faster upload - name: Zip results # Faster uploads
if: failure() if: failure()
working-directory: fastlane/test_output working-directory: fastlane/test_output
run: zip -r UITests.xcresult.zip UITests.xcresult run: zip -r UITests.xcresult.zip UITests.xcresult
- name: Archive artifacts - name: Archive artifacts
uses: actions/upload-artifact@v6 uses: actions/upload-artifact@v6
# We only care about artefacts if the tests fail
if: failure() if: failure()
with: with:
name: ${{ matrix.device }} name: ${{ matrix.device }}
@@ -61,9 +62,13 @@ jobs:
if-no-files-found: ignore if-no-files-found: ignore
- name: Collect coverage - 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/UITests.xcresult > fastlane/test_output/ui-cobertura.xml run: xcresultparser -q -o cobertura -t ElementX -p $(pwd) fastlane/test_output/UITests.xcresult > fastlane/test_output/ui-cobertura.xml
- name: Upload coverage to Codecov - name: Upload coverage 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 uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457 # v3.1.6
with: with:
report_type: coverage report_type: coverage
@@ -72,11 +77,13 @@ jobs:
flags: uitests flags: uitests
- name: Collect test results - 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/UITests.xcresult > fastlane/test_output/ui-junit.xml run: xcresultparser -q -o junit -p $(pwd) fastlane/test_output/UITests.xcresult > fastlane/test_output/ui-junit.xml
- name: Upload test results to Codecov - name: Upload test results to Codecov
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) }}
uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457 # v3.1.6 uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457 # v3.1.6
continue-on-error: true continue-on-error: true
with: with:

View File

@@ -40,7 +40,7 @@ jobs:
- name: Run tests - name: Run tests
run: bundle exec fastlane unit_tests run: bundle exec fastlane unit_tests
- name: Zip results # for faster upload - name: Zip results # Faster uploads
if: failure() if: failure()
working-directory: fastlane/test_output working-directory: fastlane/test_output
run: zip -r UnitTests.zip UnitTests.xcresult PreviewTests.xcresult run: zip -r UnitTests.zip UnitTests.xcresult PreviewTests.xcresult
@@ -56,12 +56,15 @@ jobs:
if-no-files-found: ignore if-no-files-found: ignore
- name: Collect coverage - 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: | 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/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 xcresultparser -q -o cobertura -t ElementX -p $(pwd) fastlane/test_output/PreviewTests.xcresult > fastlane/test_output/preview-cobertura.xml
- name: Upload coverage to Codecov - 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 uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457 # v3.1.6
with: with:
report_type: coverage report_type: coverage
@@ -70,12 +73,14 @@ jobs:
flags: unittests flags: unittests
- name: Collect test results - 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: | 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/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 xcresultparser -q -o junit -p $(pwd) fastlane/test_output/PreviewTests.xcresult > fastlane/test_output/preview-junit.xml
- name: Upload test results to Codecov - 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) }} 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 uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457 # v3.1.6
continue-on-error: true continue-on-error: true