Skip to content

Commit 7480971

Browse files
authored
Add e2e test
1 parent c85a167 commit 7480971

2 files changed

Lines changed: 176 additions & 0 deletions

File tree

‎.github/workflows/__unsupported-macos.yml‎

Lines changed: 122 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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+
- uses: ./../action/init
22+
id: init
23+
with:
24+
languages: swift
25+
tools: ${{ steps.prepare-test.outputs.tools-url }}
26+
27+
- name: Analyze
28+
uses: ./../action/analyze
29+
with:
30+
category: "/test-codeql-version:${{ matrix.version }}"
31+
32+
validationJobs:
33+
unsupported-macos-sarif-checks:
34+
checkout: true
35+
installNode: true
36+
steps:
37+
- name: Download workflow artifact
38+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
39+
with:
40+
pattern: test-mode-sarif-*
41+
path: sarif
42+
43+
- name: List artifact contents
44+
run: ls -laR ./sarif
45+
46+
- name: Check diagnostics appear in SARIF
47+
env:
48+
SARIF_PATH: "./sarif/codeql-failed-run.sarif"
49+
DIAGNOSTIC_ID: "codeql-action/unsupported-traced-analysis-macos"
50+
DIAGNOSTIC_NAME: "Traced analysis is not supported on this version of macOS"
51+
EXPECTED_LOCATIONS: "0"
52+
EXPECTED_MESSAGE: |
53+
Traced analysis is not supported on macOS 27 or above.
54+
run: npx tsx ./pr-checks/check-diagnostics.ts

0 commit comments

Comments
 (0)