File: ci_database.py

package info (click to toggle)
spirv-reflect 1.4.328.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,260 kB
  • sloc: ansic: 13,975; cpp: 5,963; python: 140; sh: 76; makefile: 12
file content (22 lines) | stat: -rw-r--r-- 889 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import os
import sys
import argparse
import subprocess

if __name__ == '__main__':
    parser = argparse.ArgumentParser(description='run SPIRV-Database in CI')
    # Main reason for passing dir in is so GitHub Actions can group things, otherwise logs get VERY long for a single action
    parser.add_argument('--dir', action='store', required=True, type=str, help='path to SPIR-V files')
    args = parser.parse_args()

    root_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
    exe_path = 'spirv-reflect'

    for currentpath, folders, files in os.walk(args.dir):
        for file in files:
            spirv_file = os.path.join(currentpath, file)
            command = f'{exe_path} {spirv_file} -ci'
            exit_code = subprocess.call(command.split())
            if exit_code != 0:
                print(f'ERROR for {spirv_file}')
                sys.exit(1)