Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/sg-ci-go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: SG CI - Go
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable
- name: gofmt
run: |
out=$(gofmt -l .)
if [ -n "$out" ]; then echo "Unformatted files:"; echo "$out"; exit 1; fi
- name: go vet and build (per module)
run: |
set -e
mods=$(find . -name go.mod -not -path '*/vendor/*')
if [ -z "$mods" ]; then echo "no go.mod found; nothing to vet/build"; exit 0; fi
for mod in $mods; do
dir=$(dirname "$mod")
echo "=== $dir ==="
(cd "$dir" && go vet ./... && go build ./...)
done
code-intel:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable
- name: Generate SCIP index (gate)
uses: sourcegraph/scip-go-action@v2
with:
upload: false
recursive: true
- name: Upload SCIP index (best-effort)
continue-on-error: true
env:
SRC_ENDPOINT: https://demo.sourcegraph.com
SRC_ACCESS_TOKEN: ${{secrets.SRC_ACCESS_TOKEN}}
run: |
curl -sfL https://demo.sourcegraph.com/.api/src-cli/src_linux_amd64 -o /usr/local/bin/src
chmod +x /usr/local/bin/src
find . -name index.scip -print0 | while IFS= read -r -d '' f; do
echo "Uploading $f"
(cd "$(dirname "$f")" && src code-intel upload -file=index.scip -no-progress) || echo "upload failed for $f (non-blocking)"
done
Loading