Skip to content

Commit

Permalink
Added a dedicated stage for tests and lints
Browse files Browse the repository at this point in the history
  • Loading branch information
vertisan committed Sep 17, 2024
1 parent 1878249 commit ab359c4
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 20 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Lint & Test

on:
push:
branches:
- '*'
pull_request:
workflow_dispatch:

env:
GO_VERSION: "1.22"

jobs:
release:
runs-on: personal
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Check & format go.mod
run: go mod tidy

# Run linter and tests

- name: Check GoReleaser requirements
uses: goreleaser/goreleaser-action@v6
with:
version: '~> v2'
args: healthcheck

- name: Validate .goreleaser.yaml
uses: goreleaser/goreleaser-action@v6
with:
version: '~> v2'
args: check
21 changes: 1 addition & 20 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
name: release
name: Release

on:
push:
branches:
- 'master'
tags:
- '*'
pull_request:
workflow_dispatch:

permissions:
contents: write
Expand All @@ -29,28 +25,13 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}

- name: Check & format go.mod
run: go mod tidy

- name: Login to Docker Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Check GoReleaser requirements
uses: goreleaser/goreleaser-action@v6
with:
version: '~> v2'
args: healthcheck

- name: Validate .goreleaser.yaml
uses: goreleaser/goreleaser-action@v6
with:
version: '~> v2'
args: check

- name: Release binaries
if: success() && startsWith(github.ref, 'refs/tags/')
uses: goreleaser/goreleaser-action@v6
Expand Down
Empty file added .golangci.yaml
Empty file.

0 comments on commit ab359c4

Please sign in to comment.