<commit_before>stages:
- test
- publish

.check: &check
  stage: test
  image: java:8-jdk-alpine
  script: |
    apk --update add libstdc++
    ./gradlew --no-daemon check
  artifacts:
    name: '${CI_PROJECT_NAME}_${CI_BUILD_ID}'
    paths:
    - build/tmp
    expire_in: 7 days
    when: on_failure
  except:
  - tags

check v3.0:
  <<: *check
  variables:
    GRADLE_VERSION_UNDER_TEST: '3.0'
    PERSISTENT_TEST_GRADLE_PROJECT_DIR: 'build/tmp'

check v3.1:
  <<: *check
  variables:
    GRADLE_VERSION_UNDER_TEST: '3.1'
    PERSISTENT_TEST_GRADLE_PROJECT_DIR: 'build/tmp'

check v3.2.1:
  <<: *check
  variables:
    GRADLE_VERSION_UNDER_TEST: '3.2.1'
    PERSISTENT_TEST_GRADLE_PROJECT_DIR: 'build/tmp'

check v3.3:
  <<: *check
  variables:
    GRADLE_VERSION_UNDER_TEST: '3.3'
    PERSISTENT_TEST_GRADLE_PROJECT_DIR: 'build/tmp'

check v3.4.1:
  <<: *check
  variables:
    GRADLE_VERSION_UNDER_TEST: '3.4.1'
    PERSISTENT_TEST_GRADLE_PROJECT_DIR: 'build/tmp'

check v3.5:
  <<: *check
  variables:
    GRADLE_VERSION_UNDER_TEST: '3.5'
    PERSISTENT_TEST_GRADLE_PROJECT_DIR: 'build/tmp'

check v4.0:
  <<: *check
  variables:
    GRADLE_VERSION_UNDER_TEST: '4.0'
    PERSISTENT_TEST_GRADLE_PROJECT_DIR: 'build/tmp'
 
check v4.1:
  <<: *check
  variables:
    GRADLE_VERSION_UNDER_TEST: '4.1'
    PERSISTENT_TEST_GRADLE_PROJECT_DIR: 'build/tmp'

check v4.2:
  <<: *check
  variables:
    GRADLE_VERSION_UNDER_TEST: '4.2'
    PERSISTENT_TEST_GRADLE_PROJECT_DIR: 'build/tmp'

publish plugin:
  stage: publish
  image: java:8-jdk-alpine
  script: |
    apk --update add libstdc++
    ./gradlew --no-daemon -PreleaseVersion=${CI_COMMIT_TAG} -Dgradle.publish.key=${GRADLE_PUBLISH_KEY} -Dgradle.publish.secret=${GRADLE_PUBLISH_SECRET} publishPlugins
  only:
  - tags<commit_msg>Check against latest Gradle version periodically<commit_after>stages:
- test
- publish

.check: &check
  stage: test
  image: java:8-jdk-alpine
  script: |
    apk --update add libstdc++
    ./gradlew --no-daemon check
  artifacts:
    name: '${CI_PROJECT_NAME}_${CI_BUILD_ID}'
    paths:
    - build/tmp
    expire_in: 7 days
    when: on_failure
  except:
  - tags
  - schedules

check v3.0:
  <<: *check
  variables:
    GRADLE_VERSION_UNDER_TEST: '3.0'
    PERSISTENT_TEST_GRADLE_PROJECT_DIR: 'build/tmp'

check v3.1:
  <<: *check
  variables:
    GRADLE_VERSION_UNDER_TEST: '3.1'
    PERSISTENT_TEST_GRADLE_PROJECT_DIR: 'build/tmp'

check v3.2.1:
  <<: *check
  variables:
    GRADLE_VERSION_UNDER_TEST: '3.2.1'
    PERSISTENT_TEST_GRADLE_PROJECT_DIR: 'build/tmp'

check v3.3:
  <<: *check
  variables:
    GRADLE_VERSION_UNDER_TEST: '3.3'
    PERSISTENT_TEST_GRADLE_PROJECT_DIR: 'build/tmp'

check v3.4.1:
  <<: *check
  variables:
    GRADLE_VERSION_UNDER_TEST: '3.4.1'
    PERSISTENT_TEST_GRADLE_PROJECT_DIR: 'build/tmp'

check v3.5:
  <<: *check
  variables:
    GRADLE_VERSION_UNDER_TEST: '3.5'
    PERSISTENT_TEST_GRADLE_PROJECT_DIR: 'build/tmp'

check v4.0:
  <<: *check
  variables:
    GRADLE_VERSION_UNDER_TEST: '4.0'
    PERSISTENT_TEST_GRADLE_PROJECT_DIR: 'build/tmp'
 
check v4.1:
  <<: *check
  variables:
    GRADLE_VERSION_UNDER_TEST: '4.1'
    PERSISTENT_TEST_GRADLE_PROJECT_DIR: 'build/tmp'

check v4.2:
  <<: *check
  variables:
    GRADLE_VERSION_UNDER_TEST: '4.2'
    PERSISTENT_TEST_GRADLE_PROJECT_DIR: 'build/tmp'

check latest:
  stage: test
  image: java:8-jdk-alpine
  variables:
    PERSISTENT_TEST_GRADLE_PROJECT_DIR: 'build/tmp'
  script: |
    apk --update add libstdc++ curl jq
    GRADLE_VERSION_UNDER_TEST=`curl --silent --show-error https://services.gradle.org/versions/nightly | jq --raw-output '.version'`
    echo Testing against Gradle version $GRADLE_VERSION_UNDER_TEST
    ./gradlew --no-daemon check
  artifacts:
    name: '${CI_PROJECT_NAME}_${CI_BUILD_ID}'
    paths:
    - build/tmp
    expire_in: 7 days
    when: on_failure
  only:
  - schedules
  allow_failure: true

publish plugin:
  stage: publish
  image: java:8-jdk-alpine
  script: |
    apk --update add libstdc++
    ./gradlew --no-daemon -PreleaseVersion=${CI_COMMIT_TAG} -Dgradle.publish.key=${GRADLE_PUBLISH_KEY} -Dgradle.publish.secret=${GRADLE_PUBLISH_SECRET} publishPlugins
  only:
  - tags
{'fraction_non_alphanumeric': 0.11992355470616341, 'fraction_numerical': 0.0210224558050645, 'mean_word_length': 3.662583518930958, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2430182', 'n_tokens_mistral': 1804, 'n_tokens_neox': 1764, 'n_words': 291}