Skip to content

Commit

Permalink
Merge pull request #13 from cceckman/cceckman/ci
Browse files Browse the repository at this point in the history
Add a CI flow
  • Loading branch information
cceckman authored Feb 24, 2025
2 parents ebce1dc + 87e5067 commit 59bba34
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 4 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Run tests

on:
push:
branches: [ $default-branch ]
pull_request:
branches: [ $default-branch ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Run tests
run: |
./do tests
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cat extras/fomu-serial.conf | sudo tee /etc/tlp.d/fomu-serial.conf
Then try:

```
source ./enter.sh
. ./enter.sh
python usb_serial.py
```

2 changes: 1 addition & 1 deletion enter.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

./do venv
source ./venv.dir/bin/activate
. ./venv.dir/bin/activate
export YOSYS=yowasp-yosys
export NEXTPNR_ICE40=yowasp-nextpnr-ice40
export ICEPACK=yowasp-icepack
Expand Down
7 changes: 5 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ git+https://github.com/amaranth-lang/amaranth-boards@9d97c4816288c9c2cc304d9280c

git+https://github.com/amaranth-lang/amaranth-soc@5c43cf58f15d9cd9c69ff83c97997708d386b2dc

# Support for amaranth 0.5

# Support for amaranth 0.5;
# This is merged to mainline
git+https://github.com/greatscottgadgets/luna@1462160ba66302aaae69dca9e54fd71498a8b3ef

regex
# Dev dependencies:
flake8
pytest
9 changes: 9 additions & 0 deletions tests.do
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@

# TODO: How do we get it to ignore the venv?
# stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

find . -name '*_test.py' \
| grep -v venv \
| sed 's/_test.py$/.vcd/' \
| xargs redo-ifchange

. ./enter.sh


0 comments on commit 59bba34

Please sign in to comment.