chore(deps): update golangci/golangci-lint-action action to v4 #217
Workflow file for this run
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: CI | |
on: | |
workflow_dispatch: | |
push: | |
pull_request: | |
permissions: | |
contents: read | |
jobs: | |
lint-go: | |
name: Lint go code | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.18" | |
- name: Run golangci-lint | |
uses: golangci/golangci-lint-action@v4 | |
with: | |
version: v1.56.1 | |
- name: Run goreleaser check | |
uses: goreleaser/goreleaser-action@v5 | |
with: | |
args: check | |
lint-dockerfile: | |
name: Lint dockerfile | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install hadolint | |
env: | |
HADOLINT_VERSION: "2.12.0" | |
run: | | |
curl -SL "https://github.com/hadolint/hadolint/releases/download/v${HADOLINT_VERSION}/hadolint-Linux-$(uname -m)" \ | |
-o /usr/local/bin/hadolint \ | |
&& chmod +x /usr/local/bin/hadolint | |
- name: Run hadolint | |
run: hadolint Dockerfile | |
lint-commit: | |
name: Lint commit messages | |
runs-on: ubuntu-latest | |
if: github.event_name == 'pull_request' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Install commitlint | |
env: | |
COMMITLINT_CLI_VERSION: "18.6.0" | |
COMMITLINT_CONFIG_CONVENTIONAL_VERSION: "18.6.0" | |
run: | | |
npm install -g \ | |
"@commitlint/cli@${COMMITLINT_CLI_VERSION}" \ | |
"@commitlint/config-conventional@${COMMITLINT_CONFIG_CONVENTIONAL_VERSION}" | |
- name: Run commitlint | |
run: | | |
commitlint --verbose \ | |
--from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} \ | |
--to ${{ github.event.pull_request.head.sha }} | |
test: | |
name: Test | |
strategy: | |
matrix: | |
go-version: | |
- "1.20" | |
- "1.19" | |
- "1.18" | |
platform: | |
- ubuntu-latest | |
- windows-latest | |
- macos-latest | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Install gotestsum | |
run: go install gotest.tools/gotestsum@latest | |
- name: Run gotestsum | |
run: | | |
go clean -testcache | |
gotestsum ./... -- --race | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.20" | |
- name: Run goreleaser | |
uses: goreleaser/goreleaser-action@v5 | |
with: | |
args: release --clean --snapshot |