Repository navigation
120 lines (99 loc) · 4.25 KB
/
Copy pathcodeql.yml
File metadata and controls
120 lines (99 loc) · 4.25 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: 'CodeQL'
on:
workflow_dispatch:
push:
branches: [trunk]
pull_request:
branches: [trunk]
schedule:
- cron: '0 6 * * 1' # Weekly on Monday at 6am UTC
permissions:
security-events: write
contents: read
jobs:
analyze-interpreted:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
language: [actions, javascript-typescript]
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
build-mode: none
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: '/language:${{ matrix.language }}'
analyze-kotlin:
name: Analyze (java-kotlin)
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: java-kotlin
build-mode: manual
# The :Gutenberg Gradle build generates `SupportedLocales.kt` from
# `src/main/assets/supported-locales.json`, which is normally
# created by the JS build. Copying the checked-in iOS list means
# this job doesn't need Node or translate.wordpress.org.
- name: Copy supported locales list
run: |
mkdir -p android/Gutenberg/src/main/assets
cp ios/Sources/GutenbergKitResources/Gutenberg/supported-locales.json android/Gutenberg/src/main/assets/
- name: Build Android project
# An empty editor URL compiles the bundled editor, which ships, rather than the dev server default.
run: cd android && ./gradlew compileDebugSources compileDebugUnitTestSources -PGUTENBERG_EDITOR_URL=
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: '/language:java-kotlin'
analyze-swift:
name: Analyze (swift)
runs-on: macos-26
timeout-minutes: 45
steps:
- name: Checkout repository
uses: actions/checkout@v7
# Match the Xcode version in `.xcode-version` used by the main CI.
# Xcode 27 can't be used yet: it ships Swift 6.4, and CodeQL's
# Swift extractor supports up to Swift 6.3.
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_26.6.app/Contents/Developer
- name: Cache SPM dependencies
uses: actions/cache@v6
with:
path: |
~/Library/Caches/org.swift.swiftpm/repositories
key: spm-${{ runner.os }}-${{ hashFiles('Package.resolved') }}
restore-keys: |
spm-${{ runner.os }}-
# Resolve before CodeQL starts tracing. Resolution under the tracer
# took ~10 minutes; outside it, it takes seconds.
- name: Resolve Swift packages
run: xcodebuild -resolvePackageDependencies -scheme GutenbergKit-Package
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: swift
build-mode: manual
# Build for iOS: much of `GutenbergKit` is wrapped in
# `canImport(UIKit)` and compiles to nothing on macOS.
# `GutenbergKit-Package` also builds `GutenbergKitHTTP`, which the
# `GutenbergKit` scheme leaves out.
- name: Build Swift package
run: xcodebuild build -scheme GutenbergKit-Package -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' ARCHS=arm64 CODE_SIGNING_ALLOWED=NO
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: '/language:swift'