name: Cocotb Simulation Tests on: push: branches: [ main ] workflow_dispatch: schedule: # Run weekly on Monday at 00:00 UTC - cron: '0 0 * * 1' jobs: cocotb-sim: runs-on: ubuntu-latest permissions: contents: read strategy: matrix: python-version: ['3.10', '3.12'] simulator: ['icarus'] steps: - uses: actions/checkout@v4 - name: Set up uv uses: astral-sh/setup-uv@v3 with: python-version: ${{ matrix.python-version }} - name: Install HDL Simulator run: | sudo apt-get update sudo apt-get install -y iverilog iverilog -V - name: Install dependencies run: | uv sync --group test - name: Run cocotb integration tests run: | uv run pytest tests/cocotb/testbenches/test_integration.py -v - name: Run cocotb simulation tests (APB4) run: | uv run pytest tests/cocotb/testbenches/test_apb4_runner.py -v -s continue-on-error: true env: SIM: ${{ matrix.simulator }} - name: Upload test logs if: always() uses: actions/upload-artifact@v4 with: name: cocotb-logs-py${{ matrix.python-version }}-${{ matrix.simulator }} path: | **/*.vcd **/sim_build/**/*.log retention-days: 7 if-no-files-found: ignore