Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
fdbd26e
[MOB-11000] Add xcresulttool to workflow steps
sumeruchat Mar 14, 2025
80a27ec
[MOB-11000] Add xcresulttool to e2e workflow
sumeruchat Mar 14, 2025
ee803be
[MOB-11000] Update xcresulttool to main branch
sumeruchat Mar 14, 2025
2c8c8ef
[MOB-11000] Add process_xcresult.py script
sumeruchat Mar 18, 2025
e5ff484
[MOB-11000] Add Python setup & test result processing
sumeruchat Mar 18, 2025
67e202d
[MOB-11000] Add markdown summary to test report
sumeruchat Mar 18, 2025
2a42303
[MOB-11000] Fix test failure count calculation
sumeruchat Mar 18, 2025
253cb60
[MOB-11000] Set conclusion based on test results
sumeruchat Mar 18, 2025
f114897
[MOB-11000] Refactor test result processing in CI
sumeruchat Mar 18, 2025
8f25746
[MOB-11000] Skip tests in swift-sdk.xctestplan
sumeruchat Mar 18, 2025
5547e01
[MOB-11000] Add Markdown report generation to test results.
sumeruchat Mar 18, 2025
c63b425
[MOB-11000] Add multiple paths to upload-artifact
sumeruchat Mar 18, 2025
77b1c5d
[MOB-11000] Remove redundant steps from e2e workflow
sumeruchat Mar 24, 2025
c8dbe65
Cleanup
sumeruchat Mar 24, 2025
5f338c6
Cleanup
sumeruchat Mar 24, 2025
2a0760f
Fixes
sumeruchat Mar 24, 2025
f8dbd3e
[MOB-11000] Refactor GitHub Actions test report logic
sumeruchat Mar 24, 2025
db34b87
[MOB-11000] Remove test-output/ from .gitignore
sumeruchat Mar 24, 2025
f6c7cb5
[MOB-11000] Remove redundant job summary step
sumeruchat Mar 24, 2025
7b25048
Fixes
sumeruchat Mar 24, 2025
a32ab23
[MOB-11000] Fix typo in workflow: 'Unit Test Results'
sumeruchat Mar 24, 2025
193d28c
[MOB-11000] Strip HTML tags from test summaries
sumeruchat Mar 24, 2025
07e232c
[MOB-11000] Fix build-and-test workflow issues
sumeruchat Mar 25, 2025
0ecd900
[MOB-11000] Remove unused styles and comments
sumeruchat Mar 25, 2025
bf5930e
[MOB-11000] Fix path in build-and-test workflow
sumeruchat Mar 25, 2025
e905ff8
[MOB-11000] Remove redundant <title> tags in HTML output
sumeruchat Mar 25, 2025
2495205
[MOB-11000] Remove duplicate result path display
sumeruchat Mar 25, 2025
7efd1f9
[MOB-11000] Add test plan support to CI workflow
sumeruchat Mar 25, 2025
1bbcdd5
[MOB-11000] Reduce skipped tests in xctestplan
sumeruchat Mar 25, 2025
19ced18
[MOB-11000] Fix test data file paths in MyTests.xcresult
sumeruchat Mar 25, 2025
29f02d1
[MOB-11000] Add skipped tests count to workflow summary
sumeruchat Mar 25, 2025
47ebbd7
[MOB-11000] Uncomment CI steps & improve coverage display
sumeruchat Mar 25, 2025
3017aac
[MOB-11000] Comment out build and test step
sumeruchat Mar 25, 2025
8a510b7
[MOB-11000] Fix build-and-test workflow in GitHub Actions
sumeruchat Mar 25, 2025
0a1d3f7
[MOB-11000] Remove unused 'jq' installation step
sumeruchat Mar 25, 2025
4c14169
[MOB-11000] Add branch and commit info to Codecov upload
sumeruchat Mar 25, 2025
510b8f3
[MOB-11000] Make file paths relative in process_xcresult.py
sumeruchat Mar 25, 2025
9ec8e3b
[MOB-11000] Fix GitHub URL in coverage report links
sumeruchat Mar 25, 2025
c4fb494
[MOB-11000] Add commit SHA to GitHub URLs in test reports
sumeruchat Mar 25, 2025
a80906d
fix
sumeruchat Mar 25, 2025
7823ba0
fix
sumeruchat Mar 25, 2025
2a55bfa
fix
sumeruchat Mar 25, 2025
720adb9
fix
sumeruchat Mar 25, 2025
6d8bccf
fix
sumeruchat Mar 25, 2025
2cfd157
fix
sumeruchat Mar 25, 2025
a3b58bb
fix
sumeruchat Mar 25, 2025
ba45da5
fix
sumeruchat Mar 25, 2025
a1940be
Fix: Convert all directory names to lowercase
sumeruchat Mar 25, 2025
8eef24b
Fix: Convert all directory names to lowercase
sumeruchat Mar 25, 2025
a2d4eea
Fix: Convert all directory names to lowercase
sumeruchat Mar 25, 2025
d3bde77
Fix
sumeruchat Mar 26, 2025
bee6782
fix
sumeruchat Mar 26, 2025
9556f7a
Fix
sumeruchat Mar 26, 2025
a9f4323
Fix
sumeruchat Mar 26, 2025
3a6af91
Fix
sumeruchat Mar 26, 2025
3f33544
Fix
sumeruchat Mar 26, 2025
4f79e82
Fix
sumeruchat Mar 26, 2025
ba15bc1
Fix
sumeruchat Mar 26, 2025
3fdbc53
Fix
sumeruchat Mar 26, 2025
bfd3258
Fix
sumeruchat Mar 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 80 additions & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ jobs:
with:
xcode-version: latest-stable

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Setup Ruby and xcpretty
run: |
gem install erb
Expand All @@ -25,8 +30,82 @@ jobs:
run: |
xcodebuild test -project swift-sdk.xcodeproj -scheme swift-sdk -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 16 Pro,OS=18.2' -enableCodeCoverage YES -resultBundlePath TestResults.xcresult CODE_SIGNING_REQUIRED=NO | xcpretty && exit ${PIPESTATUS[0]}

