forked from ovn-org/libovsdb
-
Notifications
You must be signed in to change notification settings - Fork 1
97 lines (76 loc) · 2.12 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
name: libovsdb-ci
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
name: Build & Unit Test
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.18
uses: actions/setup-go@v2
with:
go-version: 1.18
id: go
- name: Install benchstat
run: go install golang.org/x/perf/cmd/benchstat@latest
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Generate Code
run: make prebuild
# This cannot be run in parallel because we require running go-generate first
# We need to skip the go installation and caching to avoid "File exists" errors in tbe logs
- name: Lint
run: make lint
- name: Build
run: make build
- name: Test
run: make test
- name: Test
run: make integration-test
- name: Generate coverage
run: make coverage
- name: Upload test coverage
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: profile.cov
- name: Benchmark
run: make bench
- name: Restore Latest Main Benchmark
id: old-benchmark
uses: actions/cache@v2
with:
path: bench-main.out
key: benchmark-main-${{ hashfiles('**/*.go') }}
restore-keys: |
benchmark-main-
- name: Compare Benchmarks
if: hashFiles('bench-main.out') != ''
run: benchstat bench-main.out bench.out
- name: Create New Main Benchmark On Cache Miss
if: steps.old-benchmark.outputs.cache-hit != 'true' && github.ref == 'refs/heads/main'
run: cp -f bench.out bench-main.out
test:
name: Integration Test
needs: build
strategy:
matrix:
ovs_version:
- 2.15.0
- 2.14.0
- 2.13.0
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.18
uses: actions/setup-go@v1
with:
go-version: 1.18
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Integration Test
run: make integration-test
env:
OVS_IMAGE_TAG: ${{ matrix.ovs_version }}