Skip to content

[pre-commit.ci] pre-commit autoupdate #195

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #195

Workflow file for this run

# Copyright cocotb contributors
# Licensed under the Revised BSD License, see LICENSE for details.
# SPDX-License-Identifier: BSD-3-Clause
name: Tests
on:
pull_request:
branches:
- master
- 'stable/**'
push:
branches:
- master
- "stable/**"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
tests:
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 }}
TOPLEVEL_LANG: ${{ matrix.lang }}
PYTHON_VERSION: ${{ matrix.python-version }}
strategy:
fail-fast: false
matrix:
cocotb-version: ["1.6.0", "1.9.0", "2.0.1"]
python-version: ["3.6", "3.13"]
sim: [icarus]
sim-version: [apt]
lang: [verilog]
os: [ubuntu-22.04]
include:
# Add pyenv to every 3.6 job
- python-version: "3.6"
python-setup: pyenv
exclude:
# Ensure 3.13 is not used to test cocotb 1.6.0
- python-version: "3.13"
cocotb-version: "1.6.0"
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
# Install python
- name: Set up Python ${{matrix.python-version}} (python-setup)
if: matrix.python-setup == ''
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
with:
python-version: ${{ matrix.python-version }}
- name: Set up Python ${{matrix.python-version}} (pyenv pt.1)
if: matrix.python-setup == 'pyenv'
uses: gabrielfalcao/pyenv-action@a1fc55906be92612782934c70e3985b940bd0165 # v18
with:
default: ${{matrix.python-version}}
command: pip install -U pip # upgrade pip after installing python
- name: Set up Python ${{matrix.python-version}} (pyenv pt.2)
if: matrix.python-setup == 'pyenv'
run: |
pyenv install ${{matrix.python-version}}
pyenv global ${{matrix.python-version}}
- name: Install cocotb requirements
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get update
sudo apt-get install --yes --no-install-recommends g++ make
- name: Set up Icarus (apt)
if: matrix.sim == 'icarus' && matrix.sim-version == 'apt'
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get install --yes --no-install-recommends iverilog
- name: Install testing requirements
run: |
pip install nox
- name: Run tests
env:
COCOTB_ANSI_OUTPUT: 1
continue-on-error: ${{ matrix.may_fail || false }}
run: |
nox --session "tests(cocotb='${{ matrix.cocotb-version }}')"