diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d6a7a42b..68f33441 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,10 +14,36 @@ jobs: steps: - name: Checkout Code uses: actions/checkout@v3 + - name: Read Plugin Version + uses: madhead/read-java-properties@latest + id: version + with: + file: gradle.properties + property: version + default: latest + - name: Set Artifact Name + id: artifactName + run: | + if [[ "${{ github.event_name }}" == "push" ]]; then + echo "artifact_name=${{ github.ref_name }}" >>$GITHUB_OUTPUT + else + echo "artifact_name=PR-${{ github.event.pull_request.number }}" >>$GITHUB_OUTPUT + fi - name: Set up JDK 8 uses: actions/setup-java@v3 with: distribution: temurin java-version: 8 - name: Run Gradle Build - run: ./gradlew build -x containerTest + id: build + run: ./gradlew clean build -x containerTest + - name: Add Artifacts To Local Repository + id: artifactCopy + run: ./gradlew publishMavenPublicationToArtifactsRepository + - name: Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ steps.artifactName.outputs.artifact_name }} + path: | + build/artifacts/de/tracetronic/jenkins/plugins/ecutestexecution/${{ steps.version.outputs.value }} + if-no-files-found: error diff --git a/.github/workflows/reuse.yml b/.github/workflows/reuse.yml index 3488c10f..4b2a5b7d 100644 --- a/.github/workflows/reuse.yml +++ b/.github/workflows/reuse.yml @@ -3,7 +3,7 @@ name: REUSE Compliance Check on: [push, pull_request] jobs: - test: + reuse-compliance-check: runs-on: ubuntu-latest steps: - name: Checkout Code diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index ee1334d3..3f2c73f5 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -8,7 +8,7 @@ on: - .github/labels.yml jobs: - build: + sync-repo-labels: name: Sync Labels runs-on: ubuntu-latest steps: diff --git a/Jenkinsfile.internal b/Jenkinsfile.internal index 4eb03541..eca42174 100644 --- a/Jenkinsfile.internal +++ b/Jenkinsfile.internal @@ -19,25 +19,36 @@ pipeline { } agent { - node { - label 'ecutest && windows && docker' - } + label 'windows && docker' } stages { - stage ('Prepare Resources') { - steps { - copyArtifacts fingerprintArtifacts: true, projectName: '../prepareContainerTestData', selector: lastSuccessful() - } - } - stage ('ContainerTest') { - steps { - withGradle { - bat './gradlew clean containerTest' + stage('Run Parallel') { + failFast false + parallel { + stage('System Tests') { + steps { + build job: '../systemTests', parameters: [string(name: 'artifactName', value: "${JOB_BASE_NAME}"), string(name: 'commitHash', value: "${GIT_COMMIT}")] + } + } + stage('Container Tests') { + stages { + stage('Prepare Resources') { + steps { + copyArtifacts fingerprintArtifacts: true, projectName: '../prepareContainerTestData', selector: lastSuccessful() + } + } + stage('Run Container Tests') { + steps { + bat './gradlew clean containerTest' + } + } + } } } } } + post { unsuccessful { mail to: "${env.EMAIL_RECIPIENTS}", @@ -45,6 +56,4 @@ pipeline { body: "Check console output at ${BUILD_URL} to view the results." } } - - } diff --git a/build.gradle b/build.gradle index 6744734c..408b7a49 100644 --- a/build.gradle +++ b/build.gradle @@ -29,7 +29,7 @@ description = 'This plugin enables a platform-independent test execution. Due to jenkinsPlugin { jenkinsVersion = "${project.properties['jenkinsVersion']}" shortName = 'ecu-test-execution' - group = 'io.jenkins.plugins' + group = "${group}" displayName = 'TraceTronic ECU-TEST-Execution Plugin' url = 'https://plugins.jenkins.io/ecu-test-execution/' @@ -94,6 +94,10 @@ configurations.testRuntimeOnly { publishing { publications { maven(MavenPublication) { + artifactId = "ecutestexecution" + groupId = "${group}" + version = "${version}" + from components.java pom { @@ -162,6 +166,10 @@ publishing { password = project.findProperty('jenkinsPwd') } } + maven { + name = "Artifacts" + url = uri("file://${buildDir}/artifacts") + } } } @@ -208,7 +216,6 @@ task containerTest(type: Test) { includeTestsMatching('*ContainerTest') } useJUnitPlatform() - dependsOn test } jacocoTestReport { diff --git a/gradle.properties b/gradle.properties index 698e6908..6bde42cb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # ---versions--- # -version=3.0.0-SNAPSHOT +version=3.0-SNAPSHOT jpiVersion=0.43.0 jenkinsVersion=2.332.3 gradleVersion=7.3 @@ -11,4 +11,4 @@ depCheckVersion=7.4.1 failBuildOnCVSS=9.0 # --- Disabling SHA256 and SHA512 checksums when releasing a plugin ---# # --- see https://github.com/jenkinsci/gradle-jpi-plugin/blob/master/README.md#disabling-sha256-and-sha512-checksums-when-releasing-a-plugin ---# -org.gradle.internal.publish.checksums.insecure=true +systemProp.org.gradle.internal.publish.checksums.insecure=true