Skip to content

Better matrix attempt #3

Better matrix attempt

Better matrix attempt #3

Workflow file for this run

name: 'Run Test'

Check failure on line 1 in .github/workflows/run_test.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/run_test.yaml

Invalid workflow file

Cannot define both `uses` and `steps` at the same time for the following jobs: Run-IP
on:
workflow_call:
inputs:
url:
description: 'Repo URL'
required: true
type: string
test-names:
description: 'Test Names'
required: true
type: string
name:
description: 'IP Name'
required: true
type: string
jobs:
Run-IP:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ inputs.tests-names }}
name: ${{ inputs.tests-names }}
uses: ./.github/workflows/run_test.yaml
steps:
- name: Clone IP
shell: bash
run: git clone ${{ inputs.url }} /home/runner/work/${{ inputs.name }}
- name: Check out repository code
uses: actions/checkout@v4
- name: Copy EF_UVM ot verify/uvm-python (workaround)
shell: bash
run: cp -r $(pwd) /home/runner/work/${{ inputs.name }}/verify/uvm-python/
- name: Run Test
shell: bash
working-directory: /home/runner/work/${{ inputs.name }}/verify/uvm-python
run: |
for test in ${{ matrix.test-names }}; do
echo "Running Test $test"
make run_$test
done
- name: Tar Test Logs
shell: bash
working-directory: /home/runner/work/${{ inputs.name }}/verify/uvm-python
run: tar -czf default_tag.tar.gz sim/default_tag
- name: Check Test Results
shell: bash
working-directory: /home/runner/work/${{ inputs.name }}/verify/uvm-python
run: |
passed_count=$(find sim/default_tag -type f -name 'passed' | wc -l)
failed_count=$(find sim/default_tag -type f -name 'failed' | wc -l)
unknown_count=$(find sim/default_tag -type f -name 'unknown' | wc -l)
echo "Passed: $passed_count"
echo "Failed: $failed_count"
echo "Unknown: $unknown_count"
if [ "$passed_count" -eq 0 ]; then
echo "Error: No passed test results found"
exit 1
elif [ "$failed_count" -ne 0 ] || [ "$unknown_count" -ne 0 ]; then
echo "Error: There are failed or unknown test results"
exit 1
else
echo "All tests passed successfully"
fi
- name: Save IP Commit Hash
if: always()
shell: bash
working-directory: /home/runner/work/${{ inputs.name }}/verify/uvm-python
run: git rev-parse --verify HEAD > /tmp/ip-commit-hash.txt
- name: Save EF_UVM Commit Hash
if: always()
shell: bash
run: git rev-parse --verify HEAD > /tmp/EF_UVM-commit-hash.txt
- uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ inputs.name }}-${{ matrix.test-names }}-commit-hashes
path: /tmp/*hash.txt
- uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ inputs.name }}-${{ matrix.test-names }}-default_tag
path: /home/runner/work/${{ inputs.name }}/verify/uvm-python/*.tar.gz