- name: Process test results
run: |
python3 scripts/process_xcresult.py --path TestResults.xcresult --test-output test-results.html --coverage-output coverage-results.html --test-plan tests/swift-sdk.xctestplan --summary-json test-summary.json --commit-sha ${{ github.sha }}
if: success() || failure()

- name: Create Test Report Check
uses: actions/github-script@v7
if: success() || failure()
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require('fs');

// Read the test results and coverage reports
let testReport = "";
let coverageReport = "";

try {
testReport = fs.readFileSync("test-results.html", 'utf8');
coverageReport = fs.readFileSync("coverage-results.html", 'utf8');
} catch (error) {
core.warning(`Error reading report files: ${error.message}`);
}

// Read test summary
let testStats = {
total_tests: 0,
passed_tests: 0,
failed_tests: 0,
success_rate: 0
};

try {
const summaryJson = fs.readFileSync("test-summary.json", 'utf8');
testStats = JSON.parse(summaryJson);

// Generate simple markdown summary
fs.writeFileSync("report-summary.md",
`# Test Results\n\n` +
`- Total: ${testStats.total_tests}\n` +
`- Passed: ${testStats.passed_tests}\n` +
`- Failed: ${testStats.failed_tests}\n` +
`- Success: ${(testStats.success_rate).toFixed(1)}%\n`
);
} catch (error) {
core.warning(`Error reading test summary: ${error.message}`);
}


// Extract just the main content from the HTML - removing the HTML tags
function stripHtml(html) {
// Simple regex to extract text content from HTML
return html
.replace(/<h2>[\s\S]*?<\/h2>/gi, '')
.trim();
}

// Create the check with test results as summary and coverage as details
await github.rest.checks.create({
owner: context.repo.owner,
repo: context.repo.repo,
name: 'Unit Test Results',
head_sha: context.payload.pull_request?.head.sha || context.sha,
status: 'completed',
conclusion: testStats.failed_tests > 0 ? 'failure' : 'success',
output: {
title: `Tests: ${testStats.passed_tests}/${testStats.passed_tests + testStats.failed_tests} passed (${(testStats.success_rate).toFixed(1)}%) Skipped: ${testStats.skipped_tests}`,
summary: stripHtml(testReport.substring(0, 65000)),
text: stripHtml(coverageReport.substring(0, 65000))
}
});

- name: CocoaPods lint
run: pod lib lint --allow-warnings

- name: Upload coverage report to codecov.io
run: bash <(curl -s https://codecov.io/bash) -X gcov -J 'IterableSDK' -J 'IterableAppExtensions'
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: bash <(curl -s https://codecov.io/bash) -X gcov -J 'IterableSDK' -J 'IterableAppExtensions' -B main -C ${{ github.sha }} -r ${{ github.repository }}
Loading