Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added java-integration-test #101

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
d7c125f
Added java-integration-test
Nikita-Smirnov-Exactpro Dec 16, 2024
084bdda
Renamed integration test job
Nikita-Smirnov-Exactpro Dec 16, 2024
22ba244
Added runOn parameter for integration-test
Nikita-Smirnov-Exactpro Dec 16, 2024
0cbc3ca
Added parameters to manage integration tests into compound-java and c…
Nikita-Smirnov-Exactpro Dec 16, 2024
3fd2458
Rename Run integration test step
Nikita-Smirnov-Exactpro Dec 16, 2024
60c6e80
Added name for integration test
Nikita-Smirnov-Exactpro Dec 16, 2024
d775268
Corrected after review
Nikita-Smirnov-Exactpro Dec 16, 2024
8b81b23
Corrected condition for docker publish and sonatype push
Nikita-Smirnov-Exactpro Dec 16, 2024
f832ff2
Corrected condition for docker publish and sonatype push
Nikita-Smirnov-Exactpro Dec 16, 2024
7806301
Corrected condition of docker-push and sonatype-push stages in the co…
Nikita-Smirnov-Exactpro Dec 18, 2024
e1fb3ac
Corrected condition of docker-push and sonatype-push stages in the co…
Nikita-Smirnov-Exactpro Dec 18, 2024
85c87a4
Corrected condition of docker-push and sonatype-push stages in the co…
Nikita-Smirnov-Exactpro Dec 18, 2024
a1b57a4
Corrected condition of docker-push and sonatype-push stages in the co…
Nikita-Smirnov-Exactpro Dec 18, 2024
f57813f
Corrected condition of docker-push and sonatype-push stages in the co…
Nikita-Smirnov-Exactpro Dec 18, 2024
c482463
Corrected condition of docker-push and sonatype-push stages in the co…
Nikita-Smirnov-Exactpro Dec 18, 2024
9946eb5
Corrected condition of docker-push and sonatype-push stages in the co…
Nikita-Smirnov-Exactpro Dec 18, 2024
7f45e9f
Corrected condition of docker-push and sonatype-push stages in the co…
Nikita-Smirnov-Exactpro Dec 18, 2024
7c2e272
Corrected condition of docker-push and sonatype-push stages in the co…
Nikita-Smirnov-Exactpro Dec 18, 2024
70797ed
Added compound-java-check
Nikita-Smirnov-Exactpro Dec 18, 2024
56cb591
Corrected license_check workflow value
Nikita-Smirnov-Exactpro Dec 18, 2024
b4dd901
Corrected name of workflow variables
Nikita-Smirnov-Exactpro Dec 18, 2024
49624c1
Corrected branch name
Nikita-Smirnov-Exactpro Dec 18, 2024
482adf8
Corrected arguments name
Nikita-Smirnov-Exactpro Dec 18, 2024
faf4cfa
Corrected inputs name
Nikita-Smirnov-Exactpro Dec 18, 2024
6565783
Corrected format of output in Compound Java checks
Nikita-Smirnov-Exactpro Dec 18, 2024
e775817
Corrected format of output in Compound Java checks
Nikita-Smirnov-Exactpro Dec 18, 2024
bb83a04
Added test-job
Nikita-Smirnov-Exactpro Dec 18, 2024
04c3bd8
Added !cancelled() and multi-lines output value
Nikita-Smirnov-Exactpro Dec 18, 2024
f472bb2
Corrected condition in compound java dev
Nikita-Smirnov-Exactpro Dec 18, 2024
5adaada
Corrected condition
Nikita-Smirnov-Exactpro Dec 18, 2024
e2adfae
Removed !cancelled()
Nikita-Smirnov-Exactpro Dec 18, 2024
819a917
Applied changes to other cases
Nikita-Smirnov-Exactpro Dec 18, 2024
9658ba4
added test-job
Nikita-Smirnov-Exactpro Dec 18, 2024
6265063
test pass secret as intput parameter
Nikita-Smirnov-Exactpro Dec 18, 2024
b9a119f
replaced status to aggregated-status
Nikita-Smirnov-Exactpro Dec 18, 2024
189dd9e
Added show-java-check-status
Nikita-Smirnov-Exactpro Dec 18, 2024
195bc71
Corrected aggregated-status value
Nikita-Smirnov-Exactpro Dec 18, 2024
38f9b80
Refactored
Nikita-Smirnov-Exactpro Dec 18, 2024
05e57e5
added show-java-check-status into compound-java-check
Nikita-Smirnov-Exactpro Dec 19, 2024
c93b158
removed show-java-check-status
Nikita-Smirnov-Exactpro Dec 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions .github/workflows/compound-java-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,21 @@ on:
type: boolean
default: false
description: 'false for dependencyCheckAnalyze, true for dependencyCheckAggregate'
integration-test-enabled:
required: false
type: boolean
default: true
Nikita-Smirnov-Exactpro marked this conversation as resolved.
Show resolved Hide resolved
description: 'Whether integration test is enabled'
integration-test-projects:
required: false
type: string
default: "['.']"
description: 'list of projects for running integration tests'
integration-test-task:
required: false
type: string
default: 'integrationTest'
description: "Gradle task name to run integration test"

