Skip to content

Commit

Permalink
Add get-bus action
Browse files Browse the repository at this point in the history
  • Loading branch information
kareefardi committed Apr 28, 2024
1 parent 6f09e5b commit 5e8b8ae
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/actions/get-bus/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'Get Bus Type'
description: 'Get Bus Type'
runs:
using: "composite"
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Extract info from yaml
uses: mikefarah/yq@master
id: get_bus_info
with:
cmd: yq '.info.bus.[]' './${{ github.event.repository.name }}.yaml'
- name: Map to Make options
shell: bash
run: |
echo ${{ steps.get_bus_info.outputs.result }}
18 changes: 18 additions & 0 deletions .github/scripts/get_bus.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import yaml

bus_mapping = {
"generic": "APB AHB WISHBONE",
"WB": "WISHBONE",
"AHBL": "AHB",
"APB": "APB",
}
supported_buses = []

stream = open("/home/karim/work/EF_GPIO/EF_GPIO8.yaml")
data = yaml.load(stream, Loader=yaml.Loader)
bus_info = data["info"]["bus"]
for bus in bus_info:
supported_buses.append(bus_mapping[bus])

print(" ".join(supported_buses))
stream.close()

0 comments on commit 5e8b8ae

Please sign in to comment.