Skip to content
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
40 changes: 19 additions & 21 deletions .github/workflows/runAqa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,15 @@ jobs:
echo ::set-output name=url::$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID
echo ::set-output name=id::$GITHUB_RUN_ID
id: workflow_run_info
# Checkout current repo to access the repo-specific config file `.github/workflows/runAqaConfig.json`
# Checkout current (TKG) repo to access the repo-specific config file `.github/workflows/runAqaConfig.json` and the shared script `scripts/testRepo/runAqaArgParse.py`
- name: Checkout current repo
uses: actions/checkout@v2
with:
path: 'main'
# Checkout the main TKG repo to access the shared script `scripts/testRepo/runAqaArgParse.py`
- name: Checkout main TKG repo
uses: actions/checkout@v2
with:
repository: 'adoptium/TKG.git'
ref: 'master'
path: 'TKG'
- name: Parse parameters
env:
args: ${{ github.event.comment.body }}
run: python3 TKG/scripts/testBot/runAqaArgParse.py $args 2> log.txt
run: python3 main/scripts/testBot/runAqaArgParse.py $args 2> log.txt
id: argparse
- name: Output log
if: failure()
Expand Down Expand Up @@ -76,6 +69,7 @@ jobs:
comment_body = `
@${{ github.actor }} Build(s) started with the following parameters:
- sdk_resource: ${{ steps.argparse.outputs.sdk_resource }}
- build_repo: ${{ steps.argparse.outputs.build_repo }}
- customized_sdk_url: ${{ steps.argparse.outputs.customized_sdk_url }}
- archive_extension: ${{ steps.argparse.outputs.archive_extension }}
- build_list: ${{ steps.argparse.outputs.build_list }}
Expand All @@ -93,18 +87,9 @@ jobs:
repo: context.repo.repo,
body: comment_body
})
- name: Echo parameters
- name: Echo all parameters
run: |
echo build_parameters: ${{ steps.argparse.outputs.build_parameters }}
echo sdk_resource: ${{ steps.argparse.outputs.sdk_resource }}
echo customized_sdk_url: ${{ steps.argparse.outputs.customized_sdk_url }}
echo archive_extension: ${{ steps.argparse.outputs.archive_extension }}
echo build_list: ${{ steps.argparse.outputs.build_list }}
echo target: ${{ steps.argparse.outputs.target }}
echo platform: ${{ steps.argparse.outputs.platform }}
echo jdk_version: ${{ steps.argparse.outputs.jdk_version }}
echo jdk_impl: ${{ steps.argparse.outputs.jdk_impl }}
echo openjdk_testrepo: ${{ steps.argparse.outputs.openjdk_testrepo }}
echo ${{ steps.argparse.outputs.build_parameters }}

runBuild:
runs-on: ${{ matrix.platform }}
Expand All @@ -114,12 +99,25 @@ jobs:
matrix: ${{ fromJson(needs.parseComment.outputs.build_parameters) }}
steps:
- uses: AdoptOpenJDK/install-jdk@v1
if: matrix.sdk_resource != 'customized'
if: matrix.sdk_resource == 'nightly' || matrix.sdk_resource == 'releases'
with:
version: ${{ matrix.jdk_version }}
source: ${{ matrix.sdk_resource }}
sourceType: 'buildType'
impl: ${{ matrix.jdk_impl }}
- name: Checkout PR Ref
uses: actions/checkout@v2
if: matrix.sdk_resource == 'build-jdk'
with:
repository: ${{ matrix.build_repo_branch.repo }}
ref: ${{ matrix.build_repo_branch.branch }}
path: 'openjdk-build'
- uses: AdoptOpenJDK/build-jdk@v1
if: matrix.sdk_resource == 'build-jdk'
with:
javaToBuild: jdk${{ matrix.jdk_version }}u
impl: ${{ matrix.jdk_impl }}
usePRRef: true # usePRRef=true will cause build-jdk to use the existing openjdk-build/ directory > See https://github.com/AdoptOpenJDK/build-jdk/issues/24#issuecomment-816322945
- uses: AdoptOpenJDK/install-jdk@v1
if: matrix.sdk_resource == 'customized'
with:
Expand Down
17 changes: 16 additions & 1 deletion scripts/testBot/runAqaArgParse.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def main():
parser = argparse.ArgumentParser(prog=keyword, add_help=False)
# Improvement: Automatically resolve the valid choices for each argument populate them below, rather than hard-coding choices.
parser.add_argument('--help', '-h', action='store_true')
parser.add_argument('--sdk_resource', default=['nightly'], choices=['nightly', 'releases', 'customized'], nargs='+')
parser.add_argument('--sdk_resource', default=['nightly'], choices=['nightly', 'releases', 'customized', 'build-jdk'], nargs='+')
parser.add_argument('--build_repo', default=['AdoptOpenJDK/openjdk-build:master'], nargs='+')
parser.add_argument('--customized_sdk_url', default=['None'], nargs='+')
parser.add_argument('--archive_extension', default=['.tar'], choices=['.zip', '.tar', '.7z'], nargs='+')
parser.add_argument('--build_list', default=['openjdk'], choices=['openjdk', 'functional', 'system', 'perf', 'external'], nargs='+')
Expand Down Expand Up @@ -88,6 +89,20 @@ def main():
# Underscore the targets if necessary
args['target'] = underscore_targets(args['target'])

# Split repo and branch from the `build_repo` arg since it is not handled by the AdoptOpenJDK/build-jdk action.
build_repo_branch = []
for br in args['build_repo']:
spl = br.split(':')
if len(spl) != 2:
err_msg = 'Invalid repo+branch suppplied to argument --build_repo. Expecting format <repository>:<branch>'
print('::error ::{}'.format(err_msg))
sys.stderr.write(err_msg)
exit(2)
repo, branch = spl
entry = {'repo': repo, 'branch': branch}
build_repo_branch.append(entry)
args['build_repo_branch'] = build_repo_branch

# If 'customized' sdk_resource, then customized_sdk_url and archive_extension must be present.
if 'customized' in args['sdk_resource'] and args['customized_sdk_url'] == ['None']:
err_msg = '--customized_sdk_url must be provided if sdk_resource is set to customized.'
Expand Down