-
Notifications
You must be signed in to change notification settings - Fork 113
136 lines (127 loc) · 5.12 KB
/
spineapp_sanity.yaml
File metadata and controls
136 lines (127 loc) · 5.12 KB
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
name: "[industrial-edge-insights-vision] Sanity Workflow"
on:
workflow_dispatch: # allows manual trigger
inputs:
branch:
description: "Branch to run job on"
required: false
default: "main"
workflow_call: # allows being called from another workflow
inputs:
branch:
description: "Branch to run job on"
required: false
type: string
jobs:
sanity:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
include:
- ubuntu_version: ubuntu22
steps:
- name: Determine branch
id: get_branch
run: |
if [ -n "${{ inputs.branch }}" ]; then
echo "branch=${{ inputs.branch }}" >> $GITHUB_OUTPUT
elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "branch=${{ github.event.inputs.branch }}" >> $GITHUB_OUTPUT
else
echo "branch=${{ github.ref_name }}" >> $GITHUB_OUTPUT
fi
- name: Check out edge-ai-suites repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #4.2.2
with:
persist-credentials: false
path: edge-ai-suites-repo
ref: ${{ steps.get_branch.outputs.branch }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install kubectl
uses: azure/setup-kubectl@v4
with:
version: v1.29.0
- name: Install Helm
uses: azure/setup-helm@v4
with:
version: v3.14.0
- name: Create KinD cluster
uses: helm/kind-action@v1
with:
cluster_name: ci-cluster
- name: Verify cluster
run: |
kubectl get nodes
kubectl cluster-info
- name: Log in to GitHub Container Registry
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 #3.4.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Sanity Test
run: |
sudo apt-get update
sudo pip install robotframework
lspci | grep -i vga
sudo apt install -y python3-nose libxml2-utils vlc
cd edge-ai-suites-repo/manufacturing-ai-suite/industrial-edge-insights-vision/tests/robot_files
robot test.robot || true &
sleep 480
docker logs dlstreamer-pipeline-server >> dlsps_logs.txt &
wait
mkdir -p /tmp/test_results
cp -r report.html log.html output.xml dlsps_logs.txt /tmp/test_results/
passed=$(xmllint --xpath "//return/status[@status='PASS']" ./output.xml | wc -l) || true
failed=$(xmllint --xpath "//return/status[@status='FAIL']" ./output.xml | wc -l) || true
not_run=$(xmllint --xpath "//return/status[@status='NOT RUN']" ./output.xml | wc -l) || true
total=$((passed + failed + not_run))
echo "### Sanity Test Summary" >> $GITHUB_STEP_SUMMARY
echo "- Total: $total" >> $GITHUB_STEP_SUMMARY
echo "- ✅ Passed: $passed" >> $GITHUB_STEP_SUMMARY
echo "- ❌ Failed: $failed" >> $GITHUB_STEP_SUMMARY
echo "- ⏭️ Not Run: $not_run" >> $GITHUB_STEP_SUMMARY
echo "- 📄 [Full Report](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})" >> $GITHUB_STEP_SUMMARY
- name: Helm Sanity Test
run: |
sudo apt-get update
sudo pip install robotframework
lspci | grep -i vga
sudo apt install -y python3-nose libxml2-utils vlc
cd edge-ai-suites-repo/manufacturing-ai-suite/industrial-edge-insights-vision/tests/robot_files
robot test_helm.robot || true &
sleep 480
docker logs dlstreamer-pipeline-server >> dlsps_logs.txt &
wait
mkdir -p /tmp/test_results
cp -r report.html log.html output.xml dlsps_logs.txt /tmp/test_results/
passed=$(xmllint --xpath "//return/status[@status='PASS']" ./output.xml | wc -l) || true
failed=$(xmllint --xpath "//return/status[@status='FAIL']" ./output.xml | wc -l) || true
not_run=$(xmllint --xpath "//return/status[@status='NOT RUN']" ./output.xml | wc -l) || true
total=$((passed + failed + not_run))
echo "###Helm Sanity Test Summary" >> $GITHUB_STEP_SUMMARY
echo "- Total: $total" >> $GITHUB_STEP_SUMMARY
echo "- ✅ Passed: $passed" >> $GITHUB_STEP_SUMMARY
echo "- ❌ Failed: $failed" >> $GITHUB_STEP_SUMMARY
echo "- ⏭️ Not Run: $not_run" >> $GITHUB_STEP_SUMMARY
echo "- 📄 [Full Report](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})" >> $GITHUB_STEP_SUMMARY
- name: Upload Scan artifact to Github
uses: actions/upload-artifact@v4
with:
name: Sanity_Reports
path: /tmp/test_results/*
- name: Clean up
if: always()
run: |
sudo rm -rf edge-ai-libraries-repo
if [ -n "$(docker images -aq)" ]; then
docker rmi -f $(docker images -aq) || true
fi
sudo rm -rf /tmp/test_results/*