forked from golang/glog
-
Notifications
You must be signed in to change notification settings - Fork 218
46 lines (46 loc) · 1.27 KB
/
test.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Test
on: [push, pull_request]
jobs:
test:
strategy:
matrix:
go-version: ["1.18", "1.19", "1.20", "1.21"]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v4
- name: Test klog
run: |
go get -t -v ./...
go test -v -race ./...
- name: Test examples
run: cd examples && go test -v -race ./...
apidiff:
runs-on: ubuntu-latest
if: github.base_ref
steps:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: 1.21
- name: Add GOBIN to PATH
run: echo "PATH=$(go env GOPATH)/bin:$PATH" >>$GITHUB_ENV
- name: Install dependencies
run: GO111MODULE=off go get golang.org/x/exp/cmd/apidiff
- name: Checkout old code
uses: actions/checkout@v4
with:
ref: ${{ github.base_ref }}
path: "old"
- name: Checkout new code
uses: actions/checkout@v4
with:
path: "new"
- name: APIDiff
run: ./hack/verify-apidiff.sh -d ../old
working-directory: "new"