Skip to content

Commit

Permalink
chore(ci): add linter (#346)
Browse files Browse the repository at this point in the history
* chore(ci): add linter

* fix(ci): use proper job name

* fix(ci): syntax

* chore(ci): fix ubuntu version

* chore(ci): fix ubuntu version

* fix(ci): use proper pipeline condition
  • Loading branch information
claudiodangelis authored Dec 27, 2024
1 parent 0a0bd60 commit cd3d471
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,42 @@
name: CI
on:
push:
branches: [ main ]
pull_request:
permissions:
contents: read
env:
GOLANG_VERSION: 1.21.x
jobs:
lint:
name: lint
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GOLANG_VERSION }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.60
test:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.21.x'
go-version: ${{ env.GOLANG_VERSION }}
- name: Install dependencies
run: go get .
- name: Build
run: go build -v ./...
- name: Test with the Go CLI
run: go test ./...
release:
runs-on: ubuntu-latest
needs: test
runs-on: ubuntu-24.04
needs: [ lint, test ]
if: startsWith(github.event.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v2
Expand All @@ -29,7 +47,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.21.x
go-version: ${{ env.GOLANG_VERSION }}
# Runs the goreleaser
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
Expand Down

0 comments on commit cd3d471

Please sign in to comment.