Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release - Run golangci-lint and govulncheck in CI workflow #81

Merged
merged 4 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions .github/workflows/test-deploy-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,28 @@ jobs:
- name: Test
run: docker compose -f actions-services.yml run --rm test ./scripts/test.sh

lint:
name: Lint and Vulnerability Scan
runs-on: ubuntu-latest
timeout-minutes: ${{ fromJSON(vars.DEFAULT_JOB_TIMEOUT_MINUTES) }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: true
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
- name: govulncheck
run: |
go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...

deploy:
name: Deploy to AWS Lambda
needs: tests
needs: [ 'tests', 'lint' ]
if: github.ref_name == 'main' || github.ref_name == 'develop'
runs-on: ubuntu-latest
strategy:
Expand All @@ -52,7 +71,7 @@ jobs:

build-and-publish:
name: Build and Publish
needs: tests
needs: [ 'tests', 'lint' ]
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand Down
19 changes: 19 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
run:
timeout: 2m
linters:
disable-all: true
enable:
# - errcheck
# - gosimple
# - govet
# - ineffassign
# - staticcheck
# - unused
- bodyclose
- gocheckcompilerdirectives
- godox
# - gofmt
# - goimports
# - gosec
# - whitespace
# - usestdlibvars