Skip to content

Run tests for all Python versions in a single nox session #115

Run tests for all Python versions in a single nox session

Run tests for all Python versions in a single nox session #115

Workflow file for this run

# Copyright (c) 2023-2024 Antmicro <www.antmicro.com>
# SPDX-License-Identifier: Apache-2.0
name: Pipeline
on: [pull_request, push, workflow_dispatch]
defaults:
run:
shell: bash
jobs:
Lint:
runs-on: ubuntu-latest
container:
image: debian:bookworm
name: "Run lint checks"
env:
DEBIAN_FRONTEND: noninteractive
steps:
- name: Install system packages
run: |
apt-get update -qq
apt-get install -y --no-install-recommends \
git \
python3-pip \
python3-venv
- uses: actions/checkout@v3
with:
submodules: true
- name: Install Python dependencies
run: |
python3 -m venv venv
source venv/bin/activate
python3 -m pip install -U pip wheel setuptools
python3 -m pip install -r requirements.txt
- name: Run lint checks
run: |
source venv/bin/activate
nox -s isort_check black_check flake8
Tests:
runs-on: ubuntu-latest
container:
image: debian:bookworm
name: "Run tests"
env:
DEBIAN_FRONTEND: noninteractive
steps:
- name: Install system packages
run: |
apt-get update -qq
apt-get install -y --no-install-recommends \
curl \
wget \
git \
python3-dev \
python3-venv \
python3-pip \
make \
ninja-build \
gcc-riscv64-unknown-elf \
bsdextrautils \
verilator \
libssl-dev \
libreadline-dev \
libffi-dev \
libbz2-dev \
libncurses-dev \
libsqlite3-dev \
liblzma-dev
- uses: actions/checkout@v3
with:
submodules: true
- name: Install Python dependencies
run: |
python3 -m venv venv
source venv/bin/activate
python3 -m pip install nox
python3 -m pip install git+https://github.com/antmicro/tuttest
- name: Build
run: |
source venv/bin/activate
tuttest README.md | bash -
- name: Run pytest with nox
run: |
source venv/bin/activate
nox -s test_all_in_env
Examples:
runs-on: ubuntu-latest
container:
image: debian:bookworm
name: 'Generate example ${{ matrix.example }}'
strategy:
fail-fast: false
matrix:
example:
- hdmi
- inout
- pwm
steps:
- name: Install system packages
run: |
apt-get update -qq
apt-get install -y --no-install-recommends \
git \
python3-dev \
python3-venv \
python3-pip
- uses: actions/checkout@v3
- name: Install Python dependencies
run: |
python3 -m venv venv
source venv/bin/activate
python3 -m pip install git+https://github.com/antmicro/tuttest
- name: Install fpga-topwrap
run: |
source venv/bin/activate
tuttest README.md | bash -
- name: Generate sources for example ${{ matrix.example }} setup
run: |
source venv/bin/activate
cd examples/${{ matrix.example }}
tuttest README.md generate | bash -