Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update(ci): add selective driver build #1999

Merged
merged 1 commit into from
Jun 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/build-drivers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
description: 'Set rebuild to "true" to perform a complete rebuild of all the probes, even if they were already present on S3'
required: true
default: 'false'
version:
description: 'Set version to a specific driver version (e.g. "5.0.1+driver") to build a specific version of the driver only'
required: false
default: ''

jobs:
build-drivers:
Expand Down Expand Up @@ -68,4 +72,5 @@ jobs:
--driverkit ${{ github.workspace }}/driverkit \
--arch ${{ matrix.arch }} \
--s3-bucket ${{ env.S3_BUCKET }} --s3-prefix ${{ env.S3_PREFIX }} \
${{ (github.event_name == 'workflow_dispatch') && (github.event.inputs.rebuild == 'true') && '--rebuild' || '' }}
${{ (github.event_name == 'workflow_dispatch') && (github.event.inputs.rebuild == 'true') && '--rebuild' || '' }} \
${{ (github.event_name == 'workflow_dispatch') && (github.event.inputs.version != '') && format('--version {0}',github.event.inputs.version) || '' }}
12 changes: 11 additions & 1 deletion scripts/driverkit/build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def main():
ap.add_argument('--moduledevicename', default='scap', help='The module device name')
ap.add_argument('--arch', default='', help='The architecture for which driver must be built. If empty, all supported archs are considered.')
ap.add_argument('--rebuild', action='store_true', help='Rebuild all drivers, including the ones already present on S3')
ap.add_argument('--version', default='', help='Specific version to be built of the driver in the config_dir.')
args = ap.parse_args()

if args.rebuild:
Expand Down Expand Up @@ -78,7 +79,16 @@ def main():
s3_prefix = args.s3_prefix.lstrip('/')

all_archs = len(args.arch) == 0
dri_dirs = [x for x in config_dir.iterdir() if x.is_dir()]
if args.version is None:
dri_dirs = [x for x in config_dir.iterdir() if x.is_dir()]
else:
version_dir = Path(args.config_dir, args.version)
if version_dir.is_dir():
dri_dirs = [version_dir]
else:
print(f"[-] {args.version} configs not found in {config_dir}")
return 1

for dri_dir in dri_dirs:
legacy_arch = ""
config_dirs = [x for x in dri_dir.iterdir() if x.is_dir()]
Expand Down
Loading