-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (61 loc) · 1.79 KB
/
run-examples.yaml
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
name: Run Examples
on:
workflow_call:
inputs:
source:
description: 'Source of SDK to Test'
required: true
type: string
default: 'specs'
sdk_version:
description: 'SDK version to run examples for'
required: false
type: string
default: 'LATEST'
jdk:
description: 'JDK version to use'
required: true
type: string
default: '21'
distribution:
description: 'JDK distribution to use'
required: false
type: string
default: 'corretto'
sdk_key:
description: 'Generated SDK artifact key'
required: false
type: string
default: 'sdk'
secrets:
KEY:
description: 'API Key'
required: true
SECRET:
description: 'API Key'
required: true
jobs:
run-examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
if: ${{ inputs.sdk_key != '' }}
with:
repository: 'ExpediaGroup/rapid-java-sdk'
- uses: actions/download-artifact@v4
if: ${{ inputs.source == 'specs' }}
with:
name: ${{ inputs.sdk_key }}
path: examples/sdk
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{ inputs.jdk }}
distribution: ${{ inputs.distribution }}
- name: Install SDK into local repository
if: ${{ inputs.source == 'specs' }}
working-directory: examples/sdk
run: mvn install
- name: Run Examples
working-directory: examples
run: mvn install exec:java -Drapid-java-sdk.sdk.version="${{ inputs.sdk_version }}" -Dcom.expediagroup.rapidsdkjava.apikey="${{ secrets.KEY }}" -Dcom.expediagroup.rapidsdkjava.apisecret="${{ secrets.SECRET }}"