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-05-05 08:42:20 -04:00
|
|
|
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
|
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-04-04 05:06:30 -04:00
|
|
|
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
|
2023-01-17 08:01:47 -05:00
|
|
|
with:
|
2023-04-06 10:36:07 -04:00
|
|
|
go-version: "1.20.3"
|
2023-01-17 08:01:47 -05:00
|
|
|
|
|
|
|
- name: Initialize CodeQL
|
2023-05-05 08:42:20 -04:00
|
|
|
uses: github/codeql-action/init@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # v2.3.3
|
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-05-05 08:42:20 -04:00
|
|
|
uses: github/codeql-action/autobuild@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # v2.3.3
|
2023-01-17 08:01:47 -05:00
|
|
|
|
|
|
|
- name: Perform CodeQL Analysis
|
2023-05-05 08:42:20 -04:00
|
|
|
uses: github/codeql-action/analyze@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # v2.3.3
|
2023-01-17 08:01:47 -05:00
|
|
|
with:
|
|
|
|
category: "/language:${{ matrix.language }}"
|