2023-01-17 08:01:47 -05:00
|
|
|
name: CodeQL
|
|
|
|
|
|
|
|
on:
|
2023-05-25 12:20:44 -04:00
|
|
|
workflow_dispatch:
|
2023-01-17 08:01:47 -05:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2023-01-19 04:22:47 -05:00
|
|
|
- "release/**"
|
|
|
|
paths:
|
|
|
|
- "**.go"
|
|
|
|
- "**/go.mod"
|
|
|
|
- "**/go.sum"
|
|
|
|
- "**.py"
|
|
|
|
- "**requirements.txt"
|
2023-02-14 14:01:00 -05:00
|
|
|
- ".github/workflows/codeql.yml"
|
2023-01-17 08:01:47 -05:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
codeql:
|
|
|
|
name: CodeQL
|
|
|
|
runs-on: ubuntu-22.04
|
2023-05-25 12:20:44 -04:00
|
|
|
env:
|
|
|
|
# Force CodeQL to run the extraction on the files compiled by our custom
|
|
|
|
# build command, as opposed to letting the autobuilder figure it out.
|
|
|
|
CODEQL_EXTRACTOR_GO_BUILD_TRACING: 'on'
|
2023-01-17 08:01:47 -05:00
|
|
|
permissions:
|
|
|
|
actions: read
|
|
|
|
contents: read
|
|
|
|
security-events: write
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-10-13 06:37:13 -04:00
|
|
|
language: ["go"]
|
2023-01-17 08:01:47 -05:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2024-06-19 09:19:41 -04:00
|
|
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
2023-01-17 08:01:47 -05:00
|
|
|
|
|
|
|
- name: Setup Go environment
|
2023-01-17 12:49:00 -05:00
|
|
|
if: matrix.language == 'go'
|
2024-07-18 02:49:57 -04:00
|
|
|
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
2023-01-17 08:01:47 -05:00
|
|
|
with:
|
2024-07-03 03:49:37 -04:00
|
|
|
go-version: "1.22.5"
|
2023-06-01 09:16:00 -04:00
|
|
|
cache: false
|
2023-01-17 08:01:47 -05:00
|
|
|
|
|
|
|
- name: Initialize CodeQL
|
2024-08-01 04:34:44 -04:00
|
|
|
uses: github/codeql-action/init@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
|
2023-01-17 08:01:47 -05:00
|
|
|
with:
|
|
|
|
languages: ${{ matrix.language }}
|
|
|
|
|
|
|
|
- name: Install Go Dependencies
|
2023-01-17 12:49:00 -05:00
|
|
|
if: matrix.language == 'go'
|
2023-01-17 08:01:47 -05:00
|
|
|
run: |
|
|
|
|
echo "::group::Install apt dependencies"
|
|
|
|
sudo apt-get update && sudo apt-get install -y libcryptsetup12 libcryptsetup-dev libvirt-dev
|
|
|
|
echo "::endgroup::"
|
|
|
|
|
|
|
|
echo "::group::Install go dependencies"
|
|
|
|
mods=$(go list -f '{{.Dir}}' -m | xargs)
|
|
|
|
for mod in $mods; do
|
2023-02-06 11:47:57 -05:00
|
|
|
go mod download -C "$mod"
|
2023-01-17 08:01:47 -05:00
|
|
|
done
|
|
|
|
echo "::endgroup::"
|
|
|
|
|
|
|
|
- name: Perform CodeQL Analysis
|
2024-08-01 04:34:44 -04:00
|
|
|
uses: github/codeql-action/analyze@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
|
2023-01-17 08:01:47 -05:00
|
|
|
with:
|
|
|
|
category: "/language:${{ matrix.language }}"
|