Docker file #10
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: Peer Review | |
on: | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
name: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go 1.21 | |
uses: actions/setup-go@v1 | |
with: | |
go-version: 1.21 | |
id: go | |
- name: checkout code | |
uses: actions/checkout@v2 | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: get dependencies | |
run: go mod tidy | |
- name: run test cases | |
run: go test --race -v ./... | { grep -v 'no test files'; true; } | |
- name: install golangci-lint | |
run: | | |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.56.2 | |
- name: fetch repository changes | |
run: | | |
git fetch | |
- name: run golangci-lint | |
run: | | |
$(go env GOPATH)/bin/golangci-lint run --config .github/configs/.golangci.yml --issues-exit-code=0 --out-format=json --new-from-rev=origin/main --timeout=3m > lint.json | |
jq '[.Issues[] | {path: .Pos.Filename, start_line: .Pos.Line, end_line: .Pos.Line, start_column: .Pos.Column, end_column: .Pos.Column , title: .FromLinter, message: .Text, raw_details: .Text, "annotation_level": "failure"}]' lint.json > ./annotations.json | |
cat ./annotations.json | |
- name: annotate | |
uses: yuzutech/[email protected] | |
with: | |
repo-token: "${{ secrets.GITHUB_TOKEN }}" | |
input: ./annotations.json |