Skip to content

NuvlaEdge Validation #9

NuvlaEdge Validation

NuvlaEdge Validation #9

Workflow file for this run

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"