Skip to content

Commit

Permalink
.github/workflows: make codeql a bit quicker
Browse files Browse the repository at this point in the history
- Use `actions/cache` to be able to use golang cache (uses `**/go.sum`
 to compute the cache hash). This should speed up compilation for any
 pull-requests that doesn't update dependencies.
- Do not rely on autobuild, but use `make bin/*` to build all binaries
 (and add a `make binaries` for the future).

Signed-off-by: Vincent Demeester <[email protected]>
  • Loading branch information
vdemeester authored and tekton-robot committed Mar 28, 2024
1 parent ab47f4e commit c2ab0b3
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,20 @@ jobs:
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

- uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/.cache/pip
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9
# - name: Autobuild
# uses: github/codeql-action/autobuild@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -73,9 +83,9 @@ jobs:
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release
- run: |
# Switch to "make binaries" later
make bin/controller bin/entrypoint bin/events bin/nop bin/resolvers bin/sidecarlogresults bin/webhook bin/workingdirinit
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9

0 comments on commit c2ab0b3

Please sign in to comment.