diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ccae127..e03648a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -50,39 +50,6 @@ assemble with java 11: - build/ interruptible: true -assemble with java 12: - stage: build - image: registry.gitlab.com/josm/docker-library/openjdk-12-josmplugin:latest - script: - - ./gradlew assemble - artifacts: - paths: - - build/ - allow_failure: true - interruptible: true - -assemble with java 13: - stage: build - image: registry.gitlab.com/josm/docker-library/openjdk-13-josmplugin:latest - script: - - ./gradlew assemble - artifacts: - paths: - - build/ - allow_failure: true - interruptible: true - -assemble with java 14: - stage: build - image: registry.gitlab.com/josm/docker-library/openjdk-14-josmplugin:latest - script: - - ./gradlew assemble - artifacts: - paths: - - build/ - allow_failure: true - interruptible: true - assemble with java 15: stage: build image: registry.gitlab.com/josm/docker-library/openjdk-15-josmplugin:latest @@ -128,6 +95,8 @@ build: paths: - build needs: ["assemble"] + dependencies: + - assemble interruptible: true test: @@ -142,11 +111,15 @@ test: reports: junit: build/test-results/**/TEST-*.xml needs: ["assemble"] + dependencies: + - assemble interruptible: true coverage: stage: deploy needs: ["test"] + dependencies: + - test image: haynes/jacoco2cobertura:1.0.3 script: - 'python /opt/cover2cover.py build/reports/jacoco/test/jacocoTestReport.xml src/main/java > build/reports/jacoco/test/coverage.xml' @@ -160,6 +133,8 @@ compile against min JOSM: script: - ./gradlew compileJava_minJosm needs: ["assemble"] + dependencies: + - assemble interruptible: true compile against latest JOSM: @@ -167,6 +142,8 @@ compile against latest JOSM: script: - ./gradlew compileJava_latestJosm needs: ["assemble"] + dependencies: + - assemble interruptible: true build with java 11: @@ -176,33 +153,8 @@ build with java 11: - ./gradlew build allow_failure: true # due to copy-paste-detection needs: ["assemble with java 11"] - interruptible: true - -build with java 12: - stage: test - image: registry.gitlab.com/josm/docker-library/openjdk-12-josmplugin:latest - script: - - ./gradlew build - allow_failure: true - needs: ["assemble with java 12"] - interruptible: true - -build with java 13: - stage: test - image: registry.gitlab.com/josm/docker-library/openjdk-13-josmplugin:latest - script: - - ./gradlew build - allow_failure: true - needs: ["assemble with java 13"] - interruptible: true - -build with java 14: - stage: test - image: registry.gitlab.com/josm/docker-library/openjdk-14-josmplugin:latest - script: - - ./gradlew build - allow_failure: true - needs: ["assemble with java 14"] + dependencies: + - assemble with java 11 interruptible: true build with java 15: @@ -212,6 +164,8 @@ build with java 15: - ./gradlew build allow_failure: true needs: ["assemble with java 15"] + dependencies: + - assemble with java 15 interruptible: true ################ @@ -244,6 +198,8 @@ sonarcloud.io: - git fetch --unshallow - ./gradlew -Dsonar.login=$SONAR_TOKEN sonarqube needs: ["test"] + dependencies: + - test only: variables: - $SONAR_TOKEN =~ /[0-9a-z]+/ @@ -275,6 +231,8 @@ release: git commit -a -m "$commitMessage" git push origin pages needs: ["compile against min JOSM", "compile against latest JOSM", "build"] + dependencies: + - build rules: - if: '$SSH_PRIVATE_DEPLOY_KEY != null && $CI_COMMIT_REF_PROTECTED == "true" && $CI_COMMIT_TAG != null && $CI_PIPELINE_SOURCE != "schedule"' when: manual @@ -292,6 +250,8 @@ release hotfix: cp -v "build/dist/"* "build/tmp/jar/MANIFEST.MF" "pages/public/dist/$version" - *push_pages_branch needs: ["compile against min JOSM", "compile against latest JOSM", "build"] + dependencies: + - build rules: - if: '$SSH_PRIVATE_DEPLOY_KEY != null && $CI_COMMIT_REF_PROTECTED == "true" && $CI_COMMIT_TAG != null && $CI_PIPELINE_SOURCE != "schedule" && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH' when: always @@ -314,6 +274,8 @@ publish update site: cp -v "build/dist/mapwithai.jar" "pages/public/snapshot/${CI_COMMIT_REF_NAME}/mapwithai-dev.jar" - *push_pages_branch needs: ["compile against min JOSM", "compile against latest JOSM", "build"] + dependencies: + - build rules: - if: '$SSH_PRIVATE_DEPLOY_KEY != null && $CI_PIPELINE_SOURCE != "schedule" && $CI_COMMIT_REF_NAME != null' when: always @@ -327,6 +289,8 @@ publish to / GitLab.com packages: - ./gradlew publishAllPublicationsToGitlabRepository - ./gradlew releaseToGitlab needs: ["compile against min JOSM", "compile against latest JOSM", "build"] + dependencies: + - build rules: - if: '$SSH_PRIVATE_DEPLOY_KEY != null && $CI_COMMIT_REF_PROTECTED == "true" && $CI_COMMIT_TAG != null && $CI_PIPELINE_SOURCE != "schedule"' when: always