Skip to content

fix: fix labsdk bugs (#320) #125

fix: fix labsdk bugs (#320)

fix: fix labsdk bugs (#320) #125

Workflow file for this run

name: Go Lint
# Trigger the workflow on pull requests and direct pushes to any branch
on:
push:
paths:
- '**.go'
pull_request:
types: [ opened, synchronize ]
paths:
- '**.go'
jobs:
lint:
name: golangci-lint
runs-on: ubuntu-latest
# Pull requests from the same repository won't trigger this checks as they were already triggered by the push
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
steps:
- name: Setup Go environment
uses: actions/setup-go@v5
with:
go-version: '^1.21'
- name: Clone the code
uses: actions/checkout@v4
- name: Cache go dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Generate necessary files
run: make generate
shell: bash
- name: Run linter
uses: golangci/golangci-lint-action@v3
with:
version: latest # Always uses the latest patch version.
only-new-issues: true # Show only new issues if it's a pull request
skip-pkg-cache: true
skip-build-cache: true
args: --timeout=5m
- name: Report failure
if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: actions-cool/issues-helper@v3
with:
actions: 'create-issue'
token: ${{ secrets.GITHUB_TOKEN }}
title: 🐛 Lint failed for ${{ github.sha }}
body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
labels: bug