Skip to content

Commit

Permalink
Merge branch 'ci/ci_build'
Browse files Browse the repository at this point in the history
  • Loading branch information
perfplay committed Sep 3, 2024
2 parents 53ea256 + c6c774c commit c79cfff
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
18 changes: 16 additions & 2 deletions .ci/check_files.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import sys

required_structure = {
'install': {
Expand All @@ -18,21 +19,34 @@
}
}


def check_structure(base_path, structure):
all_present = True
for folder, contents in structure.items():
current_path = os.path.join(base_path, folder)

if isinstance(contents, dict):
if not os.path.isdir(current_path):
print(f"Missing directory: {current_path}")
all_present = False
else:
check_structure(current_path, contents)
if not check_structure(current_path, contents):
all_present = False
else:
for file in contents:
file_path = os.path.join(base_path, folder, file)
if not os.path.isfile(file_path):
print(f"Missing file: {file_path}")
all_present = False

return all_present


base_path = '../'

check_structure(base_path, required_structure)
if check_structure(base_path, required_structure):
print("All required files and directories are present. Test passed successfully!")
sys.exit(0)
else:
print("Some required files or directories are missing. Test failed.")
sys.exit(1)
17 changes: 15 additions & 2 deletions .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ jobs:
restore-keys: |
${{ runner.os }}-build-
- name: Run tests
- name: Build test
working-directory: .ci
run: bash run_all_tests.sh
run: bash build_test.sh

- name: Check generated files
working-directory: .ci
run: python3 check_files.py

- name: Run cargo tests
working-directory: .ci
run: bash cargo_tests.sh

# - name: Run tests
# working-directory: .ci
# run: bash run_all_tests.sh

0 comments on commit c79cfff

Please sign in to comment.