|
| 1 | +name: "Unsupported macOS" |
| 2 | +description: "Tests that unsupported macOS versions are detected and result in appropriate diagnostics." |
| 3 | +versions: |
| 4 | + - linked |
| 5 | + - nightly-latest |
| 6 | +installNode: true |
| 7 | + |
| 8 | +operatingSystems: |
| 9 | + - os: macos |
| 10 | + runner-image: xcode-27 |
| 11 | + |
| 12 | +env: |
| 13 | + # Allow the failed SARIF file to be generated. |
| 14 | + CODEQL_ACTION_SKIP_GENERATE_FAILED_SARIF: false |
| 15 | + # But don't actually upload it. |
| 16 | + CODEQL_ACTION_SKIP_SARIF_UPLOAD: true |
| 17 | + # Mark telemetry for this workflow so it can be treated separately. |
| 18 | + CODEQL_ACTION_TESTING_ENVIRONMENT: codeql-action-pr-checks |
| 19 | + |
| 20 | +steps: |
| 21 | + - name: Check xcode_select_link |
| 22 | + run: | |
| 23 | + readlink /private/var/db/xcode_select_link |
| 24 | + file -h /private/var/db/xcode_select_link |
| 25 | +
|
| 26 | + - uses: ./../action/init |
| 27 | + id: init |
| 28 | + continue-on-error: true |
| 29 | + env: |
| 30 | + CODEQL_ACTION_SKIP_UNSUPPORTED_TRACED_ANALYSIS: true |
| 31 | + with: |
| 32 | + languages: swift |
| 33 | + tools: ${{ steps.prepare-test.outputs.tools-url }} |
| 34 | + |
| 35 | + - name: Analyze |
| 36 | + # We could run `analyze` here from `./../analyze`, but `getAnalyzeActionName` in `workflow.ts` |
| 37 | + # can't cope with that unless we introduce a different testing environment. Since this step |
| 38 | + # would just fail on `xcode-27` anyway, we just skip it instead. |
| 39 | + if: false |
| 40 | + uses: ./analyze |
| 41 | + with: |
| 42 | + category: "/test-codeql-version:${{ matrix.version }}" |
| 43 | + |
| 44 | +validationJobs: |
| 45 | + unsupported-macos-sarif-checks: |
| 46 | + checkout: true |
| 47 | + installNode: true |
| 48 | + steps: |
| 49 | + - name: Download workflow artifact |
| 50 | + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 |
| 51 | + with: |
| 52 | + pattern: test-mode-sarif-* |
| 53 | + path: sarif |
| 54 | + |
| 55 | + - name: List artifact contents |
| 56 | + run: ls -laR ./sarif |
| 57 | + |
| 58 | + - name: Check diagnostics appear in SARIF |
| 59 | + env: |
| 60 | + SARIF_PATH: "./sarif/" |
| 61 | + DIAGNOSTIC_ID: "codeql-action/unsupported-traced-analysis-macos" |
| 62 | + DIAGNOSTIC_NAME: "Traced analysis is not supported on this version of macOS" |
| 63 | + EXPECTED_LOCATIONS: "0" |
| 64 | + EXPECTED_MESSAGE: | |
| 65 | + Traced analysis is not supported on macOS 27 or above. |
| 66 | + run: npx tsx ./pr-checks/check-diagnostics.ts |
0 commit comments