Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LuigiGiuffrida98 committed Feb 18, 2024
1 parent 2ab4d86 commit 94ab669
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 28 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build-apps-job/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ echo ========================================
echo ========================================

# Create the virtual environment and install the requirements.
make venv
. .venv/bin/activate
conda init bash
source /root/.bashrc
conda activate core-v-mini-mcu

echo ========================================
echo ========================================
Expand All @@ -17,7 +18,7 @@ echo ========================================
echo ========================================

# The variable could also be obtained from the container.
export RISCV='/home/root/tools/riscv' &&\
export RISCV='/tools/riscv' &&\

# All peripherals are included to make sure all apps can be built.
sed 's/is_included: "no",/is_included: "yes",/' -i mcu_cfg.hjson
Expand Down
50 changes: 26 additions & 24 deletions .github/workflows/sim-apps-job/test-apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ class bcolors:
LINKER = 'on_chip'
COMPILER = 'gcc'

repo = Repo(search_parent_directories=True)
hw_diff_to_main = repo.head.commit.diff("main", "hw") + repo.head.commit.diff("main", "tb")
sw_diff_to_main = repo.head.commit.diff("main", "sw")
ci_diff_to_main = repo.head.commit.diff("main", ".github/workflows")
# repo = Repo(search_parent_directories=True)
# hw_diff_to_main = repo.head.commit.diff("main", "hw") + repo.head.commit.diff("main", "tb")
# sw_diff_to_main = repo.head.commit.diff("main", "sw")
# ci_diff_to_main = repo.head.commit.diff("main", ".github/workflows")

# Blacklist of apps to skip
blacklist = [ "example_pdm2pcm",
Expand All @@ -34,33 +34,35 @@ class bcolors:
"example_spi_read",
]

hw_diff = False
ci_diff = False
sw_diff = False
# hw_diff = False
# ci_diff = False
# sw_diff = False

if len(hw_diff_to_main) > 0:
print(bcolors.OKCYAN + "HW differences found!" + bcolors.ENDC)
print(bcolors.OKCYAN + "All applications will be tested." + bcolors.ENDC)
hw_diff = True
# if len(hw_diff_to_main) > 0:
# print(bcolors.OKCYAN + "HW differences found!" + bcolors.ENDC)
# print(bcolors.OKCYAN + "All applications will be tested." + bcolors.ENDC)
# hw_diff = True

if len(sw_diff_to_main) > 0:
print(bcolors.OKCYAN + "SW differences found!" + bcolors.ENDC)
print(bcolors.OKCYAN + "Just the applications modified will be tested." + bcolors.ENDC)
sw_diff = True
# if len(sw_diff_to_main) > 0:
# print(bcolors.OKCYAN + "SW differences found!" + bcolors.ENDC)
# print(bcolors.OKCYAN + "Just the applications modified will be tested." + bcolors.ENDC)
# sw_diff = True

if len(ci_diff_to_main) > 0:
print(bcolors.OKCYAN + "CI differences found!" + bcolors.ENDC)
print(bcolors.OKCYAN + "All applications will be tested." + bcolors.ENDC)
ci_diff = True
# if len(ci_diff_to_main) > 0:
# print(bcolors.OKCYAN + "CI differences found!" + bcolors.ENDC)
# print(bcolors.OKCYAN + "All applications will be tested." + bcolors.ENDC)
# ci_diff = True

if sw_diff and not hw_diff and not ci_diff:
app_list = [app for app in os.listdir('sw/applications') if app in [file.a_path.split("/")[-2] for file in sw_diff_to_main]]
else:
app_list = [app for app in os.listdir('sw/applications')]
# if sw_diff and not hw_diff and not ci_diff:
# app_list = [app for app in os.listdir('sw/applications') if app in [file.a_path.split("/")[-2] for file in sw_diff_to_main]]
# else:
# app_list = [app for app in os.listdir('sw/applications')]
app_list = [app for app in os.listdir('sw/applications')]

print(bcolors.OKCYAN + "Apps to test:" + bcolors.ENDC)
for app in app_list:
print(bcolors.OKCYAN + f" - {app}" + bcolors.ENDC)
if app not in blacklist:
print(bcolors.OKCYAN + f" - {app}" + bcolors.ENDC)

apps = {
app : {"building" : "", "simulation" : ""} for app in app_list
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/simulate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ jobs:
conda activate core-v-mini-mcu
make clean-all
make mcu-gen MEMORY_BANKS=6
git config --global --add safe.directory .
python3 .github/workflows/sim-apps-job/test-apps.py

0 comments on commit 94ab669

Please sign in to comment.