diff --git a/.github/workflows/_build_devices.yml b/.github/workflows/_build_devices.yml index 105615e..6e58d8f 100644 --- a/.github/workflows/_build_devices.yml +++ b/.github/workflows/_build_devices.yml @@ -27,6 +27,29 @@ on: pull_request: push: + inputs: + sdk_ref: + type: string + required: false + default: 'master' + + run_nanos: + type: boolean + required: false + default: true + run_nanosp: + type: boolean + required: false + default: true + run_nanox: + type: boolean + required: false + default: true + run_stax: + type: boolean + required: false + default: true + jobs: @@ -66,7 +89,7 @@ jobs: - name: Merge output files run: | - python3 scripts/output_scripts/merge.py --input_files build_nanos.json build_nanosp.json build_nanox.json build_stax.json --output_file build_output.json + python3 scripts/output_scripts/merge.py --input_files build_nanos.json build_nanosp.json build_nanox.json build_stax.json --output_file build_output.json --merge_key "name" #- name: Push info to DB # run: | diff --git a/.github/workflows/_test_devices.yml b/.github/workflows/_test_devices.yml index d742409..e0ff01c 100644 --- a/.github/workflows/_test_devices.yml +++ b/.github/workflows/_test_devices.yml @@ -32,6 +32,34 @@ on: pull_request: push: + inputs: + sdk_ref_nanosp: + type: string + required: false + default: 'API_LEVEL_1' + run_nanosp: + type: boolean + required: false + default: true + + sdk_ref_nanox: + type: string + required: false + default: 'API_LEVEL_5' + run_nanox: + type: boolean + required: false + default: true + + sdk_ref_stax: + type: string + required: false + default: 'API_LEVEL_12' + run_stax: + type: boolean + required: false + default: true + jobs: @@ -66,7 +94,7 @@ jobs: - name: Merge output files run: | - python3 scripts/output_scripts/merge.py --input_files test_nanosp.json test_nanox.json test_stax.json --output_file test_output.json + python3 scripts/output_scripts/merge.py --input_files test_nanosp.json test_nanox.json test_stax.json --output_file test_output.json --merge_key "name" - name: Archive output file uses: actions/upload-artifact@v3 diff --git a/.github/workflows/check_outdated_build_db.yaml b/.github/workflows/check_outdated_build_db.yaml index 5163c85..54493a1 100644 --- a/.github/workflows/check_outdated_build_db.yaml +++ b/.github/workflows/check_outdated_build_db.yaml @@ -15,7 +15,7 @@ jobs: - name: Build db run: | - python3 scripts/create_app_list/main.py --output_file out.json --access_token ${{ secrets.GH_ACCESS_TOKEN }} + python3 scripts/create_app_list/main.py --full_output_file out.json --access_token ${{ secrets.GH_ACCESS_TOKEN }} - name: Compare Files run: | # Compare two files using diff diff --git a/scripts/build_and_test/main.py b/scripts/build_and_test/main.py index 3cba87a..e10e0ed 100644 --- a/scripts/build_and_test/main.py +++ b/scripts/build_and_test/main.py @@ -31,7 +31,7 @@ parser.add_argument("--sdk_ref", required=False, type=Path, default="origin/master") parser.add_argument("--input_file", required=False, type=Path, default=Path("input_files/test_input.json")) - parser.add_argument("--output_file", required=False, type=Path, default=Path("output_file/output.json")) + parser.add_argument("--output_file", required=False, type=Path, default=Path("output_files/output.json")) parser.add_argument("--workdir", required=False, type=str, default="workdir") args = parser.parse_args() diff --git a/scripts/output_scripts/merge.py b/scripts/output_scripts/merge.py new file mode 100644 index 0000000..8c321cf --- /dev/null +++ b/scripts/output_scripts/merge.py @@ -0,0 +1,29 @@ +import argparse +import json + +def merge_json_files(input_files, output_file, merge_key): + merged_data = {} + + for input_file in input_files: + with open(input_file, 'r') as f: + data = json.load(f) + key_value = data.get(merge_key) + if key_value is not None: + merged_data[key_value] = data + + with open(output_file, 'w') as f: + json.dump(merged_data, f, indent=2) + +def main(): + parser = argparse.ArgumentParser(description="Merge JSON files based on a specified key") + parser.add_argument("--input_files", nargs="+", help="List of input JSON files") + parser.add_argument("--output_file", help="Output merged JSON file") + parser.add_argument("--merge_key", help="Key to use for merging") + + args = parser.parse_args() + + merge_json_files(args.input_files, args.output_file, args.merge_key) + print(f"Merged data saved to {args.output_file}") + +if __name__ == "__main__": + main()