Scheduled Tests #478
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Scheduled Tests | |
| on: | |
| schedule: | |
| - cron: '0 */4 * * *' # Every 4 hours | |
| workflow_dispatch: # Allow manual triggering | |
| jobs: | |
| scheduled-test: | |
| name: Scheduled Test Run | |
| runs-on: macos-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Show Environment Info | |
| run: | | |
| echo "Scheduled test run at: $(date)" | |
| echo "Runner OS: ${{ runner.os }}" | |
| echo "Branch: ${{ github.ref }}" | |
| xcodebuild -version | |
| swift --version | |
| - name: Cache Build Artifacts | |
| uses: actions/cache@v4 | |
| with: | |
| path: .build | |
| key: ${{ runner.os }}-swift-build-${{ hashFiles('**/Package.resolved') }} | |
| restore-keys: | | |
| ${{ runner.os }}-swift-build- | |
| - name: Build | |
| run: swift build | |
| - name: Run All Tests (Fast) | |
| run: swift test --parallel | |
| - name: Run Critical Tests (Extra Check) | |
| run: | | |
| swift test --filter MonoTaskForceUpdateTests | |
| swift test --filter MemoryCacheTests.testNegativeCapacity | |
| - name: Upload Test Results on Failure | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: scheduled-test-failure-${{ github.run_number }} | |
| path: | | |
| .build/debug/ | |
| *.log | |
| retention-days: 7 | |
| - name: Notify on Failure | |
| if: failure() | |
| run: | | |
| echo "::warning::Scheduled test run failed at $(date)" | |
| echo "::error::Critical test failure detected in scheduled run" |