Skip to content

Commit

Permalink
Use upload artifcat while running test
Browse files Browse the repository at this point in the history
  • Loading branch information
kareefardi committed Apr 28, 2024
1 parent 19a6b29 commit fe45b7c
Showing 1 changed file with 77 additions and 78 deletions.
155 changes: 77 additions & 78 deletions .github/workflows/run_IP.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
with:
path: ${{ env.MY_WORKSPACE }}
name: ${{ inputs.name }}-workspace

Prepare-Tests-Matrix:
needs: ["Setup-Work-Space"]
runs-on: ubuntu-latest
Expand All @@ -73,81 +74,79 @@ jobs:
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 "WORKING_DIRECTORY=/home/runner/work/${{ inputs.name }}/verify/uvm-python" >> $GITHUB_ENV
# echo "SIM_DIRECTORY=/home/runner/work/${{ inputs.name }}/verify/uvm-python/sim" >> $GITHUB_ENV
# - name: Check out repository code
# uses: actions/checkout@v4
# - name: Setup OpenLane
# if: ${{ matrix.tests.tag == 'GL' }}
# uses: ./.github/actions/setup-openlane-nix
# - 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 to verify/uvm-python (workaround)
# shell: bash
# run: cp -r $(pwd) ${{ env.WORKING_DIRECTORY }}
# - 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
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
- 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

0 comments on commit fe45b7c

Please sign in to comment.