Run tests for all Python versions in a single nox session #111
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2023-2024 Antmicro <www.antmicro.com> | |
# SPDX-License-Identifier: Apache-2.0 | |
name: Pipeline | |
on: [pull_request, push, workflow_dispatch] | |
jobs: | |
Lint: | |
runs-on: ubuntu-latest | |
container: | |
image: debian:bookworm | |
name: "Run lint checks" | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Install dev requirements | |
run: | | |
apt-get update -qq | |
apt-get install -y --no-install-recommends python3-pip python3-venv | |
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: | | |
nox -s isort_check black_check flake8 | |
Tests: | |
runs-on: ubuntu-latest | |
container: | |
image: debian:bookworm | |
name: "Run tests" | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Install dev requirements | |
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 | |
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: | |
- uses: actions/checkout@v3 | |
- name: Install dev requirements | |
run: | | |
apt-get update -qq | |
apt-get install -y --no-install-recommends \ | |
python3-venv \ | |
python3-pip | |
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 - |