mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-25 15:55:18 +00:00
b0d737d354
* update golinter + add go sec * add golangci.yml Co-authored-by: @faddat jacobgadikian@gmail.com * update * update * fix release version * remove sec, update from pr comments, cleanup golangci.yml to not break on master * remove @faddat, not valid codeowner * remove unnecessary make command * remove incorrectly named golangci.yml file * add --new-from-rev * use master instead of main * remove extra echo * set the exports properly * add setup go to work with act * add some docs to golangci linter * test new-from-rev * enable more linters, but app.go back * verify issues-exit-code being gone * put it back * enable more linters * remove exclusions
32 lines
998 B
YAML
32 lines
998 B
YAML
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.
|
|
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
|
|
- name: golangci-lint
|
|
uses: golangci/golangci-lint-action@v6
|
|
with:
|
|
version: ${{ env.GOLANGCI_VERSION }}
|
|
args: -v -c .golangci.yml --new-from-rev ${{ env.REV }}
|