This repository has been archived by the owner on Jul 4, 2023. It is now read-only.
Merge pull request #171 from nuvlaedge/improved_search_compute-api #116
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Agent Validation" | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
types: [ready_for_review] | |
workflow_dispatch: | |
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-validator: | |
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: CheckOut validation packages | |
run: | | |
curl -u "${{ secrets.VALIDATION_TOKEN_USERNAME }}:${{ secrets.VALIDATION_TOKEN_SECRET }}" \ | |
-H 'Accept: application/vnd.github.v3.raw' \ | |
-O --create-dirs --output-dir conf/targets/ \ | |
-L "https://api.github.com/repos/nuvlaedge/validation/contents/conf/targets/${{ matrix.board-config }}.toml" \ | |
- name: Gather System configuration | |
run: | | |
curl -u "${{ secrets.VALIDATION_TOKEN_USERNAME }}:${{ secrets.VALIDATION_TOKEN_SECRET }}" \ | |
-H 'Accept: application/vnd.github.v3.raw' \ | |
-O -L "https://api.github.com/repos/nuvlaedge/validation/contents/${{ env.VALIDATION_PACKAGE_NAME }}" | |
- name: Setup Python environment | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Test New Package | |
run: pip install requests | |
- name: Install Validation Framework dependency | |
run: python -m pip install ${{ env.VALIDATION_PACKAGE_NAME }} --force-reinstall | |
- name: Setup results folder | |
run: | | |
mkdir -p results/temp/xml results/temp/json | |
- name: Clear previous results | |
run: | | |
rm results/temp/xml/*.xml || true | |
- name: Run Validation on board ${{ matrix.board-config }} | |
run: | | |
python -m validation_framework --target ${{ matrix.board-config }}.toml \ | |
--key ${{ secrets.VALIDATION_NUVLA_API_KEY }} \ | |
--secret ${{ secrets.VALIDATION_NUVLA_API_SECRET }} \ | |
--validator ${{ matrix.validation-type }} --repository ${{ github.event.repository.name }} \ | |
--branch ${{ env.BRANCH_NAME }} | |
- name: Publish Unit Test Results | |
uses: EnricoMi/publish-unit-test-result-action/composite@v2 | |
if: always() | |
with: | |
check_name: "| ${{ matrix.board-config }} --- ${{ matrix.validation-type }} |" | |
junit_files: "results/temp/xml/*.xml" |