Skip to content

Update codeql.yml

Update codeql.yml #14

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
- name: Clean Derived Data
if: matrix.language == 'swift'
run: |
rm -rf ~/Library/Developer/Xcode/DerivedData/*
- name: Set Excluded Architectures for Simulator
if: matrix.language == 'swift'
run: |
echo "EXCLUDED_ARCHITECTURES=arm64" >> "$GITHUB_WORKSPACE/WarDragon.xcconfig"
- name: Install Pods without Repo Update
if: matrix.language == 'swift'
run: |
cd $GITHUB_WORKSPACE
pod install --no-repo-update
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
- name: Set up Xcode 16
if: matrix.language == 'swift'
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16.0'
- name: Build Swift project for simulator (excluding arm64)
if: matrix.language == 'swift'
run: |
xcodebuild -scheme WarDragon -destination 'platform=iOS Simulator,name=iPhone 15 Pro,OS=18.1' ONLY_ACTIVE_ARCH=YES ARCHS="x86_64" clean build
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"