Skip to content

Add test windows action #15

Add test windows action

Add test windows action #15

Workflow file for this run

name: Test runtime on Windows
on:
# execute on every PR made targeting the branches bellow
pull_request:
branches:
- main
- develop # can be removed on main merge
paths: # we only include paths critical for building to avoid unnecessary runs
- src/**
- include/**
- scripts/cmake/**
- test/**
- .github/workflows/**
- doc/**
- runtime/**
- docker/**
# execute on every push made targeting the branches bellow
push:
branches:
- main
- develop # can be removed on main merge
paths: # we only include paths critical for building to avoid unnecessary runs
- src/**
- include/**
- scripts/cmake/**
- test/**
- .github/workflows/**
- doc/**
- runtime/**
- docker/**
workflow_dispatch: # Allows manual triggering of the workflow
jobs:
build-windows:
runs-on: windows-2019
env:
WORKING_PATH: "D:\\a"
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Setup runtime
run: |
pip install asam-qc-runtime@git+https://github.com/asam-ev/qc-framework@develop#subdirectory=runtime
pip install asam-qc-opendrive@git+https://github.com/asam-ev/qc-opendrive@develop
pip install asam-qc-openscenarioxml@git+https://github.com/asam-ev/qc-openscenarioxml@develop
pip install asam-qc-otx@git+https://github.com/asam-ev/qc-otx@develop
shell: pwsh
- name: Execute checker bundles runtime
run: |
mkdir "$env:WORKING_PATH\test_output"
$env:ASAM_QC_FRAMEWORK_WORKING_DIR = "$env:WORKING_PATH\test_output"
qc_runtime --config="$env:WORKING_PATH\qc-framework\qc-framework\.github\workflows\windows-files\odr_config.xml" --manifest="$env:WORKING_PATH\qc-framework\qc-framework\.github\workflows\windows-manifest\framework.json"
Get-ChildItem "$env:ASAM_QC_FRAMEWORK_WORKING_DIR"
#Test-Path "$env:ASAM_QC_FRAMEWORK_WORKING_DIR\xodr_bundle_report.xqar"
if (Get-ChildItem "D:\\a\\*.xqar" -Recurse -ErrorAction SilentlyContinue) { Write-Host "Matching files exist." } else { Write-Host "No matching files found." }
if (Get-ChildItem "D:\\a\\*.txt" -Recurse -ErrorAction SilentlyContinue) { Write-Host "Matching files exist." } else { Write-Host "No matching files found." }
# Use Get-ChildItem with -Recurse to search for files matching the patterns
$pattern1 = "*.xqar"
$pattern2 = "*.txt"
$filesPattern1 = Get-ChildItem -Path "D:\\a\\" -Filter $pattern1 -Recurse -ErrorAction SilentlyContinue
$filesPattern2 = Get-ChildItem -Path "D:\\a\\" -Filter $pattern2 -Recurse -ErrorAction SilentlyContinue
$foundPattern1 = $filesPattern1.Count -gt 0
$foundPattern2 = $filesPattern2.Count -gt 0
# Check if neither pattern was found
if (-not ($foundPattern1 -and $foundPattern2)) {
Write-Host "Failure: Neither .xqar nor .txt files were found."
exit 1 # Set a non-zero exit code to indicate failure
} else {
Write-Host "Success: .xqar and .txt found"
}
shell: pwsh