Uses action file #3
Workflow file for this run
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: 'Run IP' | |
on: | |
workflow_call: | |
inputs: | |
is-ip: | |
description: 'Flag if the CI is an IP CI' | |
required: false | |
type: boolean | |
default: false | |
url: | |
description: 'IP Repo URL' | |
required: true | |
type: string | |
test-names: | |
description: 'Test Names' | |
required: true | |
type: string | |
name: | |
description: 'IP Name' | |
required: true | |
type: string | |
buses: | |
description: 'Bus Types' | |
required: true | |
type: string | |
jobs: | |
Setup-Work-Space: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Env Vars | |
run: | | |
echo "EF_UVM_PATH=${{ github.workspace }}/${{ inputs.name }}/verify/uvm-python/EF_UVM" >> $GITHUB_ENV | |
echo "IP_PATH=${{ github.workspace }}/${{ inputs.name }}" >> $GITHUB_ENV | |
echo "MY_WORKSPACE=${{ github.workspace }}/${{ inputs.name }}" >> $GITHUB_ENV | |
- name: Install IP (EF_UVM) | |
if: ${{ !inputs.is-ip }} | |
run: git clone ${{ inputs.url }} ${{ env.IP_PATH }} | |
- name: Install EF_UVM (EF_UVM) | |
if: ${{ !inputs.is-ip }} | |
uses: actions/checkout@v4 | |
with: | |
path: ${{ env.EF_UVM_PATH }} | |
- name: Install IP (IP) | |
uses: actions/checkout@v4 | |
with: | |
path: ${{ env.IP_PATH }} | |
- name: Install EF_UVM (EF_UVM) | |
run: | | |
git clone https://github.com/efabless/EF_UVM.git ${{ env.EF_UVM_PATH }} | |
- name: Upload Workspace | |
uses: actions/upload-artifact@v4 | |
with: | |
path: ${{ env.MY_WORKSPACE }} | |
name: ${{ inputs.name }}-workspace | |
Prepare-Tests-Matrix: | |
needs: ["Setup-Work-Space"] | |
runs-on: ubuntu-latest | |
outputs: | |
tests: ${{ steps.set-tests-matrix.outputs.tests }} | |
steps: | |
- name: Setup Env Vars | |
run: | | |
echo "EF_UVM_PATH=${{ github.workspace }}/${{ inputs.name }}/verify/uvm-python/EF_UVM" >> $GITHUB_ENV | |
echo "IP_PATH=${{ github.workspace }}/${{ inputs.name }}" >> $GITHUB_ENV | |
echo "MY_WORKSPACE=${{ github.workspace }}/${{ inputs.name }}" >> $GITHUB_ENV | |
- name: Download Workspace | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ inputs.name }}-workspace | |
path: ${{ env.MY_WORKSPACE }} | |
- name: Set Tests Matrix | |
id: set-tests-matrix | |
run: | | |
python3 ${{ env.EF_UVM_PATH }}/.github/scripts/get_tests_matrix.py --tests ${{ inputs.test-names }} --buses ${{ inputs.buses }} | |
echo "tests=$(python3 ${{ env.EF_UVM_PATH }}/.github/scripts/get_tests_matrix.py --tests ${{ inputs.test-names }} --buses ${{ inputs.buses }})" >> "$GITHUB_OUTPUT" | |
Run-IP: | |
needs: [Prepare-Tests-Matrix] | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: ${{ fromJSON(needs.Prepare-Tests-Matrix.outputs.tests) }} | |
name: ${{ matrix.tests.bus }} / ${{ matrix.tests.test }} | |
steps: | |
- name: Set Env Variables | |
shell: bash | |
run: | | |
echo "EF_UVM_PATH=${{ github.workspace }}/${{ inputs.name }}/verify/uvm-python/EF_UVM" >> $GITHUB_ENV | |
echo "IP_PATH=${{ github.workspace }}/${{ inputs.name }}" >> $GITHUB_ENV | |
echo "MY_WORKSPACE=${{ github.workspace }}/${{ inputs.name }}" >> $GITHUB_ENV | |
echo "WORKING_DIRECTORY=${{ env.IP_PATH }}/verify/uvm-python" >> $GITHUB_ENV | |
echo "SIM_DIRECTORY=${{ env.WORKING_DIRECTORY }}/sim" >> $GITHUB_ENV | |
- name: Download Workspace | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ inputs.name }}-workspace | |
path: ${{ env.MY_WORKSPACE }} | |
- name: Setup OpenLane | |
if: ${{ matrix.tests.tag == 'GL' }} | |
uses: ${{ env.EF_UVM_PATH }}/.github/actions/setup-openlane-nix/action.yaml | |
- name: Install Docker Image | |
run: docker pull efabless/dv:cocotb | |
- name: Run Test | |
shell: bash | |
working-directory: ${{ env.WORKING_DIRECTORY }} | |
run: | | |
for test in ${{ matrix.tests.test }}; do | |
echo "Running Test $test" | |
make run_$test SIM_TAG=${{ matrix.tests.tag }} BUS_TYPE=${{ matrix.tests.bus }} | |
done | |
- name: Check Test Results | |
shell: bash | |
working-directory: ${{ env.WORKING_DIRECTORY }} | |
run: | | |
passed_count=$(find ${{ env.SIM_DIRECTORY }}/* -type f -name 'passed' | wc -l) | |
failed_count=$(find ${{ env.SIM_DIRECTORY }}/* -type f -name 'failed' | wc -l) | |
unknown_count=$(find ${{ env.SIM_DIRECTORY }}/* -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: ${{ env.WORKING_DIRECTORY }} | |
run: git rev-parse --verify HEAD > ${{ env.SIM_DIRECTORY }}/ip-commit-hash.txt | |
- name: Save EF_UVM Commit Hash | |
if: always() | |
shell: bash | |
run: git rev-parse --verify HEAD > ${{ env.SIM_DIRECTORY }}/EF_UVM-commit-hash.txt | |
- name: Tar Sim Directory | |
if: always() | |
shell: bash | |
working-directory: ${{ env.WORKING_DIRECTORY }} | |
run: tar -czf sim.tar.gz sim | |
- name: Upload Logs and Artifacts | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: ${{ inputs.name }}-${{ matrix.tests.bus }}-${{ matrix.tests.test }}-sim | |
path: ${{ env.WORKING_DIRECTORY }}/*.tar.gz |