Skip to content

Commit

Permalink
TOFIX: codeql
Browse files Browse the repository at this point in the history
Signed-off-by: Evan Lezar <[email protected]>
  • Loading branch information
elezar committed Feb 12, 2025
1 parent 5acc0fb commit 6f10e40
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
39 changes: 38 additions & 1 deletion .github/workflows/code_scanning.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,42 @@ on:
golang_version:
required: true
type: string
pull_request:
types:
- opened
- synchronize
branches:
- main
- release-*


jobs:
# TODO: Is there a way that we can only invoke this if this is a PR?
optionalVariables:
if: ${{ github.event_name == 'pull_request' }}
uses: ./.github/workflows/variables.yaml

variables:
runs-on: ubuntu-latest
needs: optionalVariables
if: always()
outputs:
golang_version: ${{ steps.golang_output.outputs.golang_version }}
steps:
- name: Check out code
uses: actions/checkout@v4
- id: golang_version
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
GOLANG_VERSION="${{ needs.optionalVariables.output.golang_version }}"
else
GOLANG_VERSION="${{ inputs.golang_version}}"
fi
echo "golang_version=${GOLANG_VERSION##GOLANG_VERSION ?= }" >> $GITHUB_OUTPUT
analyze:
needs:
- variables
name: Analyze Go code with CodeQL
runs-on: ubuntu-latest
timeout-minutes: 360
Expand All @@ -32,18 +65,22 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ inputs.golang_version }}
go-version: ${{ needs.variables.outputs.golang_version }}

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: go
build-mode: manual

- shell: bash
run: |
make build
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
env:
KUBECONFIG: ${{ github.workspace }}/kubeconfig
E2E_IMAGE_REPO: ghcr.io/nvidia/k8s-device-plugin
E2E_IMAGE_TAG: ${{ inputs.version }} -ubi9
E2E_IMAGE_TAG: ${{ inputs.version }}-ubi9
LOG_ARTIFACTS: ${{ github.workspace }}/e2e_logs
run: |
make test-e2e
Expand Down

0 comments on commit 6f10e40

Please sign in to comment.