forked from Azure/aks-app-routing-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (55 loc) · 1.95 KB
/
unit.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
name: Unit Tests
on:
workflow_call:
inputs:
checkout_ref:
type: string
required: true
status_ref:
type: string
required: true
env:
status-name: unit-tests
jobs:
unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{ inputs.checkout_ref }}
- uses: ./.github/actions/start-status
with:
name: ${{ env.status-name }}
ref: ${{ inputs.status_ref }}
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version: '~1.22'
cache-dependency-path: "**/*.sum"
- name: Create kubebuilder directory
# The default location for the etcd and kube-apiserver binaries is /kubebuilder/bin
run: sudo mkdir -p /usr/local/kubebuilder/bin
- name: Install etcd
run: |
wget -q https://github.com/etcd-io/etcd/releases/download/v3.5.0/etcd-v3.5.0-linux-amd64.tar.gz
tar xzf etcd-v3.5.0-linux-amd64.tar.gz
sudo mv etcd-v3.5.0-linux-amd64/etcd /usr/local/kubebuilder/bin/
- name: Install kube-apiserver
run: |
wget -q https://storage.googleapis.com/kubernetes-release/release/v1.22.2/bin/linux/amd64/kube-apiserver
chmod +x kube-apiserver
sudo mv kube-apiserver /usr/local/kubebuilder/bin/
- name: Run Unit Tests
run: go test -race -v ./... -coverprofile=coverage.out
- name: Convert coverage to lcov
uses: jandelgado/gcov2lcov-action@c680c0f7c7442485f1749eb2a13e54a686e76eb5 #v1.0.8
- name: Coveralls
uses: coverallsapp/github-action@95b1a2355bd0e526ad2fd62da9fd386ad4c98474 #v2.2.1
with:
flag-name: unit-test
path-to-lcov: coverage.lcov
git-commit: ${{ inputs.status_ref }}
- if: always()
uses: ./.github/actions/end-status
with:
name: ${{ env.status-name }}
ref: ${{ inputs.status_ref }}