This repository has been archived by the owner on Dec 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
99 lines (86 loc) · 3.21 KB
/
kind.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
---
name: "KinD"
on: # yamllint disable-line rule:truthy
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '* 8 * * *'
workflow_dispatch:
inputs:
image:
description: 'Custom edgedevice testing image'
default: 'quay.io/project-flotta/edgedevice:latest'
required: true
artifact_url:
description: 'Custom edgedevice testing flotta-agent rpm artifact URL'
jobs:
kind:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@master
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
# Temporarly workaround: https://github.com/actions/virtual-environments/issues/5490
- name: Restart docker
run: |
sudo rm /etc/docker/daemon.json
sudo systemctl restart docker
docker system info
- uses: satackey/[email protected]
continue-on-error: true
- uses: engineerd/[email protected]
with:
version: "v0.11.1"
config: hack/kind-config.yaml
- name: Download custom RPM
if: ${{ github.event.inputs.artifact_url != '' }}
run: >
ARTIFACT_ID=`basename "${{ github.event.inputs.artifact_url }}"`
curl -L -H "Authorization: Bearer ${{ secrets.TOKEN }}" -H "Accept: application/vnd.github.v3+json"
https://api.github.com/repos/project-flotta/flotta-device-worker/actions/artifacts/$ARTIFACT_ID/zip
-o my.zip
unzip my -d /var/tmp/flotta
- name: Prepare KinD
run: |
# Print cluster info
kubectl cluster-info
kubectl get pods -n kube-system
kubectl wait --for=condition=Ready pods --all -n kube-system
make install-router
# Deploy flotta operator
sed -i 's/LOG_LEVEL=info/LOG_LEVEL=debug/g' config/manager/controller_manager_config.properties
make build
IMG=flotta-operator:latest HTTP_IMG=flotta-edge-api:latest make docker-build
kind load docker-image flotta-operator:latest
kind load docker-image flotta-edge-api:latest
timeout 2m make deploy IMG=flotta-operator:latest HTTP_IMG=flotta-edge-api:latest TARGET=k8s || retVal=$?
if [[ -n "$retVal" && $retVal -ne 124 ]]; then
echo "Make run failed"; exit 1
fi
kubectl wait --timeout=120s --for=condition=Ready pods --all -n flotta
- name: Testing on KinD
run: |
# Run test
INPUT_IMAGE="${{ github.event.inputs.image }}"
if [ -n "${{ github.event.inputs.artifact_url }}" ]; then
export TEST_RPM=/var/tmp/flotta/`ls /var/tmp/flotta/ | grep race`
fi
TEST_IMAGE="${INPUT_IMAGE:-quay.io/project-flotta/edgedevice:latest}" make integration-test
# collect logs always just in case the test fails
- name: Collect all logs
if: always()
run: |
# Just dump the secrets to debug later
kubectl get secrets -n flotta -o json
kind export logs dist
- name: Archive logs
uses: actions/upload-artifact@v2
if: always()
with:
name: logs
path: |
dist