Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 1 addition & 11 deletions .github/workflows/go-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ name: Go CI
on:
workflow_dispatch:
push:
env:
GOPRIVATE: "github.com/sourcegraph/*"
PRIVATE_TOKEN: "${{ secrets.PRIVATE_SG_ACCESS_TOKEN }}"

jobs:
go-test:
strategy:
Expand All @@ -21,15 +17,9 @@ jobs:
run: echo "go-version=$(grep 'golang' mise.toml | cut -d'"' -f2)" >> $GITHUB_OUTPUT
shell: bash
- name: Set up Go
uses: actions/setup-go@v6
uses: sourcegraph/actions/go-setup@main
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we have our own action?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mainly for easier private go module setup (even though we do not use it here), but it also makes it easier to update setup-go / checkout at a central place instead of across repositories.

with:
go-version: ${{ steps.mise.outputs.go-version }}
- name: (Windows) Enable pulling Go modules from private sourcegraph/sourcegraph
if: runner.os == 'Windows'
run: git config --global url."https://$env:PRIVATE_TOKEN@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/"
- name: (Default) Enable pulling Go modules from private sourcegraph/sourcegraph
if: runner.os != 'Windows'
run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/"
- run: |
go test -race -v ./...
go test -v ./...
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/go-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ name: Go Lint
on:
workflow_dispatch:
push:
env:
GOPRIVATE: "github.com/sourcegraph/*"
PRIVATE_TOKEN: "${{ secrets.PRIVATE_SG_ACCESS_TOKEN }}"

jobs:
go-lint:
Expand All @@ -17,9 +14,7 @@ jobs:
id: mise
run: echo "go-version=$(grep 'golang' mise.toml | cut -d'"' -f2)" >> $GITHUB_OUTPUT
- name: Set up Go
uses: actions/setup-go@v6
uses: sourcegraph/actions/go-setup@main
with:
go-version: ${{ steps.mise.outputs.go-version }}
- name: Enable pulling Go modules from private sourcegraph/sourcegraph
run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/"
- run: ./dev/go-lint.sh
8 changes: 1 addition & 7 deletions .github/workflows/goreleaser-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ name: GoReleaser check
on:
push:
workflow_dispatch:
env:
GOPRIVATE: "github.com/sourcegraph/*"
PRIVATE_TOKEN: "${{ secrets.PRIVATE_SG_ACCESS_TOKEN }}"

jobs:
goreleaser:
name: check
Expand All @@ -20,11 +16,9 @@ jobs:
id: mise
run: echo "go-version=$(grep 'golang' mise.toml | cut -d'"' -f2)" >> $GITHUB_OUTPUT
- name: Set up Go
uses: actions/setup-go@v6
uses: sourcegraph/actions/go-setup@main
with:
go-version: ${{ steps.mise.outputs.go-version }}
- name: Enable pulling Go modules from private sourcegraph/sourcegraph
run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/"
- name: Check GoReleaser config
uses: goreleaser/goreleaser-action@v5
with:
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ on:
push:
tags:
- '*'
env:
GOPRIVATE: "github.com/sourcegraph/*"
PRIVATE_TOKEN: "${{ secrets.PRIVATE_SG_ACCESS_TOKEN }}"

# There are two cases where this GitHub action will run:
#
# 1. We are releasing a new latest version for src-cli, as a major, minor, or patch
Expand Down Expand Up @@ -182,11 +178,9 @@ jobs:
id: mise
run: echo "go-version=$(grep 'golang' mise.toml | cut -d'"' -f2)" >> $GITHUB_OUTPUT
- name: Set up Go
uses: actions/setup-go@v6
uses: sourcegraph/actions/go-setup@main
with:
go-version: ${{ steps.mise.outputs.go-version }}
- name: Enable pulling Go modules from private sourcegraph/sourcegraph
run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/"
- run: go test ./...
- run: go test -race -v ./...
- run: echo "${DOCKER_PASSWORD}" | docker login -u=$DOCKER_USERNAME --password-stdin
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/scip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: SCIP
on:
workflow_dispatch:
push:
env:
GOPRIVATE: "github.com/sourcegraph/*"
PRIVATE_TOKEN: "${{ secrets.PRIVATE_SG_ACCESS_TOKEN }}"
jobs:
scip-go:
runs-on: ubuntu-latest
Expand All @@ -15,7 +12,7 @@ jobs:
id: mise
run: echo "go-version=$(grep 'golang' mise.toml | cut -d'"' -f2)" >> $GITHUB_OUTPUT
- name: Set up Go
uses: actions/setup-go@v6
uses: sourcegraph/actions/go-setup@main
with:
go-version: ${{ steps.mise.outputs.go-version }}

Expand All @@ -25,9 +22,6 @@ jobs:
- name: Build src-cli
run: go build -o ./src-cli ./cmd/src

- name: Enable pulling Go modules from private sourcegraph/sourcegraph
run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/"

- name: Generate SCIP data
run: scip-go

Expand Down
2 changes: 1 addition & 1 deletion dev/golangci-lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pushd "$(dirname "${BASH_SOURCE[0]}")/.." >/dev/null

mkdir -p dev/.bin

version="2.6.1"
version="2.10.1"
suffix="${version}-$(go env GOOS)-$(go env GOARCH)"
target="$PWD/dev/.bin/golangci-lint-${suffix}"
url="https://github.com/golangci/golangci-lint/releases/download/v${version}/golangci-lint-${suffix}.tar.gz"
Expand Down
6 changes: 3 additions & 3 deletions internal/batches/executor/run_steps.go
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ func (e stepFailedErr) Error() string {
return lines[0] + fmt.Sprintf("\n\t(... and %d more lines)", len(lines)-1)
}

out.WriteString(fmt.Sprintf("run: %s\ncontainer: %s\n", fmtRun(e.Run), e.Container))
fmt.Fprintf(&out, "run: %s\ncontainer: %s\n", fmtRun(e.Run), e.Container)

printOutput := func(output string) {
for line := range strings.SplitSeq(output, "\n") {
Expand All @@ -682,9 +682,9 @@ func (e stepFailedErr) Error() string {
}

if e.ExitCode != -1 {
out.WriteString(fmt.Sprintf("\nCommand failed with exit code %d.", e.ExitCode))
fmt.Fprintf(&out, "\nCommand failed with exit code %d.", e.ExitCode)
} else {
out.WriteString(fmt.Sprintf("\nCommand failed: %s", e.Err))
fmt.Fprintf(&out, "\nCommand failed: %s", e.Err)
}

return out.String()
Expand Down
2 changes: 1 addition & 1 deletion mise.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[tools]
golang = "1.25.4"
golang = "1.26.0"
shfmt = "3.8.0"
shellcheck = "0.10.0"
Loading