Skip to content

Commit

Permalink
moved java installation, code checkout and parameters validation to t…
Browse files Browse the repository at this point in the history
…he main yml
  • Loading branch information
alexradzin committed Nov 22, 2023
1 parent 6bb960c commit 647638a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 30 deletions.
15 changes: 0 additions & 15 deletions .github/workflows/integration-test-v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,6 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Validate database and engine
if: ${{ (github.event.inputs.database == '') != (github.event.inputs.engine == '') }}
uses: actions/github-script@v3
with:
script: |
core.setFailed("Database and Engine parameters should be provided simultaneously")
- name: Check out code
uses: actions/checkout@v3

- name: Prepare java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
- name: Determine env variables
run: |
if [ "${{ github.event.inputs.environment }}" == 'staging' ]; then
Expand Down
15 changes: 0 additions & 15 deletions .github/workflows/integration-test-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,6 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Validate database and engine
if: ${{ (github.event.inputs.database == '') != (github.event.inputs.engine == '') }}
uses: actions/github-script@v3
with:
script: |
core.setFailed("Database and Engine parameters should be provided simultaneously")
- name: Check out code
uses: actions/checkout@v3

- name: Prepare java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
- name: Determine env variables
run: |
if [ "${{ github.event.inputs.environment }}" == 'staging' ]; then
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,31 @@ on:
- 'false'

jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Validate database and engine
if: ${{ (github.event.inputs.run-v1 && (github.event.inputs.database1 == '' || github.event.inputs.engine1 == '')) || (github.event.inputs.run-v2 && (github.event.inputs.database2 == '' || github.event.inputs.engine2 == '')) }}
uses: actions/github-script@v3
with:
script: |
core.setFailed("Database and Engine parameters should be provided simultaneously")
- name: Check out code
uses: actions/checkout@v3

- name: Prepare java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'

- name: Build
run: ./gradlew build -x test

run-integration-tests1:
if: ${{ github.event.inputs.run-v1 }}
needs: [setup]
uses: ./.github/workflows/integration-test-v1.yml
with:
database: ${{ github.event.inputs.database1 }}
Expand All @@ -62,6 +85,7 @@ jobs:

run-integration-tests2:
if: ${{ github.event.inputs.run-v2 }}
needs: [setup]
uses: ./.github/workflows/integration-test-v2.yml
with:
database: ${{ github.event.inputs.database2 }}
Expand Down

0 comments on commit 647638a

Please sign in to comment.