Skip to content

Commit

Permalink
Move cocotb_tests to _cocotb_test.yml
Browse files Browse the repository at this point in the history
run cocotb tests on iris runners
  • Loading branch information
jsouter committed Jan 16, 2025
1 parent 1d4bd0f commit 05a86b5
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 40 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/_cocotb_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
on:
workflow_call:

jobs:
cocotb_test:
runs-on:
group: iris_runners
container:
image: ghcr.io/pandablocks/pandablocks-ci-container:latest
options: --privileged

steps:
# Git repositories
- name: Checkout Source
uses: actions/checkout@v4
with:
path: repos/PandABlocks-fpga
fetch-depth: 0

- name: Checkout rootfs and Give Directory Perms
uses: ./repos/PandABlocks-fpga/.github/actions/setupenv

- name: Run cocotb tests
run: |
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 }}
44 changes: 4 additions & 40 deletions .github/workflows/code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,46 +20,9 @@ jobs:
make_zpkg:
uses: ./.github/workflows/_make_zpkg.yml

# cocotb tests
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 }}
uses: ./.github/workflows/_cocotb_test.yml

release:
needs: [ make_boot, make_zpkg, test_hdl, test_matrix, test_python_autogen, cocotb_test ]
Expand All @@ -78,4 +41,5 @@ jobs:
needs: [test_matrix, test_python_autogen]
uses: ./.github/workflows/_test_hdl.yml
with:
matrix: ${{needs.test_matrix.outputs.matrix}}
matrix: ${{needs.test_matrix.outputs.matrix}}

0 comments on commit 05a86b5

Please sign in to comment.