@@ -3,88 +3,88 @@ name: run tests
33on : [push]
44
55jobs :
6- test :
7- runs-on : ubuntu-latest
8- permissions :
9- contents : ' read'
10- id-token : ' write'
6+ test :
7+ runs-on : ubuntu-latest
8+ permissions :
9+ contents : " read"
10+ id-token : " write"
1111
12- steps :
13- - uses : actions/checkout@v4
14- - name : Authenticate to Google Cloud
15- id : auth
16- uses : google-github-actions/auth@v1
17- with :
18- token_format : access_token
19- workload_identity_provider : projects/949875736540/locations/global/workloadIdentityPools/external-pool/providers/github-provider
20- service_account :
[email protected] 21- - name : Login to GAR
22- uses : docker/login-action@v3
23- with :
24- registry : europe-west3-docker.pkg.dev
25- username : oauth2accesstoken
26- password : ${{ steps.auth.outputs.access_token }}
27- -
uses :
hoverkraft-tech/[email protected] 28- - name : Set up Java
29- uses : actions/setup-java@v4
30- with :
31- distribution : ' temurin'
32- java-version : ' 21'
33- cache : ' gradle'
34- - name : Install dependencies
35- run : |
36- sudo apt-get install jq curl
37- - name : Set Release version env variable
38- run : |
39- echo "RELEASE_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
40- - name : Run example
41- run : |
42- echo "running example";
43- sleep 5;
44- docker compose logs;
45- curl --location "http://localhost:9000/v1/users"
46-
47- ACCOUNT_RESPONSE=$(curl -s --location "http://localhost:9000/v1/accounts" \
48- --header "Content-Type: application/json" \
49- --data-raw '{
50- "companyName": "demo",
51- 52- "password": "Password1234!"
53- }');
54- export TALON_USER_ID=$(echo $ACCOUNT_RESPONSE | jq ".userId");
55- export TALON_USER_TOKEN=$(echo $ACCOUNT_RESPONSE | jq ".token" | tr -d '"');
56- USER_RESPONSE=$(curl -s --location "http://localhost:9000/v1/users/$TALON_USER_ID" \
57- --header "Authorization: Bearer $TALON_USER_TOKEN");
58- export TALON_ACCOUNT_ID=$(echo $USER_RESPONSE | jq ".accountId");
59- echo "User with ID $TALON_USER_ID and Token $TALON_USER_TOKEN was created for application $TALON_ACCOUNT_ID";
60- APPLICATION_RESPONSE=$(curl -s --location "http://localhost:9000/v1/applications" \
61- --header "Content-Type: application/json" \
62- --header "Authorization: Bearer $TALON_USER_TOKEN" \
63- --data-raw '{
64- "name": "demo",
65- "currency": "EUR",
66- "timezone": "Europe/Berlin",
67- "enableFlattenedCartItems": false
68- }');
69- export TALON_APPLICATION_ID=$(echo $USER_RESPONSE | jq ".id");
70- echo "Application with ID $TALON_APPLICATION_ID was created"
71- API_KEY_RESPONSE=$(curl -s -v --location "http://localhost:9000/v1/applications/$TALON_APPLICATION_ID/apikeys" \
72- --header "Content-Type: application/json" \
73- --header "Authorization: Bearer $TALON_USER_TOKEN" \
74- --data-raw '{
75- "title": "Application HIT KEY",
76- "expires": "2099-01-01T0:00:00Z"
77- }');
78- echo "Api-Key-Response: $API_KEY_RESPONSE";
79- export TALON_API_KEY=$(echo $API_KEY_RESPONSE | jq ".key" | tr -d '"');
80- echo "Api-Key $TALON_API_KEY created";
12+ steps :
13+ - uses : actions/checkout@v4
14+ - name : Authenticate to Google Cloud
15+ id : auth
16+ uses : google-github-actions/auth@v1
17+ with :
18+ token_format : access_token
19+ workload_identity_provider : projects/949875736540/locations/global/workloadIdentityPools/external-pool/providers/github-provider
20+ service_account :
[email protected] 21+ - name : Login to GAR
22+ uses : docker/login-action@v3
23+ with :
24+ registry : europe-west3-docker.pkg.dev
25+ username : oauth2accesstoken
26+ password : ${{ steps.auth.outputs.access_token }}
27+ -
uses :
hoverkraft-tech/[email protected] 28+ - name : Set up Java
29+ uses : actions/setup-java@v4
30+ with :
31+ distribution : " temurin"
32+ java-version : " 21"
33+ cache : " gradle"
34+ - name : Install dependencies
35+ run : |
36+ sudo apt-get install jq curl
37+ - name : Set Release version env variable
38+ run : |
39+ echo "RELEASE_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
40+ - name : Run example
41+ run : |
42+ echo "running example";
43+ sleep 5;
44+ docker compose logs;
45+ curl --location "http://localhost:9000/v1/users"
8146
82- echo "maven install";
83- mvn clean install;
84- export CLASSPATH=.:./src/main/java:./target/lib/gson-2.8.9.jar:./target/talon-one-client-${{ env.RELEASE_VERSION }}.jar:./target/lib/okio-1.17.2.jar:./target/lib/okhttp-3.14.7.jar:./target/lib/threetenbp-1.4.3.jar:./target/lib/gson-fire-1.8.4.jar;
85-
86- echo "java compile";
87- javac -d . Example.java;
47+ ACCOUNT_RESPONSE=$(curl -s --location "http://localhost:9000/v1/accounts" \
48+ --header "Content-Type: application/json" \
49+ --data-raw '{
50+ "companyName": "demo",
51+ 52+ "password": "Password1234!"
53+ }');
54+ export TALON_USER_ID=$(echo $ACCOUNT_RESPONSE | jq ".userId");
55+ export TALON_USER_TOKEN=$(echo $ACCOUNT_RESPONSE | jq ".token" | tr -d '"');
56+ USER_RESPONSE=$(curl -s --location "http://localhost:9000/v1/users/$TALON_USER_ID" \
57+ --header "Authorization: Bearer $TALON_USER_TOKEN");
58+ export TALON_ACCOUNT_ID=$(echo $USER_RESPONSE | jq ".accountId");
59+ echo "User with ID $TALON_USER_ID and Token $TALON_USER_TOKEN was created for application $TALON_ACCOUNT_ID";
60+ APPLICATION_RESPONSE=$(curl -s --location "http://localhost:9000/v1/applications" \
61+ --header "Content-Type: application/json" \
62+ --header "Authorization: Bearer $TALON_USER_TOKEN" \
63+ --data-raw '{
64+ "name": "demo",
65+ "currency": "EUR",
66+ "timezone": "Europe/Berlin",
67+ "enableFlattenedCartItems": false
68+ }');
69+ export TALON_APPLICATION_ID=$(echo $USER_RESPONSE | jq ".id");
70+ echo "Application with ID $TALON_APPLICATION_ID was created"
71+ API_KEY_RESPONSE=$(curl -s -v --location "http://localhost:9000/v1/applications/$TALON_APPLICATION_ID/apikeys" \
72+ --header "Content-Type: application/json" \
73+ --header "Authorization: Bearer $TALON_USER_TOKEN" \
74+ --data-raw '{
75+ "title": "Application HIT KEY",
76+ "expires": "2099-01-01T0:00:00Z"
77+ }');
78+ echo "Api-Key-Response: $API_KEY_RESPONSE";
79+ export TALON_API_KEY=$(echo $API_KEY_RESPONSE | jq ".key" | tr -d '"');
80+ echo "Api-Key $TALON_API_KEY created";
8881
89- echo "java execute";
90- java com.example.consumer.Example;
82+ echo "maven install";
83+ mvn clean install;
84+ export CLASSPATH=.:./src/main/java:./target/lib/gson-2.8.9.jar:./target/talon-one-client-${{ env.RELEASE_VERSION }}.jar:./target/lib/okio-1.17.2.jar:./target/lib/okhttp-4.9.2.jar:./target/lib/threetenbp-1.4.3.jar:./target/lib/gson-fire-1.8.4.jar;
85+
86+ echo "java compile";
87+ javac -d . Example.java;
88+
89+ echo "java execute";
90+ java com.example.consumer.Example;
0 commit comments