outputs:
version:
Expand Down Expand Up @@ -83,7 +98,7 @@ jobs:
docker-push:
name: Build Docker image and push to ghcr.io
if: (contains(inputs.build-target, 'Docker') || contains(inputs.build-target, 'docker')) && (inputs.strict-scanner && success() || !inputs.strict-scanner)
needs: [prebuild-job, owasp-scan, license-check]
needs: [prebuild-job, owasp-scan, license-check, integration-test]
uses: th2-net/.github/.github/workflows/compaund-java-docker-push.yml@main
with:
docker-username: ${{ inputs.docker-username }}
Expand All @@ -108,7 +123,7 @@ jobs:
sonatype-push:
if: (contains(inputs.build-target, 'Sonatype') || contains(inputs.build-target, 'sonatype')) && (inputs.strict-scanner && success() || !inputs.strict-scanner )
name: Build and Push Jar to Sonatype
needs: [ prebuild-job, owasp-scan, license-check ]
needs: [ prebuild-job, owasp-scan, license-check, integration-test ]
uses: th2-net/.github/.github/workflows/compaund-java-sonatype-push.yml@main
with:
runsOn: ${{ inputs.runsOn }}
Expand Down Expand Up @@ -138,3 +153,16 @@ jobs:
needs: [prebuild-job]
with:
version: ${{ needs.prebuild-job.outputs.version }}

integration-test:
if: inputs.integration-test-enabled
strategy:
matrix:
integration-test-project: ${{ fromJson(inputs.integration-test-projects) }}
uses: th2-net/.github/.github/workflows/java-integration-test.yml@integration-tests # FIXME: switch to main branch
with:
runsOn: ${{ inputs.runsOn }}
javaVersion: ${{ inputs.javaVersion }}
javaVendor: ${{ inputs.javaVendor }}
projectPath: ${{ matrix.integration-test-project }}
integrationTestTask: ${{ inputs.integration-test-task }}
32 changes: 30 additions & 2 deletions .github/workflows/compound-java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,21 @@ on:
type: boolean
default: false
description: 'Whether creating and publishing git tag'
integration-test-enabled:
required: false
type: boolean
default: true
description: 'Whether integration test is enabled'
integration-test-projects:
required: false
type: string
default: "['.']"
description: 'list of projects for running integration tests'
integration-test-task:
required: false
type: string
default: 'integrationTest'
description: "Gradle task name to run integration test"

outputs:
version:
Expand Down Expand Up @@ -94,7 +109,7 @@ jobs:
docker-push:
name: Build Docker image and push to ghcr.io
if: (contains(inputs.build-target, 'Docker') || contains(inputs.build-target, 'docker')) && (inputs.strict-scanner && success() || !inputs.strict-scanner)
needs: [prebuild-job, owasp-scan, license-check ]
needs: [prebuild-job, owasp-scan, license-check, integration-test ]
uses: th2-net/.github/.github/workflows/compaund-java-docker-push.yml@main
with:
docker-username: ${{ inputs.docker-username }}
Expand All @@ -118,7 +133,7 @@ jobs:
sonatype-push:
if: (contains(inputs.build-target, 'Sonatype') || contains(inputs.build-target, 'sonatype')) && (inputs.strict-scanner && success() || !inputs.strict-scanner)
name: Build and Push Jar to Sonatype
needs: [ prebuild-job, owasp-scan, license-check ]
needs: [ prebuild-job, owasp-scan, license-check, integration-test ]
uses: th2-net/.github/.github/workflows/compaund-java-sonatype-push.yml@main
with:
runsOn: ${{ inputs.runsOn }}
Expand Down Expand Up @@ -157,3 +172,16 @@ jobs:
needs: [prebuild-job]
with:
version: ${{ needs.prebuild-job.outputs.version }}

integration-test:
if: inputs.integration-test-enabled
strategy:
matrix:
integration-test-project: ${{ fromJson(inputs.integration-test-projects) }}
uses: th2-net/.github/.github/workflows/java-integration-test.yml@integration-tests # FIXME: switch to main branch
with:
runsOn: ${{ inputs.runsOn }}
javaVersion: ${{ inputs.javaVersion }}
javaVendor: ${{ inputs.javaVendor }}
projectPath: ${{ matrix.integration-test-project }}
integrationTestTask: ${{ inputs.integration-test-task }}
5 changes: 5 additions & 0 deletions .github/workflows/java-integration-test.properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Java integration test",
"description": "Run Java integration test and publish results if tests failure",
"iconName": "example-icon"
}
53 changes: 53 additions & 0 deletions .github/workflows/java-integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Java integration test

on:
workflow_call:
inputs:
runsOn:
required: false
type: string
default: 'ubuntu-latest'
javaVersion:
required: false
type: string
default: '11'
javaVendor:
required: false
type: string
default: 'zulu'
integrationTestTask:
required: false
type: string
default: 'integrationTest'
description: "Gradle task name to run integration test"
projectPath:
required: false
type: string
default: '.'
description: "path to the Gradle module. Root directory by default"

jobs:
integration-test:
name: "Integration test, project: ${{ inputs.projectPath }} task: ${{ inputs.integrationTestTask }}"
runs-on: ${{ inputs.runsOn }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK ${{ inputs.javaVendor }} ${{ inputs.javaVersion }}
uses: actions/setup-java@v4
with:
distribution: ${{ inputs.javaVendor }}
java-version: ${{ inputs.javaVersion }}
- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v4
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: wrapper
- name: "Run integration test, project: ${{ inputs.projectPath }} task: ${{ inputs.integrationTestTask }}"
run: ./gradlew -p ${{ inputs.projectPath }} --info clean ${{ inputs.integrationTestTask }}
- uses: actions/upload-artifact@v4
if: failure()
with:
name: integration-test-results
path: ${{ inputs.projectPath }}/build/reports/tests/${{ inputs.integrationTestTask }}/