mirror of
https://github.com/github/codeql-action.git
synced 2026-05-07 14:20:19 +00:00
Support customising test directories in PR check specs
This commit is contained in:
+24
-11
@@ -83,10 +83,18 @@ for file in sorted((this_dir / 'checks').glob('*.yml')):
|
||||
runnerImagesForOs = [image for image in runnerImages if image.startswith(operatingSystem)]
|
||||
|
||||
for runnerImage in runnerImagesForOs:
|
||||
matrix.append({
|
||||
'os': runnerImage,
|
||||
'version': version
|
||||
})
|
||||
if 'testDirectories' in checkSpecification:
|
||||
for testDirectory in checkSpecification.get('testDirectories'):
|
||||
matrix.append({
|
||||
'os': runnerImage,
|
||||
'version': version,
|
||||
'test-directory': testDirectory
|
||||
})
|
||||
else:
|
||||
matrix.append({
|
||||
'os': runnerImage,
|
||||
'version': version
|
||||
})
|
||||
|
||||
useAllPlatformBundle = "false" # Default to false
|
||||
if checkSpecification.get('useAllPlatformBundle'):
|
||||
@@ -129,17 +137,22 @@ for file in sorted((this_dir / 'checks').glob('*.yml')):
|
||||
},
|
||||
])
|
||||
|
||||
prepareWith = {
|
||||
'version': '${{ matrix.version }}',
|
||||
'use-all-platform-bundle': useAllPlatformBundle,
|
||||
# If the action is being run from a container, then do not setup kotlin.
|
||||
# This is because the kotlin binaries cannot be downloaded from the container.
|
||||
'setup-kotlin': str(not 'container' in checkSpecification).lower(),
|
||||
}
|
||||
|
||||
if 'testDirectories' in checkSpecification:
|
||||
prepareWith['test-directory'] = '${{ matrix.test-directory }}'
|
||||
|
||||
steps.append({
|
||||
'name': 'Prepare test',
|
||||
'id': 'prepare-test',
|
||||
'uses': './.github/actions/prepare-test',
|
||||
'with': {
|
||||
'version': '${{ matrix.version }}',
|
||||
'use-all-platform-bundle': useAllPlatformBundle,
|
||||
# If the action is being run from a container, then do not setup kotlin.
|
||||
# This is because the kotlin binaries cannot be downloaded from the container.
|
||||
'setup-kotlin': str(not 'container' in checkSpecification).lower(),
|
||||
}
|
||||
'with': prepareWith,
|
||||
})
|
||||
|
||||
installGo = is_truthy(checkSpecification.get('installGo', ''))
|
||||
|
||||
Reference in New Issue
Block a user