-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (68 loc) · 2.05 KB
/
unittest-operator.yaml
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
name: Perform unittest for operator
on:
pull_request:
paths:
- api/**
- controllers/**
- ./main.go
- ./go.mod
- ./go.sum
- config/**
push:
paths:
- api/**
- controllers/**
- ./main.go
- ./go.mod
- ./go.sum
- config/**
jobs:
operator-test:
env:
CLUSTER_ID: default
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.21'
- name: set ARCH and OD
run: |
echo "ARCH=$(case $(uname -m) in x86_64) echo -n amd64 ;; aarch64) echo -n arm64 ;; *) echo -n $(uname -m) ;; esac)" >> $GITHUB_ENV
echo "OS=$(uname | awk '{print tolower($0)}')" >> $GITHUB_ENV
echo "OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.23.0" >> $GITHUB_ENV
- name: download operator-sdk
run: curl -LO ${{ env.OPERATOR_SDK_DL_URL }}/operator-sdk_${{ env.OS }}_${{ env.ARCH }}
- name: move operator-sdk to binary path
run: chmod +x operator-sdk_${{ env.OS }}_${{ env.ARCH }} && sudo mv operator-sdk_${{ env.OS }}_${{ env.ARCH }} /usr/local/bin/operator-sdk
- name: Tidy
run: |
go mod tidy
- name: Make bundle
run: make bundle
- name: Test Controller
run: make operator-test
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
name: operator-code-coverage-report
path: operator-cover.html
device-plugin-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.21'
- name: Tidy
run: |
go mod tidy
- name: Make generate
run: make generate
- name: Test Uploader
run: make dp-test
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
name: device-plugin-code-coverage-report
path: dp-cover.html