forked from mazdak/AudioWhisper
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (61 loc) · 2.12 KB
/
codeql.yml
File metadata and controls
68 lines (61 loc) · 2.12 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
name: "CodeQL"
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
schedule:
- cron: '0 6 * * 1'
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ${{ matrix.runner }}
permissions:
security-events: write
packages: read
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: python
runner: ubuntu-latest
# Swift analysis must run on macOS: WhisperKit depends on CoreML,
# which is unavailable on Linux runners.
- language: swift
runner: macos-15
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Select Xcode
if: matrix.language == 'swift'
run: |
# Need Xcode 16+ (Swift 6 tooling) for swift-jinja 2.x.
latest=$(ls -d /Applications/Xcode_16*.app 2>/dev/null | sort -V | tail -n 1)
if [ -n "$latest" ]; then
sudo xcode-select -s "$latest/Contents/Developer"
fi
- name: Generate VersionInfo.swift
if: matrix.language == 'swift'
run: |
# VersionInfo.swift is gitignored; normally produced by scripts/build.sh.
VERSION=$(tr -d '[:space:]' < VERSION 2>/dev/null || echo "0.0.0")
GIT_HASH=$(git rev-parse --short HEAD 2>/dev/null || echo "ci-build")
# BUNDLED_UV_* must be substituted before VERSION_PLACEHOLDER (substring).
sed -e "s/BUNDLED_UV_VERSION_PLACEHOLDER//g" \
-e "s/BUNDLED_UV_SHA256_PLACEHOLDER//g" \
-e "s/VERSION_PLACEHOLDER/$VERSION/g" \
-e "s/GIT_HASH_PLACEHOLDER/$GIT_HASH/g" \
-e "s/BUILD_DATE_PLACEHOLDER/$(date -u +%Y-%m-%d)/g" \
Sources/VersionInfo.swift.template > Sources/Utilities/VersionInfo.swift
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v3
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{ matrix.language }}"