Skip to content

Commit

Permalink
ci: add main ci workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
luissimas committed Jun 20, 2024
1 parent bfe303e commit e545501
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Main

on:
push:
branches:
- "main"
tags:
- "v*"
pull_request:
branches:
- "main"

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Build
run: make build
format:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Format
run: test -z "$(make format -s)"
check-mod:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Mod tidy
run: |
go mod tidy && git diff --exit-code
lint:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Vet
run: make vet
- name: Lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.58
test:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Test
run: make test

0 comments on commit e545501

Please sign in to comment.