2023-01-17 14:01:47 +01:00
|
|
|
name: CodeQL
|
|
|
|
|
|
|
|
on:
|
2023-05-25 18:20:44 +02:00
|
|
|
workflow_dispatch:
|
2023-01-17 14:01:47 +01:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2023-01-19 10:22:47 +01:00
|
|
|
- "release/**"
|
|
|
|
paths:
|
|
|
|
- "**.go"
|
|
|
|
- "**/go.mod"
|
|
|
|
- "**/go.sum"
|
|
|
|
- "**.py"
|
|
|
|
- "**requirements.txt"
|
2023-02-14 20:01:00 +01:00
|
|
|
- ".github/workflows/codeql.yml"
|
2023-01-17 14:01:47 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
codeql:
|
|
|
|
name: CodeQL
|
|
|
|
runs-on: ubuntu-22.04
|
2023-05-25 18:20:44 +02: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 14:01:47 +01:00
|
|
|
permissions:
|
|
|
|
actions: read
|
|
|
|
contents: read
|
|
|
|
security-events: write
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-10-13 12:37:13 +02:00
|
|
|
language: ["go"]
|
2023-01-17 14:01:47 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2024-05-24 11:04:23 +02:00
|
|
|
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
2023-01-17 14:01:47 +01:00
|
|
|
|
|
|
|
- name: Setup Go environment
|
2023-01-17 18:49:00 +01:00
|
|
|
if: matrix.language == 'go'
|
2024-05-08 14:33:35 +02:00
|
|
|
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
|
2023-01-17 14:01:47 +01:00
|
|
|
with:
|
2024-06-05 10:27:39 +02:00
|
|
|
go-version: "1.22.4"
|
2023-06-01 15:16:00 +02:00
|
|
|
cache: false
|
2023-01-17 14:01:47 +01:00
|
|
|
|
|
|
|
- name: Initialize CodeQL
|
2024-06-04 14:50:20 +02:00
|
|
|
uses: github/codeql-action/init@f079b8493333aace61c81488f8bd40919487bd9f # v3.25.7
|
2023-01-17 14:01:47 +01:00
|
|
|
with:
|
|
|
|
languages: ${{ matrix.language }}
|
|
|
|
|
|
|
|
- name: Install Go Dependencies
|
2023-01-17 18:49:00 +01:00
|
|
|
if: matrix.language == 'go'
|
2023-01-17 14:01:47 +01: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 17:47:57 +01:00
|
|
|
go mod download -C "$mod"
|
2023-01-17 14:01:47 +01:00
|
|
|
done
|
|
|
|
echo "::endgroup::"
|
|
|
|
|
|
|
|
- name: Perform CodeQL Analysis
|
2024-06-04 14:50:20 +02:00
|
|
|
uses: github/codeql-action/analyze@f079b8493333aace61c81488f8bd40919487bd9f # v3.25.7
|
2023-01-17 14:01:47 +01:00
|
|
|
with:
|
|
|
|
category: "/language:${{ matrix.language }}"
|