Skip to content

Commit

Permalink
Merge branch 'main' into OmarAlJarrah/add-contract-tests-generator
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarAlJarrah authored Aug 8, 2024
2 parents 6e5566a + dfccfaf commit 840e33d
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 16 deletions.
1 change: 1 addition & 0 deletions .github/workflows/core-upgrade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ jobs:
with:
name: branch-name
path: branch_name.txt
overwrite: true

- name: Publish Updated Version PR
uses: peter-evans/create-pull-request@v6
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/generator-download-specs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ jobs:
with:
name: raw-specs
path: raw-specs.yaml
overwrite: true
3 changes: 3 additions & 0 deletions .github/workflows/generator-generate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,16 @@ jobs:
path: |
generator/openapi/target/sdk
!generator/openapi/target/sdk/target
overwrite: true
- uses: actions/upload-artifact@v4
with:
name: jar
path: |
generator/openapi/target/sdk/target/*.jar
generator/openapi/target/sdk/target/maven-archiver/pom.properties
overwrite: true
- uses: actions/upload-artifact@v4
with:
name: docs
path: generator/openapi/target/sdk/target/dokka
overwrite: true
4 changes: 4 additions & 0 deletions .github/workflows/generator-test-sdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ on:
description: 'Endpoint to prepend specs paths with'
required: true
type: string
specs_url:
description: 'Run tests based on specs'
required: true
type: string
outputs:
artifactId:
value: ${{ jobs.sdk-metadata.outputs.artifactId }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/generator-transform-specs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ jobs:
with:
name: specs
path: specs.yaml
overwrite: true
1 change: 1 addition & 0 deletions .github/workflows/generator-verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
with:
name: sdk
path: generator/openapi/target/sdk
overwrite: true
verify-generated-sdk:
runs-on: ubuntu-latest
needs: generate-sdk
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/pr-check-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: PR Check Tests Run
on: push

jobs:
run-rapid-tests:
strategy:
matrix:
jdk: [8, 11, 17, 21]
fail-fast: true
max-parallel: 1
uses: ./.github/workflows/run-tests.yaml
with:
source: 'specs'
specs_url: 'https://ewe-assets.s3.amazonaws.com/developer-tools/api/rapid/v3/specs.yaml'
sdk_version: 1.0.${{ github.run_id }}
sdk_namespace: 'rapid'
jdk: ${{ matrix.jdk }}
endpoint_prefix: '/v3'
secrets: inherit
24 changes: 12 additions & 12 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Run Tests
on:
push:
workflow_dispatch:
inputs:
source:
Expand Down Expand Up @@ -66,7 +65,7 @@ on:
description: 'JDK version to use'
required: true
type: string
default: '17'
default: '21'
endpoint_prefix:
description: 'Endpoint to prepend specs paths with'
required: true
Expand All @@ -78,29 +77,30 @@ jobs:
steps:
- shell: python -u {0}
run: |
if 'specs' in '${{ github.event.inputs.source }}' and not('${{ github.event.inputs.specs_url }}'):
print('::error::Invalid specs URL: ${{ github.event.inputs.specs_url }}')
if 'specs' in '${{ inputs.source }}' and not('${{ inputs.specs_url }}'):
print('::error::Invalid specs URL: ${{ inputs.specs_url }}')
exit(1)
if 'sdk' in '${{ github.event.inputs.source }}' and not('${{ github.event.inputs.sdk_version }}'):
print('::error::Invalid SDK version: ${{ github.event.inputs.sdk_version }}')
if 'sdk' in '${{ inputs.source }}' and not('${{ inputs.sdk_version }}'):
print('::error::Invalid SDK version: ${{ inputs.sdk_version }}')
exit(1)
generate-test-sdk:
if: ${{ github.event.inputs.source == 'specs' }}
if: inputs.source == 'specs'
needs: [ inputs-validation ]
uses: ./.github/workflows/generator-test-sdk.yaml
with:
version: ${{ github.event.inputs.sdk_version }}
namespace: ${{ github.event.inputs.sdk_namespace }}
endpoint_prefix: ${{ github.event.inputs.endpoint_prefix }}
version: ${{ inputs.sdk_version }}
namespace: ${{ inputs.sdk_namespace }}
endpoint_prefix: ${{ inputs.endpoint_prefix }}
specs_url: ${{ inputs.specs_url }}
secrets: inherit
run-rapid-examples:
if: always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
if: always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') && inputs.sdk_namespace == 'rapid'
needs: [ generate-test-sdk ]
uses: "ExpediaGroup/rapid-java-sdk/.github/workflows/run-examples.yaml@main"
with:
sdk_version: ${{ needs.generate-test-sdk.outputs.version }}
jdk: ${{ github.event.inputs.jdk }}
jdk: ${{ inputs.jdk }}
sdk_generation_workflow_run_id: ${{ github.run_id }}
secrets:
KEY: ${{ secrets.RAPID_KEY }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/selfserve-generate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,4 @@ jobs:
path: |
sdk-repo/generator/openapi/target/sdk
!sdk-repo/generator/openapi/target/sdk/target
overwrite: true
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<maven-source-plugin.version>3.3.0</maven-source-plugin.version>
<maven-surefire-plugin.version>3.3.1</maven-surefire-plugin.version>
<build-helper-maven-plugin.version>3.4.0</build-helper-maven-plugin.version>
<exec-maven-plugin.version>3.3.0</exec-maven-plugin.version>
<exec-maven-plugin.version>3.4.0</exec-maven-plugin.version>
<ktlint-plugin.version>3.2.0</ktlint-plugin.version>
<jacoco-plugin.version>0.8.12</jacoco-plugin.version>
<dokka-plugin.version>1.9.20</dokka-plugin.version>
Expand All @@ -90,7 +90,7 @@
<properties.maven.plugin.version>1.0.0</properties.maven.plugin.version>

<!-- Kotlin Compatible Versions -->
<kotlin.version>2.0.0</kotlin.version>
<kotlin.version>2.0.10</kotlin.version>
<kotlinx.coroutines.version>1.8.1</kotlinx.coroutines.version>
<kotlinx.serialization.version>1.7.1</kotlinx.serialization.version>
<ktor.version>2.3.12</ktor.version>
Expand All @@ -105,7 +105,7 @@
<junit5.version>5.10.3</junit5.version>
<mockk.version>1.13.12</mockk.version>
<mockito.version>5.12.0</mockito.version>
<slf4j.version>2.0.13</slf4j.version>
<slf4j.version>2.0.14</slf4j.version>
<log4j.version>2.23.1</log4j.version>

<swagger.core.version>2.2.22</swagger.core.version>
Expand Down Expand Up @@ -272,7 +272,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.15.0</version>
<version>3.16.0</version>
</dependency>
<dependency>
<groupId>org.checkerframework</groupId>
Expand Down

0 comments on commit 840e33d

Please sign in to comment.