-
Notifications
You must be signed in to change notification settings - Fork 62
32 lines (30 loc) · 1.06 KB
/
go-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: Go CI
on:
workflow_dispatch:
push:
env:
GOPRIVATE: "github.com/sourcegraph/*"
PRIVATE_TOKEN: "${{ secrets.PRIVATE_SG_ACCESS_TOKEN }}"
jobs:
go-test:
strategy:
matrix:
go-version: [1.22.8]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.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 ./...