Merge pull request #1 from kaptinlin/dependabot/go_modules/github.com… #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Go | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.22.x | |
- name: Download dependencies | |
run: go mod download | |
- name: Run unit tests | |
run: make test | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.22.x | |
- name: Read golangci-lint version from .golangci.version | |
id: golangci-version | |
run: echo "GOLANGCI_VERSION=$(cat .golangci.version)" > $GITHUB_OUTPUT | |
- uses: golangci/golangci-lint-action@v4 | |
name: Install and run golangci-lint | |
with: | |
version: v${{ steps.golangci-version.outputs.GOLANGCI_VERSION }} | |
args: -h | |
- run: make lint | |
name: Lint |