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-07-03 02:19:10 -04:00
|
|
|
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
|
2023-01-17 08:01:47 -05:00
|
|
|
with:
|
2023-07-12 03:51:40 -04:00
|
|
|
go-version: "1.20.6"
|
2023-06-01 09:16:00 -04:00
|
|
|
cache: false
|
2023-01-17 08:01:47 -05:00
|
|
|
|
|
|
|
- name: Initialize CodeQL
|
2023-07-03 02:19:10 -04:00
|
|
|
uses: github/codeql-action/init@f6e388ebf0efc915c6c5b165b019ee61a6746a38 # v2.20.1
|
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-07-03 02:19:10 -04:00
|
|
|
uses: github/codeql-action/autobuild@f6e388ebf0efc915c6c5b165b019ee61a6746a38 # v2.20.1
|
2023-01-17 08:01:47 -05:00
|
|
|
|
|
|
|
- name: Perform CodeQL Analysis
|
2023-07-03 02:19:10 -04:00
|
|
|
uses: github/codeql-action/analyze@f6e388ebf0efc915c6c5b165b019ee61a6746a38 # v2.20.1
|
2023-01-17 08:01:47 -05:00
|
|
|
with:
|
|
|
|
category: "/language:${{ matrix.language }}"
|