Skip to content

Commit

Permalink
Also iterate over cocotb versions
Browse files Browse the repository at this point in the history
  • Loading branch information
cmarqu committed Mar 1, 2024
1 parent ac1684f commit a0c8c09
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# Copyright cocotb contributors
# Licensed under the Revised BSD License, see LICENSE for details.
# SPDX-License-Identifier: BSD-3-Clause

name: Tests

on:
push:
# branches:
# - master
# - 'stable/**'
pull_request:
branches:
- master
Expand All @@ -23,7 +21,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 }}
Expand All @@ -32,14 +30,17 @@ 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
timeout-minutes: 10

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
Expand All @@ -48,7 +49,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:
Expand All @@ -57,8 +58,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_OUTPUT: 1
continue-on-error: ${{ matrix.may_fail || false }}
run: |
nox -e tests
nox --session "tests(cocotb='${{ matrix.cocotb-version }}')"
5 changes: 3 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit a0c8c09

Please sign in to comment.