Skip to content

Update codeql.yml

Update codeql.yml #12

Workflow file for this run

# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL Advanced"
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '38 13 * * 4'
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
security-events: write
packages: read
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: swift
build-mode: autobuild
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Skip installing CocoaPods since pods are already in the repo
- name: Use existing CocoaPods setup
if: matrix.language == 'swift'
run: |
echo "Pods are already installed, skipping pod install"
# Run pod install to ensure synchronization without changing the Pods folder
- name: Ensure Podfile and Podfile.lock are in sync
if: matrix.language == 'swift'
run: |
pod install --repo-update
# Initializes the CodeQL tools for scanning
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# Set up Xcode 16
- name: Set up Xcode 16
if: matrix.language == 'swift'
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16.0'
# Build the Swift project for physical device (no simulator)
- name: Build Swift project for physical device
if: matrix.language == 'swift'
run: |
xcodebuild -scheme WarDragon -destination 'platform=iOS Simulator,name=iPhone 15 Pro,OS=18.1' clean build
# Perform CodeQL Analysis
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"