From 87871a71ab7b966e4a04878b25a9ab3ca9b167e3 Mon Sep 17 00:00:00 2001 From: Adam Young Date: Mon, 22 Jan 2024 19:16:23 +0000 Subject: [PATCH] CONFIG: Add CodeQL scanning --- .github/codeql/codeql-config.yml | 3 +++ .github/workflows/codeql.yml | 44 ++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 .github/codeql/codeql-config.yml create mode 100644 .github/workflows/codeql.yml diff --git a/.github/codeql/codeql-config.yml b/.github/codeql/codeql-config.yml new file mode 100644 index 00000000..5395fe59 --- /dev/null +++ b/.github/codeql/codeql-config.yml @@ -0,0 +1,3 @@ +paths: + - Sources + - Tests diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 00000000..9b25c2dd --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,44 @@ +name: "CodeQL" + +on: + push: + branches: + - main + pull_request: + branches: + - main + schedule: + # Every Sunday at 12am + - cron: '0 0 * * 0' + workflow_dispatch: + +concurrency: + group: "codeql-${{ github.head_ref || github.run_id }}" + cancel-in-progress: true + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + timeout-minutes: 120 + permissions: + actions: read + contents: read + security-events: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: swift + config-file: ./.github/codeql/codeql-config.yml + + - name: Build + run: swift build --arch arm64 --build-tests + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:swift"