This repository has been archived by the owner on Oct 28, 2024. It is now read-only.
Merge pull request #2 from Szzrain/ci/review_dog #8
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: Test & Lint | |
on: | |
push: | |
paths: | |
- '**.go' | |
- 'go.mod' | |
- '.github/workflows/reviewdog.yml' | |
pull_request_target: | |
paths: | |
- '**.go' | |
- 'go.mod' | |
- '.github/workflows/reviewdog.yml' | |
jobs: | |
review-dog: | |
permissions: | |
checks: write | |
contents: read | |
pull-requests: write | |
name: Review Dog | |
runs-on: ubuntu-latest | |
steps: | |
- name: Code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22' | |
cache: false | |
- run: go get | |
- run: go generate ./... | |
- name: Set Up Golint | |
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.61.0 | |
- uses: reviewdog/action-setup@v1 | |
with: | |
reviewdog_version: latest | |
- name: Run golang-ci & reviewdog | |
env: | |
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
golangci-lint run | reviewdog -reporter=github-pr-review -f=golangci-lint |