You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: restructure CI workflow to optimize SauceLabs usage and build times
Completely restructure the validation workflow to separate concerns and
respect SauceLabs concurrent session limits while maximizing parallelism.
## New Job Structure
1. **format-check** - Code style validation (unchanged)
2. **build** - Build entire project once, generate javadoc, cache artifacts
3. **unit-tests** - Run all unit tests using cached build (no SauceLabs)
4. **integration-tests** - Run only SauceLabs browser tests using cached build
- Matrix: JUnit 4, 5, 6 variants
- Sequential execution within workflow (max-parallel: 1)
- Global concurrency control across all PRs
## Key Improvements
**Build once, use everywhere:**
- Build job runs `mvn clean install -DskipTests` once
- Javadoc generated once in build job (not 3x in integration tests)
- Artifacts cached with run-specific key: `github.run_id`
- Both unit-tests and integration-tests restore from cache
- Eliminates redundant builds (was building 3x, once per JUnit version)
**Independent unit test execution:**
- Runs `mvn test` separately from integration tests
- No SauceLabs dependency (fast, cheap, can parallelize)
- Separate test reports: surefire-reports (unit tests)
- Added TestBench license setup for Pro feature validation
**Optimized integration tests:**
- Runs `mvn verify -Dsurefire.skip=true -pl <module> -am -P validation`
- `-Dsurefire.skip=true` skips only unit tests (already ran in separate job)
- Runs only failsafe integration tests (*IT.java files)
- Uses full SauceLabs parallelism: `testsInParallel=5`, `forkCount=5`
- Separate test reports: failsafe-reports (integration tests)
- Removed javadoc generation (moved to build job)
**SauceLabs concurrency control:**
- Job-level concurrency group: `saucelabs-testbench`
- Ensures only one set of integration tests runs globally
- Matrix strategy runs JUnit 4/5/6 sequentially (max-parallel: 1)
- Total concurrent sessions: exactly 5 (within SauceLabs limit)
## Resource Utilization
**Multiple PRs can run in parallel:**
- format-check: ✅ parallel across all PRs
- build: ✅ parallel across all PRs (includes javadoc)
- unit-tests: ✅ parallel across all PRs
- integration-tests: ❌ queued globally (SauceLabs constraint only)
**Performance benefits:**
- Faster feedback: format/build/unit-tests run immediately in parallel
- Faster builds: build once vs 3x (33% of previous time)
- Javadoc generated once vs 3x (67% reduction)
- Better SauceLabs utilization: full 5-session parallelism per test run
- No wasted concurrent sessions from multiple workflows
- Integration tests focus purely on browser testing (no javadoc overhead)
## Maven Cache Strategy
Cache key includes `github.run_id` for per-workflow isolation:
- build job: creates cache with `actions/cache@v4`
- unit-tests job: restores cache with `actions/cache/restore@v4`
- integration-tests job: restores cache with `actions/cache/restore@v4`
0 commit comments