-
Notifications
You must be signed in to change notification settings - Fork 497
74 lines (67 loc) · 3.21 KB
/
check_pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#
# Copyright (c) 2024 Alibaba Group Holding Limited. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Alibaba designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
name: Prerequisites
on:
workflow_call:
inputs:
platforms:
required: true
type: string
outputs:
should_run:
value: ${{ jobs.prerequisites.outputs.should_run }}
bundle_id:
value: ${{ jobs.prerequisites.outputs.bundle_id }}
platform_linux_x64:
value: ${{ jobs.prerequisites.outputs.platform_linux_x64 }}
platform_linux_aarch64:
value: ${{ jobs.prerequisites.outputs.platform_linux_aarch64 }}
jobs:
check_commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dragonwell-releng/check_commit_action@master
if: github.event_name == 'pull_request'
prerequisites:
name: 'Prerequisites'
runs-on: ubuntu-latest
outputs:
should_run: ${{ steps.check_submit.outputs.should_run }}
bundle_id: ${{ steps.check_bundle_id.outputs.bundle_id }}
platform_linux_x64: ${{ steps.check_platforms.outputs.platform_linux_x64 }}
platform_linux_aarch64: ${{ steps.check_platforms.outputs.platform_linux_aarch64 }}
steps:
- name: 'Check if submit tests should actually run depending on secrets and manual triggering'
id: check_submit
run: echo "::set-output name=should_run::${{ inputs.platforms != '' || (!secrets.JDK_SUBMIT_FILTER || startsWith(github.ref, 'refs/heads/submit/')) }}"
- name: 'Check which platforms should be included'
id: check_platforms
run: |
echo "::set-output name=platform_linux_x64::${{ contains(inputs.platforms, 'linux x64') || (inputs.platforms == '') }}"
echo "::set-output name=platform_linux_aarch64::${{ contains(inputs.platforms, 'linux aarch64') || (inputs.platforms == '') }}"
echo "::set-output name=platform_windows_x64::${{ contains(inputs.platforms, 'windows x64') || (inputs.platforms == '') }}"
echo "::set-output name=platform_riscv64::${{ contains(inputs.platforms, 'riscv64') || (inputs.platforms == '') }}"
if: steps.check_submit.outputs.should_run != false
- name: 'Determine unique bundle identifier'
id: check_bundle_id
run: echo "::set-output name=bundle_id::${GITHUB_ACTOR}_${GITHUB_SHA:0:8}"
if: steps.check_submit.outputs.should_run != 'false'