From c2ab0b3e65f2dbea67819fa3bbdf165b8d574700 Mon Sep 17 00:00:00 2001 From: Vincent Demeester Date: Wed, 20 Mar 2024 05:52:24 +0100 Subject: [PATCH] .github/workflows: make codeql a bit quicker - 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 --- .github/workflows/codeql-analysis.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 019d33c12ff..6a0bbd1983a 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -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 @@ -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