This repository was archived by the owner on Dec 11, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +92
-0
lines changed Expand file tree Collapse file tree 2 files changed +92
-0
lines changed Original file line number Diff line number Diff line change 1+ name : CodeQL scanning
2+
3+ on :
4+ push :
5+ branches : [main]
6+ pull_request :
7+ branches : [main]
8+ schedule :
9+ - cron : ' 0 0 * * 0' # At 00:00 every Sunday
10+ jobs :
11+
12+ codeql :
13+ runs-on : ubuntu-latest
14+ env :
15+ # Force CodeQL to run the extraction on the files compiled by our custom
16+ # build command, as opposed to letting the autobuilder figure it out.
17+ # This approach is more efficient because TriggerMesh is composed of
18+ # multiple small programs.
19+ CODEQL_EXTRACTOR_GO_BUILD_TRACING : ' on'
20+
21+ permissions :
22+ security-events : write
23+
24+ steps :
25+ - name : Checkout repository
26+ uses : actions/checkout@v3
27+
28+ - name : Set up Go
29+ uses : actions/setup-go@v3
30+ with :
31+ go-version : 1.19.x
32+
33+ - name : Go caches
34+ uses : actions/cache@v3
35+ with :
36+ path : |
37+ ~/.cache/go-build
38+ ~/go/pkg/mod
39+ key : ${{ github.job }}-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
40+ restore-keys : |
41+ ${{ github.job }}-${{ runner.os }}-go-
42+
43+ - name : Initialize CodeQL
44+ uses : github/codeql-action/init@v2
45+ with :
46+ languages : go
47+
48+ - name : Build Go code
49+ run : go build ./cmd/...
50+
51+
52+ - name : Perform CodeQL Analysis
53+ uses : github/codeql-action/analyze@v2
Original file line number Diff line number Diff line change 1+ name : Static code analysis
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+ pull_request :
7+ branches : [ main ]
8+
9+ jobs :
10+
11+ lint-code :
12+ name : Code Linting
13+ runs-on : ubuntu-latest
14+
15+ steps :
16+ - uses : actions/checkout@v3
17+
18+ - name : Set up Go
19+ uses : actions/setup-go@v3
20+ with :
21+ go-version : 1.19.x
22+
23+ # This action takes care of caching/restoring modules and build caches.
24+ # Therefore, this step should remain the first one that is executed after
25+ # the Go setup, in case other steps are added to this job in the future.
26+ - name : Lint Go code
27+ uses : golangci/golangci-lint-action@v3
28+ with :
29+ # (hack) By default, errors are reported to the GitHub commit view only
30+ # (or the "Files changed" tab on PRs). We also want errors to be logged
31+ # with line numbers to the execution logs of the workflow.
32+ #
33+ # The args below result in the following flags being passed to the
34+ # linter command, which works, quite surprisingly:
35+ # --out-format=github-actions --out-format=colored-line-number
36+ #
37+ # Ref. https://github.com/golangci/golangci-lint-action/issues/119#issuecomment-981090648
38+ args : --out-${NO_FUTURE}format=colored-line-number --timeout 15m
39+
You can’t perform that action at this time.
0 commit comments