Skip to content

Ray cli

Ray cli #34

Workflow file for this run

name: golangci-lint
on:
push:
branches:
- master
- main
pull_request:
permissions:
contents: read
pull-requests: read
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22"
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: v1.56
args: --out-format=line-number
verify-go-mod:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.22
cache: false
- name: Run go mod tidy
run: |
go mod tidy
- name: Verify
shell: bash
run: |
# From: https://backreference.org/2009/12/23/how-to-match-newlines-in-sed/
# This is to leverage this workaround:
# https://github.com/actions/toolkit/issues/193#issuecomment-605394935
urlencode() {
sed ':begin;$!N;s/\n/%0A/;tbegin'
}
if [ -z "$(git status --porcelain)" ]; then
echo "${{ github.repository }} up to date."
else
echo "Found diffs in: $(git diff-index --name-only HEAD)"
for x in $(git diff-index --name-only HEAD); do
echo "::error file=$x::Please run 'go mod tidy'.%0A$(git diff $x | urlencode)"
done
echo "${{ github.repository }} is out of date. Please run 'go mod tidy'"
exit 1
fi