From 3cc23cb79600b3dbc9ea90951ce0b6df524b6704 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Mon, 2 Dec 2024 21:43:46 -0500 Subject: [PATCH] Run tests in CI Run tests in CI to better demonstrate how to build things. At the moment there are some failures. I think I have stashed changes that fix them, but I think some of them have been introduced by newer tool versions. Closes: 2 Signed-off-by: Sean Anderson --- .github/workflows/rtl.yml | 35 +++++++++++++++++++++++++++++++++++ requirements.txt | 3 +++ 2 files changed, 38 insertions(+) create mode 100644 .github/workflows/rtl.yml create mode 100644 requirements.txt diff --git a/.github/workflows/rtl.yml b/.github/workflows/rtl.yml new file mode 100644 index 0000000..b2ab83e --- /dev/null +++ b/.github/workflows/rtl.yml @@ -0,0 +1,35 @@ +name: Run test suite + +on: + push + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install dependencies missing in act + if: ${{ env.ACT }} + run: | + sudo apt-get update + sudo apt-get install -y python3-dev + - name: Get pip cache dir + id: pip-cache + run: | + echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT + - name: Cache pip dependencies + uses: actions/cache@v3 + with: + path: ${{ steps.pip-cache.outputs.dir }} + key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Install dependencies + run: | + echo "$HOME/.local/bin" >> $GITHUB_PATH + sudo apt-get install -y fpga-icestorm iverilog nextpnr-ice40 yosys-dev + python3 -m venv venv + venv/bin/pip install -r requirements.txt + - run: | + source venv/bin/activate + make -k test diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..2d6e709 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +asyncstdlib==3.12.2 +cocotb @ git+https://git@github.com/Forty-Bot/cocotb.git@8810af1a66c461217dc00d0aa47043b8ea130f65 +find_libpython==0.3.0