-
Notifications
You must be signed in to change notification settings - Fork 29
103 lines (88 loc) · 2.65 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
check:
name: Project checks
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- name: Check out code
uses: actions/checkout@v3
with:
path: src/github.com/containerd/protobuild
fetch-depth: 25
- name: Project checks
uses: containerd/[email protected]
with:
working-directory: src/github.com/containerd/protobuild
test:
name: Test
strategy:
matrix:
os: [ ubuntu-22.04, windows-2022 ]
fail-fast: false
runs-on: ${{ matrix.os }}
timeout-minutes: 5
steps:
- name: Check out code
uses: actions/checkout@v3
with:
path: src/github.com/containerd/protobuild
fetch-depth: 25
- name: Setup environment
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- name: Check out code
uses: actions/checkout@v3
with:
path: src/github.com/containerd/protobuild
- name: Test
working-directory: src/github.com/containerd/protobuild
run: |
go test
v2:
name: Run with protoc-gen-go v1.26
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.16.x
id: go
- name: Setup environment
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- name: Check out code
uses: actions/checkout@v3
with:
path: src/github.com/containerd/protobuild
- name: Build
working-directory: src/github.com/containerd/protobuild
run: |
go build .
- name: Install protoc
run: |
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.18.1/protoc-3.18.1-linux-x86_64.zip
sudo unzip -x protoc-3.18.1-linux-x86_64.zip -d /usr/local
sudo chmod -R go+rX /usr/local/include
sudo chmod go+x /usr/local/bin/protoc
- name: Install protoc-gen-go and protoc-gen-go-grpc
run: |
go install google.golang.org/protobuf/cmd/[email protected]
go install google.golang.org/grpc/cmd/[email protected]
- name: Run protobuild to see all committed auto-generated files can be generated as is
working-directory: src/github.com/containerd/protobuild
run: |
rm examples/v2/*.pb.*
export PATH=$(go env GOBIN):$PATH
./protobuild github.com/containerd/protobuild/examples/v2
git diff --exit-code