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:
|
|
|
|
language: ["go", "python"]
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2023-07-03 02:19:10 -04:00
|
|
|
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
2023-01-17 08:01:47 -05:00
|
|
|
|
|
|
|
- name: Setup Go environment
|
2023-01-17 12:49:00 -05:00
|
|
|
if: matrix.language == 'go'
|
2023-08-15 08:38:48 -04:00
|
|
|
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
|
2023-01-17 08:01:47 -05:00
|
|
|
with:
|
2023-09-28 16:29:14 -04:00
|
|
|
go-version: "1.21.1"
|
2023-06-01 09:16:00 -04:00
|
|
|
cache: false
|
2023-01-17 08:01:47 -05:00
|
|
|
|
|
|
|
- name: Initialize CodeQL
|
2023-08-15 08:38:48 -04:00
|
|
|
uses: github/codeql-action/init@a09933a12a80f87b87005513f0abb1494c27a716 # v2.21.4
|
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::"
|
|
|
|
|
2023-05-25 12:20:44 -04:00
|
|
|
- name: Build
|
|
|
|
if: matrix.language == 'python'
|
2023-08-15 08:38:48 -04:00
|
|
|
uses: github/codeql-action/autobuild@a09933a12a80f87b87005513f0abb1494c27a716 # v2.21.4
|
2023-01-17 08:01:47 -05:00
|
|
|
|
|
|
|
- name: Perform CodeQL Analysis
|
2023-08-15 08:38:48 -04:00
|
|
|
uses: github/codeql-action/analyze@a09933a12a80f87b87005513f0abb1494c27a716 # v2.21.4
|
2023-01-17 08:01:47 -05:00
|
|
|
with:
|
|
|
|
category: "/language:${{ matrix.language }}"
|