From 3b53de5968ea4fe10de48119e1aa936e80718d25 Mon Sep 17 00:00:00 2001 From: Richard Piazza Date: Sun, 14 Dec 2025 15:04:35 -0600 Subject: [PATCH 1/6] Code Coverage & Test Results --- .github/workflows/swift.yml | 50 +++++++++++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 2bf3d8b..177080d 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -6,6 +6,9 @@ on: pull_request: branches: [ main ] +env: + PACKAGE_NAME: 'SessionPlus' + jobs: SwiftLang: @@ -21,11 +24,6 @@ jobs: - name: Checkout uses: actions/checkout@v6 - - name: Lint - if: ${{ runner.os == 'macOS' }} - shell: bash - run: swiftformat --lint . --reporter github-actions-log - - name: Package Resolution shell: bash run: swift package resolve @@ -34,7 +32,45 @@ jobs: shell: bash run: swift build - - name: Test + - name: Test (Linux) + if: ${{ runner.os == 'Linux' }} shell: bash run: swift test - \ No newline at end of file + + - name: Test (macOS) + if: ${{ runner.os == 'macOS' }} + shell: bash + run: swift test --enable-code-coverage -v 2>&1 | xcbeautify --report junit + + - name: Lint + if: ${{ runner.os == 'macOS' }} + shell: bash + run: swiftformat --lint . --reporter github-actions-log + + - name: Export Code Coverage + if: ${{ runner.os == 'macOS' }} + shell: bash + run: xcrun llvm-cov export -format="lcov" .build/debug/${{ env.PACKAGE_NAME }}PackageTests.xctest/Contents/MacOS/${{ env.PACKAGE_NAME }}PackageTests -instr-profile .build/debug/codecov/default.profdata > build/reports/coverage.lcov + + - name: Collect Reports + if: ${{ runner.os == 'macOS' }} + uses: actions/upload-artifact@v6 + with: + name: reports + path: | + build/reports/junit.xml + build/reports/coverage.lcov + retention-days: 7 + + - name: Publish Test Results + if: ${{ runner.os == 'macOS' }} + uses: EnricoMi/publish-unit-test-result-action/macos@v2 + with: + files: build/reports/junit.xml + + - name: Publish Coverage Results + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: | + build/reports/coverage.lcov From 3c733954c63be12a9699c901c3271e3e43d3ae74 Mon Sep 17 00:00:00 2001 From: Richard Piazza Date: Sun, 14 Dec 2025 15:10:45 -0600 Subject: [PATCH 2/6] Test CodeCov Test Results Action --- .github/workflows/swift.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 177080d..a41cc86 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -62,11 +62,18 @@ jobs: build/reports/coverage.lcov retention-days: 7 +# - name: Publish Test Results +# if: ${{ runner.os == 'macOS' }} +# uses: EnricoMi/publish-unit-test-result-action/macos@v2 +# with: +# files: build/reports/junit.xml + - name: Publish Test Results - if: ${{ runner.os == 'macOS' }} - uses: EnricoMi/publish-unit-test-result-action/macos@v2 + uses: codecov/test-results-action@v1 with: - files: build/reports/junit.xml + token: $[{ secrets.CODECOV_TOKEN }} + files: | + build/reports/junit.xml - name: Publish Coverage Results uses: codecov/codecov-action@v5 From c22b3e16923c6343f2a12cccb16f971475f87281 Mon Sep 17 00:00:00 2001 From: Richard Piazza Date: Sun, 14 Dec 2025 15:15:14 -0600 Subject: [PATCH 3/6] Utilize non-deprecated action --- .github/workflows/swift.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index a41cc86..db7ec61 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -69,9 +69,10 @@ jobs: # files: build/reports/junit.xml - name: Publish Test Results - uses: codecov/test-results-action@v1 + uses: codecov/codecov-action@v5 with: token: $[{ secrets.CODECOV_TOKEN }} + report-type: test_results files: | build/reports/junit.xml From 96cdd3cf8e2e1d268895a018cd71ab3a5085cf6e Mon Sep 17 00:00:00 2001 From: Richard Piazza Date: Sun, 14 Dec 2025 15:17:32 -0600 Subject: [PATCH 4/6] Limit coverage actions to 'macOS' runners --- .github/workflows/swift.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index db7ec61..bcfaea3 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -69,6 +69,7 @@ jobs: # files: build/reports/junit.xml - name: Publish Test Results + if: ${{ runner.os == 'macOS' }} uses: codecov/codecov-action@v5 with: token: $[{ secrets.CODECOV_TOKEN }} @@ -77,6 +78,7 @@ jobs: build/reports/junit.xml - name: Publish Coverage Results + if: ${{ runner.os == 'macOS' }} uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} From b0eda097a3dde673614bec33930dae134d269c4c Mon Sep 17 00:00:00 2001 From: Richard Piazza Date: Sun, 14 Dec 2025 15:21:36 -0600 Subject: [PATCH 5/6] Corrected action parameter name --- .github/workflows/swift.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index bcfaea3..8469d2b 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -73,7 +73,7 @@ jobs: uses: codecov/codecov-action@v5 with: token: $[{ secrets.CODECOV_TOKEN }} - report-type: test_results + report_type: test_results files: | build/reports/junit.xml From 8e895390cfe797454efd1235e2f1119a3b8aecb0 Mon Sep 17 00:00:00 2001 From: Richard Piazza Date: Sun, 14 Dec 2025 15:25:15 -0600 Subject: [PATCH 6/6] Revert to working action --- .github/workflows/swift.yml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 8469d2b..8475ec2 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -62,25 +62,23 @@ jobs: build/reports/coverage.lcov retention-days: 7 + - name: Publish Test Results + if: ${{ runner.os == 'macOS' }} + uses: EnricoMi/publish-unit-test-result-action/macos@v2 + with: + files: build/reports/junit.xml + # - name: Publish Test Results # if: ${{ runner.os == 'macOS' }} -# uses: EnricoMi/publish-unit-test-result-action/macos@v2 +# uses: codecov/codecov-action@v5 # with: +# token: $[{ secrets.CODECOV_TOKEN }} +# report_type: test_results # files: build/reports/junit.xml - - name: Publish Test Results - if: ${{ runner.os == 'macOS' }} - uses: codecov/codecov-action@v5 - with: - token: $[{ secrets.CODECOV_TOKEN }} - report_type: test_results - files: | - build/reports/junit.xml - - name: Publish Coverage Results if: ${{ runner.os == 'macOS' }} uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} - files: | - build/reports/coverage.lcov + files: build/reports/coverage.lcov