-
Notifications
You must be signed in to change notification settings - Fork 32
61 lines (59 loc) · 1.77 KB
/
reusable-java-test.yml
File metadata and controls
61 lines (59 loc) · 1.77 KB
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
name: Reusable Java Testing Workflow
on:
workflow_call:
inputs:
target-branch:
description: 'Branch to checkout and test (defaults to the calling branch)'
required: false
type: string
default: ''
java-versions:
description: 'JSON array of Java versions to test against'
required: false
type: string
default: '["8", "16", "18", "19"]'
platforms:
description: 'JSON array of platforms to run tests on'
required: false
type: string
default: '["ubuntu-latest"]'
test-script:
description: 'Test script to execute'
required: false
type: string
default: './run-tests.sh'
secrets:
PIPELINE_GITHUB_APP_ID:
required: false
PIPELINE_GITHUB_APP_PRIVATE_KEY:
required: false
DD_API_KEY:
required: false
jobs:
test:
strategy:
matrix:
java-version: ${{ fromJSON(inputs.java-versions) }}
platform: ${{ fromJSON(inputs.platforms) }}
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
repository: DataDog/datadog-api-client-java
ref: ${{ inputs.target-branch || github.ref }}
- name: Install Java
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java-version }}
distribution: "temurin"
cache: "maven"
- name: Configure Datadog Test Optimization
uses: datadog/test-visibility-github-action@v2
with:
languages: java
api_key: ${{ secrets.DD_API_KEY }}
- name: Test
run: ${{ inputs.test-script }}
env:
DD_CIVISIBILITY_COMPILER_PLUGIN_AUTO_CONFIGURATION_ENABLED: "false"