Skip to content

Feat(WebApp):Update localization strings for multiple languages and a… #342

Feat(WebApp):Update localization strings for multiple languages and a…

Feat(WebApp):Update localization strings for multiple languages and a… #342

Workflow file for this run

# Quality Testing Workflow
#
# Runs advanced quality tests:
# - Property-based/Fuzz testing
# - Performance regression tests
# - Web E2E tests (Playwright)
#
# Triggered on PRs and pushes to main
name: Quality Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch: # Manual trigger
env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false"
jobs:
# ==========================================================================
# PROPERTY-BASED / FUZZ TESTS
# ==========================================================================
fuzz-tests:
name: Property-Based Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
- name: Run Property-Based Tests
run: ./gradlew :common:desktopTest --tests "com.mehrguard.core.PropertyBasedTest" --no-daemon
continue-on-error: true
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: fuzz-test-results
path: common/build/reports/tests/
# ==========================================================================
# PERFORMANCE REGRESSION TESTS
# ==========================================================================
performance-tests:
name: Performance Regression Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
- name: Run Performance Regression Tests
run: ./gradlew :common:desktopTest --tests "com.mehrguard.benchmark.PerformanceRegressionTest" --no-daemon
continue-on-error: true
- name: Run Benchmark Tests
run: ./gradlew :common:desktopTest --tests "com.mehrguard.benchmark.PerformanceBenchmarkTest" --no-daemon
continue-on-error: true
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: performance-test-results
path: common/build/reports/tests/
# ==========================================================================
# PLATFORM PARITY TESTS (JVM + JS + Native)
# ==========================================================================
parity-tests:
name: Platform Parity Tests
runs-on: macos-14 # Need macOS for iOS Native tests
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
- name: Run JVM Parity Tests
run: ./gradlew :common:desktopTest --tests "*PlatformParityTest*" --no-daemon
continue-on-error: true
- name: Run JS Parity Tests
run: ./gradlew :common:jsNodeTest --tests "*PlatformParityTest*" --no-daemon
continue-on-error: true
- name: Run iOS Native Parity Tests
run: ./gradlew :common:iosSimulatorArm64Test --tests "*PlatformParityTest*" --no-daemon
continue-on-error: true
- name: Run Platform Contract Tests (JVM)
run: ./gradlew :common:desktopTest --tests "*PlatformContractTest*" --no-daemon
continue-on-error: true
- name: Run Platform Contract Tests (JS)
run: ./gradlew :common:jsNodeTest --tests "*PlatformContractTest*" --no-daemon
continue-on-error: true
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: parity-test-results
path: common/build/reports/tests/
# ==========================================================================
# WEB E2E TESTS (PLAYWRIGHT)
# ==========================================================================
e2e-tests:
name: Web E2E Tests
runs-on: ubuntu-latest
continue-on-error: true # E2E tests are non-blocking
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
- name: Build Web App
run: ./gradlew :webApp:jsBrowserProductionWebpack --no-daemon
continue-on-error: true
- name: Check E2E Directory
run: |
if [ -f "webApp/e2e/package.json" ]; then
echo "E2E directory found"
cd webApp/e2e
npm ci || npm install
npx playwright install chromium || true
npx playwright test --reporter=github || true
else
echo "E2E directory not configured, skipping"
fi
continue-on-error: true
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: e2e-test-results
path: webApp/e2e/test-results/
if-no-files-found: ignore
# ==========================================================================
# IOS UI TESTS (MACOS ONLY)
# ==========================================================================
ios-ui-tests:
name: iOS UI Tests
runs-on: macos-14
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
continue-on-error: true # iOS tests are non-blocking
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
- name: Build Common Framework for iOS
run: ./gradlew :common:linkReleaseFrameworkIosSimulatorArm64 --no-daemon
continue-on-error: true
- name: Copy Framework
run: |
mkdir -p iosApp/Frameworks
if [ -d "common/build/bin/iosSimulatorArm64/releaseFramework/common.framework" ]; then
cp -R common/build/bin/iosSimulatorArm64/releaseFramework/common.framework iosApp/Frameworks/
else
echo "Framework not found, skipping copy"
fi
continue-on-error: true
- name: Run iOS UI Tests
working-directory: iosApp
run: |
xcodebuild test \
-scheme MehrGuard \
-destination 'platform=iOS Simulator,name=iPhone 15,OS=17.2' \
-resultBundlePath TestResults.xcresult \
CODE_SIGNING_ALLOWED=NO \
| xcpretty || true
continue-on-error: true
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: ios-ui-test-results
path: iosApp/TestResults.xcresult/
if-no-files-found: ignore
# ==========================================================================
# QUALITY SUMMARY
# ==========================================================================
quality-summary:
name: Quality Summary
needs: [fuzz-tests, performance-tests, parity-tests, e2e-tests]
runs-on: ubuntu-latest
if: always()
steps:
- name: Check Test Results
run: |
echo "## Quality Test Results Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Test Suite | Status |" >> $GITHUB_STEP_SUMMARY
echo "|------------|--------|" >> $GITHUB_STEP_SUMMARY
echo "| Property-Based Tests | ${{ needs.fuzz-tests.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Performance Tests | ${{ needs.performance-tests.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Platform Parity Tests | ${{ needs.parity-tests.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Web E2E Tests | ${{ needs.e2e-tests.result }} |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Note: Tests are informational and do not block the build." >> $GITHUB_STEP_SUMMARY