-
Notifications
You must be signed in to change notification settings - Fork 3
122 lines (103 loc) · 3.8 KB
/
validation.yml
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
name: 'NuvlaEdge Validation'
on:
workflow_dispatch:
inputs:
log_level:
description: 'Logging Level'
required: false
type: choice
default: 'INFO'
options:
- 'DEBUG'
- 'INFO'
- 'WARNING'
- 'ERROR'
nuvlaedge_branch:
description: 'NuvlaEdge Repository branch to test against'
required: false
type: string
nuvlaedge_version:
description: 'NuvlaEdge Tag'
required: false
type: string
retrieve_logs:
# Logs are retrieved whenever there is an error on the validation
description: 'Retrieve docker execution logs'
required: false
type: boolean
default: false
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
env:
VALIDATION_PACKAGE_NAME: "validation-latest-py3-none-any.whl"
BRANCH_NAME: ${{ github.head_ref || github.ref_name || vars.GITHUB_REF_NAME }}
jobs:
setup-matrix:
runs-on: ubuntu-latest
outputs:
boards: ${{ steps.set-boards.outputs.boards }}
tests: ${{ steps.set-tests.outputs.tests }}
steps:
- id: set-boards
run: |
echo "boards=${{ vars.TESTBED_BOARDS }}" >> $GITHUB_OUTPUT
- id: set-tests
run: |
echo "tests=${{ vars.VALIDATION_TESTS }}" >> $GITHUB_OUTPUT
run-validation:
needs: setup-matrix
strategy:
matrix:
board-config: ${{ fromJSON(needs.setup-matrix.outputs.boards) }}
validation-type: ${{ fromJSON(needs.setup-matrix.outputs.tests) }}
fail-fast: false
runs-on: ${{ matrix.board-config }}
steps:
- name: Setup Python environment
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Setup Validation folder structure
run: |
mkdir -p results/temp/xml results/temp/json
mkdir -p conf/targets/ || true
mkdir -p dist/ || true
- name: Retrieve target configuration
run: |
wget \
-O conf/targets/${{ matrix.board-config }}.toml \
https://github.com/nuvlaedge/validation/releases/latest/download/${{ matrix.board-config }}.toml
- name: Remove previous validation package
run: |
rm -f ${{ env.VALIDATION_PACKAGE_NAME }} || true
rm -f dist/${{ env.VALIDATION_PACKAGE_NAME }} || true
- name: Download Validation Framework dependency
run: |
wget \
-O dist/${{ env.VALIDATION_PACKAGE_NAME }} \
https://github.com/nuvlaedge/validation/releases/latest/download/${{ env.VALIDATION_PACKAGE_NAME }}
- name: Install latest validation package
run: |
pip install dist/${{ env.VALIDATION_PACKAGE_NAME }} --force-reinstall
- name: Clear previous results
run: |
rm results/temp/xml/*.xml || true
- name: Run Validation on board ${{ matrix.board-config }}
run: >
validation
--target ${{ matrix.board-config }}.toml
--key ${{ secrets.VALIDATION_NUVLA_API_KEY }}
--secret ${{ secrets.VALIDATION_NUVLA_API_SECRET }}
--validator ${{ matrix.validation-type }}
--retrieve_logs ${{ github.event.inputs.retrieve_logs }}
--nuvlaedge_branch ${{ github.event.inputs.nuvlaedge_branch || 'None' }}
--nuvlaedge_version ${{ github.event.inputs.nuvlaedge_version || 'latest' }}
--deployment_branch ${{ env.BRANCH_NAME }}
--log_level ${{ github.event.inputs.log_level || 'INFO' }}
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action/linux@v2
if: always()
with:
check_name: "| ${{ matrix.board-config }} --- ${{ matrix.validation-type }} |"
junit_files: "results/temp/xml/*.xml"