2023-01-17 08:01:47 -05:00
|
|
|
name: CodeQL
|
|
|
|
|
|
|
|
on:
|
|
|
|
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
|
|
|
|
permissions:
|
|
|
|
actions: read
|
|
|
|
contents: read
|
|
|
|
security-events: write
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
language: ["go", "python"]
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2023-01-18 11:04:46 -05:00
|
|
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
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-01-17 08:01:47 -05:00
|
|
|
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
|
|
|
with:
|
2023-03-08 04:05:36 -05:00
|
|
|
go-version: "1.20.2"
|
2023-01-17 08:01:47 -05:00
|
|
|
|
|
|
|
- name: Initialize CodeQL
|
2023-02-15 08:47:42 -05:00
|
|
|
uses: github/codeql-action/init@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # v2.2.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::"
|
|
|
|
|
|
|
|
- name: Autobuild
|
2023-02-15 08:47:42 -05:00
|
|
|
uses: github/codeql-action/autobuild@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # v2.2.4
|
2023-01-17 08:01:47 -05:00
|
|
|
|
|
|
|
- name: Perform CodeQL Analysis
|
2023-02-15 08:47:42 -05:00
|
|
|
uses: github/codeql-action/analyze@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # v2.2.4
|
2023-01-17 08:01:47 -05:00
|
|
|
with:
|
|
|
|
category: "/language:${{ matrix.language }}"
|