Skip to content

Remove unnecessary changes #6735

Remove unnecessary changes

Remove unnecessary changes #6735

Workflow file for this run

name: Go CI
on:
workflow_dispatch:
push:
env:
GOPRIVATE: "github.com/sourcegraph/*"
PRIVATE_TOKEN: "${{ secrets.PRIVATE_SG_ACCESS_TOKEN }}"
jobs:
go-test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Go version from mise
id: mise
run: echo "go-version=$(grep 'golang' mise.toml | cut -d'"' -f2)" >> $GITHUB_OUTPUT
shell: bash
- name: Set up Go
uses: actions/setup-go@v6
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 ./...
# This job provides a stable name for branch protection rules
# It will only pass if all Go CI matrix tests above pass
go-test-complete:
runs-on: ubuntu-latest
needs: go-test
if: always()
steps:
- name: Check Go CI results
run: |
if [[ "${{ needs.go-test.result }}" != "success" ]]; then
echo "One or more Go CI tests failed"
exit 1
fi
echo "All Go CI tests passed"