Skip to content

Add cocotb testbench runner #1302

Add cocotb testbench runner

Add cocotb testbench runner #1302

Workflow file for this run

name: Code CI
on:
# Only run on changes to branches with open PRs
pull_request:
types: [opened, edited, synchronize]
# Run after PR merged, on implicit push, and on tag pushes
push:
tags:
- '*'
branches: [master]
jobs:
# Make Boot files
make_boot:
uses: ./.github/workflows/_make_boot.yml
# Make zpkg for FPGA apps
make_zpkg:
uses: ./.github/workflows/_make_zpkg.yml
cocotb_test:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
# Git repositories
- name: Checkout Source
uses: actions/checkout@v2
with:
path: PandABlocks-fpga
# require history to get back to last tag for version number of branches
fetch-depth: 0
# Login into ghcr
- name: login to ghcr
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run cocotb tests
run: |
docker pull ghcr.io/pandablocks/pandablocks-dev-container:4.0a7
docker run \
--net=host \
-v "${{ github.workspace }}:/repos" \
-v "${{ github.workspace }}/build:/build" \
ghcr.io/pandablocks/pandablocks-dev-container:4.0a7 \
/bin/bash -c \
"cd PandABlocks-fpga && ln -s CONFIG.example CONFIG && make cocotb_tests"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
name: nvc-coverage
files: cocotb_coverage.xml
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
release:
needs: [ make_boot, make_zpkg, test_hdl, test_matrix, test_python_autogen, cocotb_test ]
uses: ./.github/workflows/_release.yml
# Generate job matrix to evenly split tests
test_matrix:
uses: ./.github/workflows/_test_matrix.yml
# python and autogen tests
test_python_autogen:
uses: ./.github/workflows/_test_python_autogen.yml
# hdl tests
test_hdl:
needs: [test_matrix, test_python_autogen]
uses: ./.github/workflows/_test_hdl.yml
with:
matrix: ${{needs.test_matrix.outputs.matrix}}