name: ci-ristretto-lint
on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main
  schedule:
    - cron: "1 * * * *"
jobs:
  go-lint:
    if: github.event.pull_request.draft == false
    name: lint
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v3
      - name: Get Go Version
        run: |
          #!/bin/bash
          GOVERSION=$({ [ -f .go-version ] && cat .go-version; })
          echo "GOVERSION=$GOVERSION" >> $GITHUB_ENV
      - name: Setup Go
        uses: actions/setup-go@v3
        with:
          go-version: ${{ env.GOVERSION }}
      - name: golang-lint
        env:
          # prevent OOM
          GOGC: 10
        uses: golangci/golangci-lint-action@v3
        with:
          version: latest
          only-new-issues: true
          args: --timeout=10m
