Skip to content

Commit e3fadf9

Browse files
authored
Merge pull request #55 from PyFPGA/ci-win
CI: add to verify on Windows
2 parents 48af8b2 + 8c061c1 commit e3fadf9

File tree

9 files changed

+104
-39
lines changed

9 files changed

+104
-39
lines changed

.github/workflows/test.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,29 @@ jobs:
77
test:
88
strategy:
99
matrix:
10-
os: ['ubuntu']
10+
os: ['ubuntu', 'windows']
1111
pyver: ['3.8', '3.9', '3.10', '3.11', '3.12']
12+
exclude:
13+
- os: 'windows'
14+
pyver: '3.8'
15+
- os: 'windows'
16+
pyver: '3.9'
17+
- os: 'windows'
18+
pyver: '3.10'
19+
- os: 'windows'
20+
pyver: '3.11'
1221
runs-on: ${{ matrix.os }}-latest
1322
name: ${{ matrix.os }} | ${{ matrix.pyver }}
1423
steps:
1524
- name: Checkout repository
1625
uses: actions/checkout@v4
17-
with:
18-
submodules: true
19-
fetch-depth: 0
2026
- name: Set up Python ${{ matrix.pyver }}
2127
uses: actions/setup-python@v5
2228
with:
2329
python-version: ${{ matrix.pyver }}
2430
- name: Install dependencies
2531
run: pip install . && pip install pytest
2632
- name: Run tests
27-
run: source tests/mocks/source-me.sh && make test
33+
run: |
34+
make test
35+
cd examples/projects && bash regress.sh --notool

examples/projects/diamond.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
parser.add_argument(
1616
'--action', choices=['make', 'prog', 'all'], default='make'
1717
)
18+
parser.add_argument(
19+
'--notool', action='store_true'
20+
)
1821
args = parser.parse_args()
1922

2023
prj = Diamond(odir=f'results/diamond/{args.source}/{args.board}')
@@ -43,8 +46,11 @@
4346

4447
prj.set_top('Top')
4548

46-
if args.action in ['make', 'all']:
47-
prj.make()
48-
49-
if args.action in ['prog', 'all']:
50-
prj.prog()
49+
try:
50+
if args.action in ['make', 'all']:
51+
prj.make()
52+
if args.action in ['prog', 'all']:
53+
prj.prog()
54+
except RuntimeError:
55+
if not args.notool:
56+
raise

examples/projects/ise.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
parser.add_argument(
1616
'--action', choices=['make', 'prog', 'all'], default='make'
1717
)
18+
parser.add_argument(
19+
'--notool', action='store_true'
20+
)
1821
args = parser.parse_args()
1922

2023
prj = Ise(odir=f'results/ise/{args.source}/{args.board}')
@@ -45,8 +48,11 @@
4548

4649
prj.set_top('Top')
4750

48-
if args.action in ['make', 'all']:
49-
prj.make()
50-
51-
if args.action in ['prog', 'all']:
52-
prj.prog()
51+
try:
52+
if args.action in ['make', 'all']:
53+
prj.make()
54+
if args.action in ['prog', 'all']:
55+
prj.prog()
56+
except RuntimeError:
57+
if not args.notool:
58+
raise

examples/projects/libero.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
parser.add_argument(
1515
'--action', choices=['make', 'prog', 'all'], default='make'
1616
)
17+
parser.add_argument(
18+
'--notool', action='store_true'
19+
)
1720
args = parser.parse_args()
1821

1922
prj = Libero(odir=f'results/libero/{args.source}/{args.board}')
@@ -43,8 +46,11 @@
4346

4447
prj.set_top('Top')
4548

46-
if args.action in ['make', 'all']:
47-
prj.make()
48-
49-
if args.action in ['prog', 'all']:
50-
prj.prog()
49+
try:
50+
if args.action in ['make', 'all']:
51+
prj.make()
52+
if args.action in ['prog', 'all']:
53+
prj.prog()
54+
except RuntimeError:
55+
if not args.notool:
56+
raise

