Skip to content

Commit

Permalink
Add version numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
pkendall64 committed Sep 10, 2023
1 parent 4c475cc commit 735d032
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 47 deletions.
15 changes: 14 additions & 1 deletion .github/targets_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ def validate_devices(vendor, type, devname, device):
error(f'device "{vendor}.{type}.{devname}" must have a "firmware" child element')
else:
firmware = device['firmware']
if (firmware.endswith('_TX') and 'tx_' not in type):
if len(firmwares) != 0 and firmware not in firmwares:
error(f'device "{vendor}.{type}.{devname}" has an invalid firmware file "{firmware}"')
elif (firmware.endswith('_TX') and 'tx_' not in type):
error(f'device "{vendor}.{type}.{devname}" has an invalid firmware file "{firmware}", it must be a TX target firmware')
elif (firmware.endswith('_RX') and 'rx_' not in type):
error(f'device "{vendor}.{type}.{devname}" has an invalid firmware file "{firmware}", it must be an RX target firmware')
Expand Down Expand Up @@ -129,6 +131,17 @@ def validate_vendor(name, types):
with open('targets.json') as f:
targets = json.load(f)

for inifile in glob.iglob('../targets/*.ini'):
with open(inifile) as ini:
for line in ini:
if line.startswith('[env:'):
try:
firmware_file = line[5:line.index('_via_')]
firmwares.add(firmware_file)
except ValueError:
print(line)
None

for vendor in targets:
validate_vendor(vendor, targets[vendor])

Expand Down
Loading

0 comments on commit 735d032

Please sign in to comment.