-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (73 loc) · 2.34 KB
/
Copy pathcodeql.yml
File metadata and controls
83 lines (73 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: CodeQL
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "27 8 * * 1"
permissions:
contents: read
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ${{ matrix.runner }}
timeout-minutes: 30
permissions:
security-events: write
packages: read
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
# Swift CodeQL is only supported on macOS runners.
- language: swift
build-mode: manual
runner: macos-latest
- language: javascript-typescript
build-mode: none
runner: ubuntu-latest
- language: actions
build-mode: none
runner: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v7
# Swift toolchain setup runs BEFORE init so it executes natively.
# CodeQL's manual build-mode tracer wraps every step after init in an
# x86_64/Rosetta shim, under which Homebrew refuses to run on Apple
# Silicon. The Xcode project is generated by XcodeGen (project.yml) and
# is not committed, so it must be generated here.
- name: Select latest stable Xcode
if: matrix.language == 'swift'
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Install XcodeGen
if: matrix.language == 'swift'
run: brew install xcodegen
- name: Generate Xcode project
if: matrix.language == 'swift'
run: xcodegen generate
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# Only the actual compilation runs inside the CodeQL tracing region so
# the Swift extractor can observe the build.
- name: Build (no code signing)
if: matrix.language == 'swift'
run: |
xcodebuild build \
-project PowerSnek.xcodeproj \
-scheme PowerSnek \
-configuration Debug \
-derivedDataPath build \
CODE_SIGNING_ALLOWED=NO
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{ matrix.language }}"