github.com/sagernet/sing-mux@v0.2.1-0.20240124034317-9bfb33698bb6/.github/workflows/lint.yml (about)

     1  name: Lint
     2  
     3  on:
     4    push:
     5      branches:
     6        - dev
     7      paths-ignore:
     8        - '**.md'
     9        - '.github/**'
    10        - '!.github/workflows/lint.yml'
    11    pull_request:
    12      branches:
    13        - dev
    14  
    15  jobs:
    16    build:
    17      name: Build
    18      runs-on: ubuntu-latest
    19      steps:
    20        - name: Checkout
    21          uses: actions/checkout@v3
    22          with:
    23            fetch-depth: 0
    24        - name: Get latest go version
    25          id: version
    26          run: |
    27            echo ::set-output name=go_version::$(curl -s https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json | grep -oE '"version": "[0-9]{1}.[0-9]{1,}(.[0-9]{1,})?"' | head -1 | cut -d':' -f2 | sed 's/ //g; s/"//g')
    28        - name: Setup Go
    29          uses: actions/setup-go@v4
    30          with:
    31            go-version: ${{ steps.version.outputs.go_version }}
    32        - name: Cache go module
    33          uses: actions/cache@v3
    34          with:
    35            path: |
    36              ~/go/pkg/mod
    37            key: go-${{ hashFiles('**/go.sum') }}
    38        - name: golangci-lint
    39          uses: golangci/golangci-lint-action@v3
    40          with:
    41            version: latest