Skip to content

Commit

Permalink
Actually Configure CodeQL
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelbrm committed Jun 23, 2023
1 parent b90fb3b commit dcdd340
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -49,8 +49,12 @@ jobs:

# 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@v1
# - name: Autobuild
# uses: github/codeql-action/autobuild@v2

- name: Download Modules and Build
run: |
make codeql
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -59,9 +63,5 @@ jobs:
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ ifdef TEST_RUN
TEST_FLAGS = --tags=$(TEST_TAGS) $(TEST_PKG) --run=$(TEST_RUN)
endif

.PHONY: all buildcmd docker test create-json-schema lint clean
.PHONY: all buildcmd docker test create-json-schema lint clean download-mod
all: test create-json-schema buildcmd

.DEFAULT: buildcmd

codeql: download-mod buildcmd

buildcmd:
cd main && CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) go build -v -ldflags "-w -s -X main.version=${GIT_VERSION} -X main.buildTime=${BUILD_TIME} -X main.commit=${GIT_COMMIT}" -o ${OUTPUT}/bat-go main.go

Expand Down Expand Up @@ -196,3 +198,13 @@ lint:
docker run --rm -v "$$(pwd):/app" -v batgo_lint_gomod:/go/pkg --workdir /app/tools golangci/golangci-lint:v1.49.0 golangci-lint run -v ./...
docker run --rm -v "$$(pwd):/app" -v batgo_lint_gomod:/go/pkg --workdir /app/serverless/email/webhook golangci/golangci-lint:v1.49.0 golangci-lint run -v ./...
docker run --rm -v "$$(pwd):/app" -v batgo_lint_gomod:/go/pkg --workdir /app/serverless/email/unsubscribe golangci/golangci-lint:v1.49.0 golangci-lint run -v ./...

download-mod:
cd ./cmd && go mod download && cd ..
cd ./libs && go mod download && cd ..
cd ./main && go mod download && cd ..
cd ./services && go mod download && cd ..
cd ./tools && go mod download && cd ..
cd ./serverless/email/status && go mod download && cd ../../..
cd ./serverless/email/unsubscribe && go mod download && cd ../../..
cd ./serverless/email/webhook && go mod download && cd ../../..

0 comments on commit dcdd340

Please sign in to comment.