From b09b8084a5ab48d212f0416fd2e9276fd34a59e7 Mon Sep 17 00:00:00 2001 From: Colin Marquardt Date: Fri, 1 Mar 2024 18:03:37 +0100 Subject: [PATCH] Also iterate over cocotb versions --- .github/workflows/tests.yml | 14 +++++++++----- noxfile.py | 5 +++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b37f6973..b2fdae94 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,6 +1,7 @@ # Copyright cocotb contributors # Licensed under the Revised BSD License, see LICENSE for details. # SPDX-License-Identifier: BSD-3-Clause + name: Tests on: @@ -23,7 +24,7 @@ jobs: if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository - name: ${{ matrix.extra_name }}${{ matrix.sim }} (${{ matrix.sim-version }}) | ${{ matrix.os }} | Python ${{ matrix.python-version }} ${{ matrix.may_fail && '| May Fail' || '' }} + name: ${{ matrix.extra_name }}cocotb ${{matrix.cocotb-version }} | ${{ matrix.sim }} (${{ matrix.sim-version }}) | ${{ matrix.os }} | Python ${{ matrix.python-version }} ${{ matrix.may_fail && '| May Fail' || '' }} runs-on: ${{ matrix.os }} env: SIM: ${{ matrix.sim }} @@ -32,10 +33,11 @@ jobs: fail-fast: false matrix: python-version: ["3.6", "3.12"] + # NOTE: align with versions in noxfile.py: + cocotb-version: ["1.6.0", "1.8.1"] include: - sim: icarus sim-version: apt - # python-version: "3.6" lang: verilog os: ubuntu-20.04 steps: @@ -48,7 +50,7 @@ jobs: DEBIAN_FRONTEND: noninteractive run: | sudo apt-get update - sudo apt-get install --yes g++ make + sudo apt-get install --yes --no-install-recommends g++ make - name: Set up Icarus (apt) if: matrix.sim == 'icarus' && matrix.sim-version == 'apt' env: @@ -57,8 +59,10 @@ jobs: sudo apt-get install --yes --no-install-recommends iverilog - name: Install testing requirements run: | - pip install nox + python -m pip install nox - name: Run tests + env: + COCOTB_ANSI_COLOR: 1 continue-on-error: ${{ matrix.may_fail || false }} run: | - nox -e tests + nox --session "tests(cocotb='${{ matrix.cocotb-version }}')" diff --git a/noxfile.py b/noxfile.py index 32ded7f0..7b660d5e 100644 --- a/noxfile.py +++ b/noxfile.py @@ -2,8 +2,9 @@ @nox.session -def tests(session): - session.install("pytest", "coverage") +@nox.parametrize("cocotb", ["1.6.0", "1.8.1"]) +def tests(session, cocotb): + session.install("pytest", "coverage", f"cocotb=={cocotb}") session.install(".") session.run("make", external=True)