-
Notifications
You must be signed in to change notification settings - Fork 28
144 lines (140 loc) · 6.04 KB
/
integration-tests.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
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
---
name: Integration tests
# yamllint disable-line rule:truthy
on:
workflow_call:
env:
KUBE_SSH_NODES: kind
defaults:
run:
shell: bash
jobs:
crd-e2e:
env:
KIND_NAME: kube
runs-on: core-e2e
steps:
- name: Cleanup build folder
run: |
sudo rm -rf ./* || true
sudo rm -rf ./.??* || true
- name: Setup GOPATH
run: echo "GOPATH=$GITHUB_WORKSPACE/go" >> $GITHUB_ENV
- name: Ensure GOPATH dirs
run: mkdir -p ${{ env.GOPATH }}/{src,bin,pkg}
- name: Checkout codebase
uses: actions/checkout@v4
with:
fetch-depth: 0
set-safe-directory: true
path: go/src/github.com/akash-network/provider
- name: Detect required Go version
working-directory: "${{ env.GOPATH }}/src/github.com/akash-network/provider"
run: |
toolchain=$(./script/tools.sh gotoolchain | sed 's/go*//')
echo "GOVERSION=${toolchain}" >> $GITHUB_ENV
- uses: actions/setup-go@v5
with:
go-version: "${{ env.GOVERSION }}"
- name: Install tools
run: |
curl -sfL https://direnv.net/install.sh | bash
go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest
- name: Hook direnv to bash
run: echo 'eval "$(direnv hook bash)"' >> $HOME/.bashrc
- name: Direnv allow
run: direnv allow ${{ env.GOPATH }}/src/github.com/akash-network/provider
- name: Checkout akash-api
working-directory: ${{ env.GOPATH }}/src/github.com/akash-network/provider
run: |
AKASH_API_VERSION=$(go list -mod=readonly -m -f '{{ .Version }}' github.com/akash-network/akash-api)
echo "AKASH_API_VERSION=$AKASH_API_VERSION" >> "$GITHUB_ENV"
- uses: actions/checkout@v4
with:
repository: "akash-network/akash-api"
fetch-depth: 0
set-safe-directory: true
path: go/src/github.com/akash-network/akash-api
ref: ${{ env.AKASH_API_VERSION }}
- name: Setup akash-api
run: |
direnv allow ${{ env.GOPATH }}/src/github.com/akash-network/akash-api
cd ${{ env.GOPATH }}/src/github.com/akash-network/akash-api
cat "$GITHUB_ENV" > "$GITHUB_WORKSPACE/env.backup"
direnv export gha >> "$GITHUB_ENV"
- name: Run modvendor on akash-api
working-directory: ${{ env.GOPATH }}/src/github.com/akash-network/akash-api
run: |
make modvendor
cat "$GITHUB_WORKSPACE/env.backup" > "$GITHUB_ENV"
- name: Setup direnv for provider
run: direnv export gha >> "$GITHUB_ENV"
working-directory: ${{ env.GOPATH }}/src/github.com/akash-network/provider
- name: Fetch kind version from go modules
working-directory: ${{ env.GOPATH }}/src/github.com/akash-network/provider
run: echo "KIND_VERSION=$(go list -mod=readonly -m -f '{{ .Version }}' sigs.k8s.io/kind)" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Go mod tidy
working-directory: ${{ env.GOPATH }}/src/github.com/akash-network/provider
run: go mod tidy
- name: Make node scripts executable
working-directory: ${{ env.GOPATH }}/src/github.com/akash-network/provider
run: make chmod-akash-scripts
- name: Setup kind
uses: helm/kind-action@v1
with:
version: "${{ env.KIND_VERSION }}"
node_image: "kindest/node:${{ env.KINDEST_VERSION }}"
cluster_name: "${{ env.KIND_NAME }}"
config: ${{ env.GOPATH }}/src/github.com/akash-network/provider/_run/kube/kind-config.yaml
- name: Configure Kind cluster
working-directory: ${{ env.GOPATH }}/src/github.com/akash-network/provider
run: |
KUSTOMIZE_INSTALLS=akash-operator-inventory make -s -C _run/kube kube-cluster-setup-e2e-ci
- name: Setup K8S ingress
working-directory: ${{ env.GOPATH }}/src/github.com/akash-network/provider
run: |
make -s -C _run/kube kind-k8s-ip
- name: K8S dump config
working-directory: ${{ env.GOPATH }}/src/github.com/akash-network/provider
run: |
kubectl config view
- name: K8S dump cluster info
working-directory: ${{ env.GOPATH }}/src/github.com/akash-network/provider
run: |
kubectl cluster-info
- name: K8S dump running pods
working-directory: ${{ env.GOPATH }}/src/github.com/akash-network/provider
run: |
kubectl get deployments,pods,ingress,svc -A
- name: K8S wait for operator inventory
working-directory: ${{ env.GOPATH }}/src/github.com/akash-network/provider
run: |
make -s -C _run/kube kube-deployment-rollout-operator-inventory
env:
KUBE_ROLLOUT_TIMEOUT: 360
- name: Run E2E Tests
working-directory: ${{ env.GOPATH }}/src/github.com/akash-network/provider
run: |
make test-e2e-integration
- name: Print operator inventory logs
if: always()
working-directory: ${{ env.GOPATH }}/src/github.com/akash-network/provider
run: |
kubectl -n akash-services logs -l app.kubernetes.io/part-of=provider,app.kubernetes.io/component=operator,app.kubernetes.io/instance=inventory-service,app.kubernetes.io/name=inventory
- name: Print operator inventory discovery logs
if: always()
working-directory: ${{ env.GOPATH }}/src/github.com/akash-network/provider
run: |
kubectl -n akash-services logs -l app.kubernetes.io/part-of=provider,app.kubernetes.io/component=operator,app.kubernetes.io/instance=inventory-hardware-discovery,app.kubernetes.io/name=inventory
- name: Run K8s Tests
working-directory: ${{ env.GOPATH }}/src/github.com/akash-network/provider
run: |
make test-k8s-integration
- name: Post-Run K8S environment
working-directory: ${{ env.GOPATH }}/src/github.com/akash-network/provider
run: |
kubectl get ns,pods,ingress,svc -A