Skip to content

Commit

Permalink
chore: migrate tests actions to new self serve changes (#666)
Browse files Browse the repository at this point in the history
PR: #666
  • Loading branch information
OmarAlJarrah authored Aug 13, 2024
1 parent ad0cfd7 commit 74268e4
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 17 deletions.
1 change: 0 additions & 1 deletion .github/workflows/generator-download-specs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ jobs:
with:
name: raw-specs
path: raw-specs.yaml
overwrite: true
8 changes: 5 additions & 3 deletions .github/workflows/generator-test-sdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,17 @@ jobs:
url: ${{ inputs.specs_url }}
transform-specs:
needs: [ download-specs ]
uses: ./.github/workflows/generator-transform-specs.yaml
uses: ./.github/workflows/selfserve-transform-specs.yaml
with:
configurations: -th -te ${{ inputs.endpoint_prefix }} --operationIdsToTags
specs_key: 'raw-specs'
transformations: -th -te ${{ inputs.endpoint_prefix }} --operationIdsToTags
generate-sdk:
needs: [ transform-specs ]
uses: ./.github/workflows/generator-generate.yaml
uses: ./.github/workflows/selfserve-generate.yaml
with:
name: ${{ inputs.namespace }}
version: ${{ inputs.version }}
templates: 'sdk-repo/generator/openapi/src/main/resources/templates/expediagroup-sdk'
sdk-metadata:
runs-on: ubuntu-latest
needs: [ generate-sdk ]
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/pr-check-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,11 @@ 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
12 changes: 5 additions & 7 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ on:
required: true
type: string
default: 'rapid'
jdk:
description: 'JDK version to use'
required: true
type: string
default: '21'
endpoint_prefix:
description: 'Endpoint to prepend specs paths with'
required: true
Expand All @@ -84,6 +79,7 @@ jobs:
if 'sdk' in '${{ inputs.source }}' and not('${{ inputs.sdk_version }}'):
print('::error::Invalid SDK version: ${{ inputs.sdk_version }}')
exit(1)
generate-test-sdk:
if: inputs.source == 'specs'
needs: [ inputs-validation ]
Expand All @@ -95,13 +91,15 @@ jobs:
specs_url: ${{ inputs.specs_url }}
secrets: inherit
run-rapid-examples:
strategy:
matrix:
jdk: [8, 11, 17, 21]
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: ${{ inputs.jdk }}
sdk_generation_workflow_run_id: ${{ github.run_id }}
jdk: ${{ matrix.jdk }}
secrets:
KEY: ${{ secrets.RAPID_KEY }}
SECRET: ${{ secrets.RAPID_SECRET }}
11 changes: 11 additions & 0 deletions .github/workflows/selfserve-generate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ on:
description: 'Key to the generated SDK artifact'
default: 'sdk'
type: string
jar_key:
description: 'Key to the generated JAR artifact'
default: 'jar'
type: string

jobs:
generate:
Expand Down Expand Up @@ -61,4 +65,11 @@ jobs:
path: |
sdk-repo/generator/openapi/target/sdk
!sdk-repo/generator/openapi/target/sdk/target
- name: Persist JAR Artifact # TODO: Remove when product config is proposed
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.jar_key }}
path: |
sdk-repo/generator/openapi/target/sdk/target/*.jar
sdk-repo/generator/openapi/target/sdk/target/maven-archiver/pom.properties
overwrite: true

0 comments on commit 74268e4

Please sign in to comment.