Skip to content

Commit

Permalink
run codeql in lint.yml (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmetc authored Jul 5, 2023
1 parent 5a7af8c commit 2195698
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 11 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Static Analysis

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]


jobs:
build:
name: "golangci-lint + codeql"
runs-on: ubuntu-latest

permissions:
security-events: write

steps:

- name: Check out code into the Go module directory
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.20.5

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: go, python

- name: Build
run: |
make build
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.53
args: --issues-exit-code=1 --timeout 10m
only-new-issues: false
# the cache is already managed above, enabling it here
# gives errors when extracting
skip-pkg-cache: true
skip-build-cache: true

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
11 changes: 0 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,3 @@ jobs:
EOT
sleep 5
sudo -E pipenv run pytest ./test/install/with_crowdsec
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.51
args: --issues-exit-code=1 --timeout 10m
only-new-issues: false
# the cache is already managed above, enabling it here
# gives errors when extracting
skip-pkg-cache: true
skip-build-cache: true

0 comments on commit 2195698

Please sign in to comment.