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

Add certain directories trigger for PR/push testing #2241

Merged
merged 6 commits into from
Feb 11, 2021
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
58 changes: 58 additions & 0 deletions .github/workflows/directoriesFilesChangePR.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: 'Directories/Files Change Test PR'
on:
pull_request:
types: [ready_for_review]
paths-ignore:
- '.gitignore'
- '*.md'
- 'doc/**'
- '.github/ISSUE_TEMPLATE/**'
- '.github/*.yml'
- 'buildenv/**'
jobs:
getBuildLists:
runs-on: ubuntu-latest
outputs:
buildLists: ${{ steps.locations_parse.outputs.build_lists }}
steps:
- uses: actions/checkout@v2
- uses: jitterbit/get-changed-files@v1
id: get_change
with:
format: space-delimited
token: ${{ secrets.GITHUB_TOKEN }}
- name: parse locations
id: locations_parse
run: |
python3 ./.github/workflows/getBuildLists.py ${{ steps.get_change.outputs.all }}
testChangeBasedBuildListWithHotspotAndOpenj9:
runs-on: ${{ matrix.os }}
needs: getBuildLists
if: ${{!contains( fromJson(needs.getBuildLists.outputs.buildLists), 'skip')}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-16.04, macos-10.15, windows-2016]
version: [8, 15]
build_list: ${{ fromJson(needs.getBuildLists.outputs.buildLists) }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would suggest add impl: [hotspot, openj9] to combine testChangeBasedBuildListWithHotspot and testChangeBasedBuildListWithopenj9 to one job to reduce code redundancy so it's easy to maintain.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed by adding impl: [hotspot, openj9] and impl: ${{ matrix.impl }}.

impl: [hotspot, openj9]
steps:
- uses: actions/checkout@v2
- uses: AdoptOpenJDK/install-jdk@v1
with:
version: ${{ matrix.version }}
source: 'nightly'
impl: ${{ matrix.impl }}
- name: AQA
uses: AdoptOpenJDK/run-aqa@v1
with:
build_list: ${{ matrix.build_list }}
target: '_sanity.${{ matrix.build_list }}'
jdksource: 'install-jdk'
version: ${{ matrix.version }}
openjdk_testRepo: '${{ github.event.pull_request.head.repo.full_name }}:${GITHUB_HEAD_REF}'
- uses: actions/upload-artifact@v2
if: failure()
with:
name: output_changed_based_build_list
path: ./**/output_*/
25 changes: 25 additions & 0 deletions .github/workflows/getBuildLists.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import sys
import json


def main():
print(sys.argv)
result = []
# TODO: handle the change of buildenv dir
for argument in sys.argv:
if (argument.startswith('perf/') and ('perf' not in result)):
result.append('perf')
elif (argument.startswith('system/') and ('system' not in result)):
result.append('system')
elif (argument.startswith('functional/') and ('functional' not in result)):
result.append('functional')
elif (argument.startswith('openjdk/') and ('openjdk' not in result)):
result.append('openjdk')

if not result:
result.append('skip')
print('::set-output name=build_lists::{}'.format(json.dumps(result)))


if __name__ == "__main__":
main()