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 <seanga2@gmail.com>
This commit is contained in:
Sean Anderson 2024-12-02 21:43:46 -05:00
parent f8d9d72c7a
commit ff4d52ba5b
3 changed files with 43 additions and 0 deletions

View File

@ -19,6 +19,8 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
submodules: true submodules: true
- if: ${{ env.ACT }}
run: sudo apt-get update
- run: sudo apt-get install -y asciidoctor - run: sudo apt-get install -y asciidoctor
- id: config - id: config
uses: actions/configure-pages@v2 uses: actions/configure-pages@v2

38
.github/workflows/rtl.yml vendored Normal file
View File

@ -0,0 +1,38 @@
name: Run test suite
on:
push
jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- 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
- name: Run tests
run: |
source venv/bin/activate
make -k test

3
requirements.txt Normal file
View File

@ -0,0 +1,3 @@
asyncstdlib==3.12.2
cocotb @ git+https://git@github.com/Forty-Bot/cocotb.git@8810af1a66c461217dc00d0aa47043b8ea130f65
find_libpython==0.3.0