Skip to content

ci: propagate HF_TOKEN to e2e tests to avoid HF Hub rate limits (#1572) #15

ci: propagate HF_TOKEN to e2e tests to avoid HF Hub rate limits (#1572)

ci: propagate HF_TOKEN to e2e tests to avoid HF Hub rate limits (#1572) #15

Workflow file for this run

name: CI - Lint
on:
push:
branches:
- main
- 'release-*'
pull_request:
branches:
- main
pull_request_target:
branches:
- main
types: [ opened, synchronize, reopened ]
permissions:
contents: read
actions: read
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
check-changes:
# pull_request_target fires even when GITHUB_TOKEN creates the PR (e.g. the
# release-notes bot). pull_request does not. We register pull_request_target
# so bot-created PRs get a "skipped" conclusion that satisfies branch
# protection, but we skip all real work: pull_request already covers human
# PRs, and running twice would cause the concurrency group to cancel one run.
if: github.event_name != 'pull_request_target'
runs-on: ubuntu-latest
outputs:
src: ${{ steps.filter.outputs.src }}
steps:
- name: Checkout source
uses: actions/checkout@v6
- uses: dorny/paths-filter@v4
id: filter
with:
filters: |
src:
- '**/*.go'
- Dockerfile.*
- Makefile*
- go.mod
- go.sum
- .golangci.yml
- .typos.toml
- scripts/**
- hack/**
- test/**
- .github/workflows/ci-lint.yaml
lint:
needs: check-changes
if: ${{ needs.check-changes.outputs.src == 'true' }}
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout source
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: Verify go.mod and go.sum are tidy
run: go mod tidy -diff
- name: Create Go cache dirs
id: go-cache
run: |
mkdir -p "$HOME/.cache/llm-d-gomodcache" "$HOME/.cache/llm-d-gobuildcache"
echo "mod=$HOME/.cache/llm-d-gomodcache" >> "$GITHUB_OUTPUT"
echo "build=$HOME/.cache/llm-d-gobuildcache" >> "$GITHUB_OUTPUT"
- name: Cache Go modules and build cache
uses: actions/cache@v5
with:
path: |
${{ steps.go-cache.outputs.mod }}
${{ steps.go-cache.outputs.build }}
key: go-cache-${{ runner.os }}-${{ hashFiles('go.sum') }}
restore-keys: |
go-cache-${{ runner.os }}-
- name: Run make build
env:
GO_MOD_CACHE_VOL: ${{ steps.go-cache.outputs.mod }}
GO_BUILD_CACHE_VOL: ${{ steps.go-cache.outputs.build }}
run: make build
- name: Run make lint
env:
GO_MOD_CACHE_VOL: ${{ steps.go-cache.outputs.mod }}
GO_BUILD_CACHE_VOL: ${{ steps.go-cache.outputs.build }}
run: make lint
- name: Run govulncheck
run: |
go install golang.org/x/vuln/cmd/govulncheck@v1.3.0
govulncheck ./...