From 9b7c81f8f60bc68ea72ead5d7ff6f421faa770ec Mon Sep 17 00:00:00 2001 From: Daz DeBoer Date: Wed, 29 Sep 2021 13:31:38 -0600 Subject: [PATCH] Test execution with older Gradle versions --- .github/workflows/integTest-execution.yml | 43 ++++++++++++++++++- .../samples/no-wrapper-gradle-4/build.gradle | 10 +++++ .../no-wrapper-gradle-4/settings.gradle | 8 ++++ .../samples/no-wrapper-gradle-5/build.gradle | 12 ++++++ .../no-wrapper-gradle-5/settings.gradle | 8 ++++ 5 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 __tests__/samples/no-wrapper-gradle-4/build.gradle create mode 100644 __tests__/samples/no-wrapper-gradle-4/settings.gradle create mode 100644 __tests__/samples/no-wrapper-gradle-5/build.gradle create mode 100644 __tests__/samples/no-wrapper-gradle-5/settings.gradle diff --git a/.github/workflows/integTest-execution.yml b/.github/workflows/integTest-execution.yml index 40e9e6f..1770732 100644 --- a/.github/workflows/integTest-execution.yml +++ b/.github/workflows/integTest-execution.yml @@ -39,4 +39,45 @@ jobs: with: gradle-executable: __tests__/samples/groovy-dsl/gradlew${{ matrix.script-suffix }} build-root-directory: __tests__/samples/no-wrapper - arguments: help -DgradleVersionCheck=7.1.1 \ No newline at end of file + arguments: help -DgradleVersionCheck=7.1.1 + + gradle-versions: + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + include: + - os: windows-latest + script-suffix: '.bat' + runs-on: ${{ matrix.os }} + steps: + - name: Checkout sources + uses: actions/checkout@v2 + - name: Test Gradle 7 + uses: ./ + id: gradle7 + with: + gradle-version: 7.2 + build-root-directory: __tests__/samples/no-wrapper + arguments: help -DgradleVersionCheck=7.2 + - name: Test Gradle 6 + uses: ./ + id: gradle6 + with: + gradle-version: 6.9 + build-root-directory: __tests__/samples/no-wrapper + arguments: help -DgradleVersionCheck=6.9 + - name: Test Gradle 5 + uses: ./ + id: gradle5 + with: + gradle-version: 5.6.4 + build-root-directory: __tests__/samples/no-wrapper-gradle-5 + arguments: help -DgradleVersionCheck=5.6.4 + - name: Test Gradle 4 + uses: ./ + id: gradle4 + with: + gradle-version: 4.10.3 + build-root-directory: __tests__/samples/no-wrapper-gradle-4 + arguments: help -DgradleVersionCheck=4.10.3 + \ No newline at end of file diff --git a/__tests__/samples/no-wrapper-gradle-4/build.gradle b/__tests__/samples/no-wrapper-gradle-4/build.gradle new file mode 100644 index 0000000..130ca1d --- /dev/null +++ b/__tests__/samples/no-wrapper-gradle-4/build.gradle @@ -0,0 +1,10 @@ +plugins { + id "com.gradle.build-scan" version "1.16" +} + +buildScan { + termsOfServiceUrl = "https://gradle.com/terms-of-service" + termsOfServiceAgree = "yes" + publishAlways() +} + diff --git a/__tests__/samples/no-wrapper-gradle-4/settings.gradle b/__tests__/samples/no-wrapper-gradle-4/settings.gradle new file mode 100644 index 0000000..c197f1a --- /dev/null +++ b/__tests__/samples/no-wrapper-gradle-4/settings.gradle @@ -0,0 +1,8 @@ +rootProject.name = 'no-wrapper' + +println "Using Gradle version: ${gradle.gradleVersion}" + +def gradleVersionCheck = System.properties.gradleVersionCheck +if (gradleVersionCheck && gradle.gradleVersion != gradleVersionCheck) { + throw new RuntimeException("Got the wrong version: expected ${gradleVersionCheck} but was ${gradle.gradleVersion}") +} \ No newline at end of file diff --git a/__tests__/samples/no-wrapper-gradle-5/build.gradle b/__tests__/samples/no-wrapper-gradle-5/build.gradle new file mode 100644 index 0000000..db3873f --- /dev/null +++ b/__tests__/samples/no-wrapper-gradle-5/build.gradle @@ -0,0 +1,12 @@ +plugins { + id("com.gradle.build-scan") version("3.7") +} + +gradleEnterprise { + buildScan { + termsOfServiceUrl = "https://gradle.com/terms-of-service" + termsOfServiceAgree = "yes" + publishAlways() + uploadInBackground = false + } +} diff --git a/__tests__/samples/no-wrapper-gradle-5/settings.gradle b/__tests__/samples/no-wrapper-gradle-5/settings.gradle new file mode 100644 index 0000000..c197f1a --- /dev/null +++ b/__tests__/samples/no-wrapper-gradle-5/settings.gradle @@ -0,0 +1,8 @@ +rootProject.name = 'no-wrapper' + +println "Using Gradle version: ${gradle.gradleVersion}" + +def gradleVersionCheck = System.properties.gradleVersionCheck +if (gradleVersionCheck && gradle.gradleVersion != gradleVersionCheck) { + throw new RuntimeException("Got the wrong version: expected ${gradleVersionCheck} but was ${gradle.gradleVersion}") +} \ No newline at end of file