Skip to content

Commit

Permalink
add golang-ci-lint
Browse files Browse the repository at this point in the history
Signed-off-by: hanenMizouni <[email protected]>
  • Loading branch information
outscale-hmi committed Dec 12, 2024
1 parent 573d366 commit 996c7b8
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: golangci-lint
on:
push:
branches:
- main
pull_request:

permissions:
contents: read
pull-requests: read

jobs:
golangci:
name: Lint Code
runs-on: ubuntu-latest

steps:
# Step 1: Check out the repository
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Ensure full git history for accurate comparisons

# Step 2: Set up Go environment
- uses: actions/setup-go@v5
with:
go-version: stable

# Step 3: Cache Go modules
- name: Cache Go Modules
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# Step 4: Run golangci-lint
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.60
args: |
--new-from-rev=origin/main
--new-only

0 comments on commit 996c7b8

Please sign in to comment.