Fix CodeQL checks for Go (#456)

* Fix CodeQL checks for Go

* add scripthaus checkout

* fix

* fix

* add scripthaus to path

* test go setup before init
This commit is contained in:
Evan Simkowitz 2024-03-14 12:12:51 -07:00 committed by GitHub
parent 8ac7d8c241
commit fd05e11d3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -47,6 +47,32 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout Scripthaus (Go only)
if: matrix.language == 'go'
uses: actions/checkout@v4
with:
repository: scripthaus-dev/scripthaus
path: scripthaus
- name: Setup Go (Go only)
uses: actions/setup-go@v5
if: matrix.language == 'go'
with:
go-version: stable
cache-dependency-path: |
wavesrv/go.sum
waveshell/go.sum
scripthaus/go.sum
- name: Install Scripthaus (Go only)
if: matrix.language == 'go'
run: |
go work use ./scripthaus;
cd scripthaus;
go get ./...;
CGO_ENABLED=1 go build -o scripthaus cmd/main.go
echo $PWD >> $GITHUB_PATH
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
@ -61,9 +87,14 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
- name: Autobuild (not Go)
if: matrix.language != 'go'
uses: github/codeql-action/autobuild@v3
- name: Build (Go only)
if: matrix.language == 'go'
run: scripthaus run build-backend
# Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun