generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 16
71 lines (63 loc) · 1.64 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: ci-pipeline
on:
push:
branches: [ "*" ]
pull_request:
branches: [ "*" ]
jobs:
ci:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '', '1.x' ] # '' uses go.mod, 1.x uses latest go
steps:
- uses: actions/checkout@v2
with:
path: src/sigs.k8s.io/json/
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: 'src/sigs.k8s.io/json/go.mod'
go-version: ${{ matrix.go }}
check-latest: true
- name: Test
run: |
cd ${GITHUB_WORKSPACE}/src/sigs.k8s.io/json/
make test
- name: Benchmark
run: |
cd ${GITHUB_WORKSPACE}/src/sigs.k8s.io/json/
make benchmark
- name: Vet
run: |
cd ${GITHUB_WORKSPACE}/src/sigs.k8s.io/json/
make vet
- name: fmt
run: |
cd ${GITHUB_WORKSPACE}/src/sigs.k8s.io/json/
make fmt
git diff --exit-code
apidiff:
runs-on: ubuntu-latest
if: github.base_ref
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version-file: 'src/sigs.k8s.io/json/go.mod'
- name: Add GOBIN to PATH
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Install dependencies
run: go install golang.org/x/exp/cmd/apidiff@latest
- name: Checkout old code
uses: actions/checkout@v2
with:
ref: ${{ github.base_ref }}
path: "old"
- name: Checkout new code
uses: actions/checkout@v2
with:
path: "new"
- name: APIDiff
run: ./hack/verify-apidiff.sh -d ../old
working-directory: "new"