0g-chain/.github/workflows/ci-lint.yml

32 lines
998 B
YAML
Raw Normal View History

2022-11-30 22:32:06 +00:00
name: Lint Checks
on:
workflow_call:
# run per commit ci checks against this commit
jobs:
proto-lint:
uses: ./.github/workflows/proto.yml
golangci-lint:
runs-on: ubuntu-latest
permissions:
checks: write # allow write access to checks to allow the action to annotate code in the PR.
2022-11-30 22:32:06 +00:00
steps:
- name: Checkout code
uses: actions/checkout@v4
with: { fetch-depth: 0 }
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: Load Version
id: load-version
run: |
GOLANGCI_VERSION=$(cat .golangci-version)
REV=$(git merge-base origin/master HEAD)
echo "GOLANGCI_VERSION=$GOLANGCI_VERSION" >> $GITHUB_ENV
echo "REV=$REV" >> $GITHUB_ENV
2022-11-30 22:32:06 +00:00
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
2022-11-30 22:32:06 +00:00
with:
version: ${{ env.GOLANGCI_VERSION }}
args: -v -c .golangci.yml --new-from-rev ${{ env.REV }}