examples/projects/openflow.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
parser.add_argument(
1717
'--action', choices=['make', 'prog', 'all'], default='make'
1818
)
19+
parser.add_argument(
20+
'--notool', action='store_true'
21+
)
1922
args = parser.parse_args()
2023

2124
prj = Openflow(odir=f'results/openflow/{args.source}/{args.board}')
@@ -59,8 +62,11 @@
5962

6063
prj.set_top('Top')
6164

62-
if args.action in ['make', 'all']:
63-
prj.make()
64-
65-
if args.action in ['prog', 'all']:
66-
prj.prog()
65+
try:
66+
if args.action in ['make', 'all']:
67+
prj.make()
68+
if args.action in ['prog', 'all']:
69+
prj.prog()
70+
except RuntimeError:
71+
if not args.notool:
72+
raise

examples/projects/quartus.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
parser.add_argument(
1616
'--action', choices=['make', 'prog', 'all'], default='make'
1717
)
18+
parser.add_argument(
19+
'--notool', action='store_true'
20+
)
1821
args = parser.parse_args()
1922

2023
prj = Quartus(odir=f'results/quartus/{args.source}/{args.board}')
@@ -44,8 +47,11 @@
4447

4548
prj.set_top('Top')
4649

47-
if args.action in ['make', 'all']:
48-
prj.make()
49-
50-
if args.action in ['prog', 'all']:
51-
prj.prog()
50+
try:
51+
if args.action in ['make', 'all']:
52+
prj.make()
53+
if args.action in ['prog', 'all']:
54+
prj.prog()
55+
except RuntimeError:
56+
if not args.notool:
57+
raise

examples/projects/regress.sh

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,24 @@ TOOLS["vivado"]="zybo arty"
1313

1414
SOURCES=("vlog" "vhdl" "slog")
1515

16-
SPECIFIED_TOOL=$1
16+
SPECIFIED_TOOL=""
17+
NOTOOL=false
18+
while [[ "$#" -gt 0 ]]; do
19+
case $1 in
20+
--tool)
21+
SPECIFIED_TOOL="$2"
22+
shift 2
23+
;;
24+
--notool)
25+
NOTOOL=true
26+
shift
27+
;;
28+
*)
29+
echo "Invalid option: $1"
30+
exit 1
31+
;;
32+
esac
33+
done
1734

1835
for TOOL in "${!TOOLS[@]}"; do
1936
if [[ -n "$SPECIFIED_TOOL" && "$TOOL" != "$SPECIFIED_TOOL" ]]; then
@@ -26,7 +43,11 @@ for TOOL in "${!TOOLS[@]}"; do
2643
continue
2744
fi
2845
echo "> $TOOL - $BOARD - $SOURCE"
29-
python3 $TOOL.py --board $BOARD --source $SOURCE
46+
if [[ "$NOTOOL" == true ]]; then
47+
python3 $TOOL.py --board $BOARD --source $SOURCE --notool
48+
else
49+
python3 $TOOL.py --board $BOARD --source $SOURCE
50+
fi
3051
done
3152
done
3253
done

examples/projects/vivado.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
parser.add_argument(
1616
'--action', choices=['make', 'prog', 'all'], default='make'
1717
)
18+
parser.add_argument(
19+
'--notool', action='store_true'
20+
)
1821
args = parser.parse_args()
1922

2023
prj = Vivado(odir=f'results/vivado/{args.source}/{args.board}')
@@ -50,8 +53,11 @@
5053

5154
prj.set_top('Top')
5255

53-
if args.action in ['make', 'all']:
54-
prj.make()
55-
56-
if args.action in ['prog', 'all']:
57-
prj.prog()
56+
try:
57+
if args.action in ['make', 'all']:
58+
prj.make()
59+
if args.action in ['prog', 'all']:
60+
prj.prog()
61+
except RuntimeError:
62+
if not args.notool:
63+
raise

tests/test_tools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ def generate(tool, part):
8585
prj.add_hook('postbit', 'HOOK16')
8686
try:
8787
prj.make()
88-
except Exception:
88+
except RuntimeError:
8989
pass
9090
try:
9191
prj.prog()
92-
except Exception:
92+
except RuntimeError:
9393
pass

0 commit comments

Comments
 (0)