|
| 1 | +# NOTE: All third-party actions are pinned by full commit SHA for supply-chain safety. |
| 2 | +# To update an action: find the new version's commit SHA on GitHub (Tags -> verify commit), |
| 3 | +# replace the SHA, and keep the "# vX" comment in sync. |
| 4 | +name: Nightly SourceKit-LSP Smoke |
| 5 | + |
| 6 | +on: |
| 7 | + schedule: |
| 8 | + # Run after the other nightly test lanes to reduce runner contention. |
| 9 | + - cron: '0 6 * * *' |
| 10 | + workflow_dispatch: |
| 11 | + |
| 12 | +permissions: |
| 13 | + contents: read |
| 14 | + |
| 15 | +concurrency: |
| 16 | + group: nightly-sourcekit-lsp |
| 17 | + cancel-in-progress: false |
| 18 | + |
| 19 | +# This scheduled/manual lane intentionally starts outside blocking PR CI. |
| 20 | +# Promotion criteria live in .github/SOURCEKIT_LSP_SMOKE.md. |
| 21 | +jobs: |
| 22 | + sourcekit-lsp-smoke: |
| 23 | + name: Real SourceKit-LSP Smoke |
| 24 | + runs-on: macos-26 |
| 25 | + timeout-minutes: 30 |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 |
| 28 | + |
| 29 | + - name: Select Xcode |
| 30 | + uses: ./.github/actions/select-xcode |
| 31 | + |
| 32 | + - name: Ensure Metal Toolchain |
| 33 | + run: bash scripts/ensure-metal-toolchain.sh |
| 34 | + |
| 35 | + - name: Locate SourceKit-LSP in Selected Xcode |
| 36 | + shell: bash |
| 37 | + run: | |
| 38 | + set -euo pipefail |
| 39 | + sourcekit_lsp="$(xcrun --find sourcekit-lsp 2>/dev/null || true)" |
| 40 | + if [ -z "$sourcekit_lsp" ] || [ ! -x "$sourcekit_lsp" ]; then |
| 41 | + echo "::error::The selected Xcode toolchain does not provide an executable sourcekit-lsp" |
| 42 | + exit 1 |
| 43 | + fi |
| 44 | + case "$sourcekit_lsp" in |
| 45 | + "$DEVELOPER_DIR"/*) ;; |
| 46 | + *) |
| 47 | + echo "::error::sourcekit-lsp resolved outside the selected Xcode: $sourcekit_lsp" |
| 48 | + exit 1 |
| 49 | + ;; |
| 50 | + esac |
| 51 | + echo "Using sourcekit-lsp at $sourcekit_lsp" |
| 52 | + echo "PINE_SOURCEKIT_LSP_EXECUTABLE=$sourcekit_lsp" >> "$GITHUB_ENV" |
| 53 | +
|
| 54 | + - name: Cache SPM Dependencies |
| 55 | + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 |
| 56 | + with: |
| 57 | + path: DerivedData/SourcePackages |
| 58 | + key: spm-${{ runner.os }}-${{ hashFiles('Pine.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }} |
| 59 | + restore-keys: | |
| 60 | + spm-${{ runner.os }}- |
| 61 | +
|
| 62 | + - name: Run Real SourceKit-LSP Smoke |
| 63 | + shell: bash |
| 64 | + env: |
| 65 | + PINE_RUN_SOURCEKIT_LSP_SMOKE: "1" |
| 66 | + PINE_SOURCEKIT_LSP_ARTIFACTS_DIR: ${{ github.workspace }}/SourceKitLSPArtifacts |
| 67 | + run: | |
| 68 | + set -euo pipefail |
| 69 | + mkdir -p SourceKitLSPArtifacts |
| 70 | + result_bundle="SourceKitLSPResults.xcresult" |
| 71 | + console_log="SourceKitLSPArtifacts/xcodebuild.log" |
| 72 | + test_started_at="$(date +%s)" |
| 73 | + set +e |
| 74 | + xcodebuild test \ |
| 75 | + -project Pine.xcodeproj \ |
| 76 | + -scheme Pine \ |
| 77 | + -destination "platform=macOS" \ |
| 78 | + -derivedDataPath DerivedData \ |
| 79 | + -only-testing:PineTests/SourceKitLSPIntegrationTests \ |
| 80 | + -enableCodeCoverage NO \ |
| 81 | + -parallel-testing-enabled NO \ |
| 82 | + -test-timeouts-enabled YES \ |
| 83 | + -resultBundlePath "$result_bundle" \ |
| 84 | + CODE_SIGN_IDENTITY=- \ |
| 85 | + CODE_SIGNING_ALLOWED=NO \ |
| 86 | + CODE_SIGNING_REQUIRED=NO \ |
| 87 | + PINE_RUN_SOURCEKIT_LSP_SMOKE=1 \ |
| 88 | + PINE_SOURCEKIT_LSP_EXECUTABLE="$PINE_SOURCEKIT_LSP_EXECUTABLE" \ |
| 89 | + PINE_SOURCEKIT_LSP_ARTIFACTS_DIR="$PINE_SOURCEKIT_LSP_ARTIFACTS_DIR" \ |
| 90 | + 2>&1 | tee "$console_log" |
| 91 | + test_exit=${PIPESTATUS[0]} |
| 92 | + set -e |
| 93 | +
|
| 94 | + python3 .github/scripts/validate_test_results.py \ |
| 95 | + "$result_bundle" \ |
| 96 | + --xcodebuild-exit "$test_exit" \ |
| 97 | + --started-at "$test_started_at" \ |
| 98 | + --github-summary |
| 99 | +
|
| 100 | + - name: Upload SourceKit-LSP Results |
| 101 | + if: always() |
| 102 | + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 |
| 103 | + with: |
| 104 | + name: SourceKitLSP-${{ github.run_id }}-${{ github.run_attempt }} |
| 105 | + path: | |
| 106 | + SourceKitLSPResults.xcresult |
| 107 | + SourceKitLSPArtifacts |
| 108 | + if-no-files-found: warn |
| 109 | + retention-days: 14 |
0 commit comments