forked from epam/ai-dial-ci
-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (91 loc) · 3.04 KB
/
java_test.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Java tests
on:
workflow_call:
inputs:
bypass_checks:
type: boolean
default: false
description: Do not fail pipeline if checks failed
enable_style_checks:
type: boolean
default: true
description: Enable style_checks
bypass_style_checks:
type: boolean
default: false
description: Do not fail pipeline if style_checks failed
enable_code_checks:
type: boolean
default: true
description: Enable code_checks
bypass_code_checks:
type: boolean
default: false
description: Do not fail pipeline if code_checks failed
enable_ort:
type: boolean
default: true
description: Enable ORT scanning
bypass_ort:
type: boolean
default: false
description: Do not fail pipeline if ORT scan failed
ort_version:
type: string
default: "latest"
description: ORT version to use
java_version:
type: string
default: "17"
description: Java version to use
java_distribution:
type: string
default: "temurin"
description: Java distribution to use
jobs:
style_checks:
if: ${{ inputs.enable_style_checks }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
lfs: true
- uses: nepalevov/ai-dial-ci/actions/java_prepare@main
with:
java_version: ${{ inputs.java_version }}
java_distribution: ${{ inputs.java_distribution }}
- name: Test
continue-on-error: ${{ inputs.bypass_checks || inputs.bypass_style_checks }}
shell: bash
run: |
./gradlew checkstyleMain
code_checks:
if: ${{ inputs.enable_code_checks }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
lfs: true
- uses: nepalevov/ai-dial-ci/actions/java_prepare@main
with:
java_version: ${{ inputs.java_version }}
java_distribution: ${{ inputs.java_distribution }}
- name: Test
continue-on-error: ${{ inputs.bypass_checks || inputs.bypass_code_checks }}
shell: bash
run: |
./gradlew check || { echo "::error::Tests failed" && exit 1; } # TODO: figure out why we need to capture exit code
ort:
if: ${{ inputs.enable_ort }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
lfs: true
- uses: oss-review-toolkit/ort-ci-github-action@9acdf1e56f1b42972b12274ae56c35bf70a5f65b # v1.0.1
with:
image: "ghcr.io/oss-review-toolkit/ort:${{ inputs.ort_version }}"
allow-dynamic-versions: "true"
fail-on: "violations"
ort-cli-args: "-P ort.forceOverwrite=true --stacktrace -P ort.analyzer.enabledPackageManagers=Gradle"
continue-on-error: ${{ inputs.bypass_checks || inputs.bypass_ort }}