-
Notifications
You must be signed in to change notification settings - Fork 148
87 lines (75 loc) · 2.47 KB
/
buildtest.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
#Originally from https://raw.githubusercontent.com/intel/multus-cni/master/.github/workflows/go-build-test-amd64.yml
name: Go-build-and-test-amd64
on:
push:
pull_request:
schedule:
- cron: "0 8 * * 0" # every sunday
jobs:
build-test:
strategy:
matrix:
go-version: [1.22.x]
os: [ubuntu-latest]
goos: [linux]
goarch: [amd64, arm64, ppc64le]
runs-on: ${{ matrix.os }}
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Build test for ${{ matrix.goarch }}
env:
GOARCH: ${{ matrix.goarch }}
GOOS: ${{ matrix.goos }}
run: GOARCH="${TARGET}" make build
- name: Go test
if: ${{ matrix.goarch }} == "amd64"
run: sudo make test-race # sudo needed for netns change in test
coverage:
runs-on: ubuntu-latest
needs: build-test
name: coverage
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.22.x
- name: Check out code
uses: actions/checkout@v3
- name: Go test with coverage
run: sudo make test-coverage # sudo needed for netns change in test
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: test/coverage/cover.out
sriov-operator-e2e-test:
name: SR-IOV operator e2e tests
needs: [ build-test ]
runs-on: [ sriov ]
env:
TEST_REPORT_PATH: k8s-artifacts
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: build sriov-cni image
run: podman build -t ghaction-sriov-cni:pr-${{github.event.pull_request.number}} .
- name: Check out sriov operator's code
uses: actions/checkout@v2
with:
repository: k8snetworkplumbingwg/sriov-network-operator
path: sriov-network-operator-wc
- name: run test
run: make test-e2e-conformance-virtual-k8s-cluster-ci
working-directory: sriov-network-operator-wc
env:
LOCAL_SRIOV_CNI_IMAGE: ghaction-sriov-cni:pr-${{github.event.pull_request.number}}
- uses: actions/upload-artifact@v3
if: always()
with:
name: ${{ env.TEST_REPORT_PATH }}
path: ./sriov-network-operator-wc/${{ env.TEST_REPORT_PATH }}