mirror of
https://github.com/gradle/gradle-build-action.git
synced 2025-10-19 22:38:58 +08:00
Compare commits
58 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
9b814496b5 | ||
|
f2bb19b43a | ||
|
e3ceb00204 | ||
|
116ac10f81 | ||
|
9f1e4d5588 | ||
|
f1c309a163 | ||
|
202e4e0271 | ||
|
c3afc518f5 | ||
|
1072fff97e | ||
|
04df35b994 | ||
|
0fa1a8d680 | ||
|
78039b1f7f | ||
|
b147a594b1 | ||
|
5298cab81e | ||
|
f0a35701c4 | ||
|
477313b699 | ||
|
90fd69fffb | ||
|
7bf980c8dd | ||
|
27c4618d3e | ||
|
9f79f97603 | ||
|
fdce5083a7 | ||
|
f62c9ea5ea | ||
|
52fbfb7d9e | ||
|
9230b19200 | ||
|
503956ef9b | ||
|
3ad927eab1 | ||
|
1b2936fed4 | ||
|
f313ba7cbe | ||
|
191094ccb5 | ||
|
a748ca2efa | ||
|
501cd3b4dc | ||
|
9b724c303e | ||
|
3c3fdfcc0c | ||
|
3317bc450c | ||
|
0e24fa1975 | ||
|
bd717aced6 | ||
|
3b14e1426f | ||
|
cde360986c | ||
|
ff8a687227 | ||
|
f78055c629 | ||
|
72e45fe25b | ||
|
cfe0b72a03 | ||
|
a6bb0f87a3 | ||
|
a1bb3349df | ||
|
aabb2db775 | ||
|
01def677bf | ||
|
73602de30a | ||
|
aeb23a4bdd | ||
|
0a03a96401 | ||
|
3793ab6467 | ||
|
295371713e | ||
|
c616a64390 | ||
|
f9f94e6203 | ||
|
512233d0e6 | ||
|
685c78279d | ||
|
41740501eb | ||
|
6e17ebd67e | ||
|
f2b17e4179 |
29
.github/dependabot.yml
vendored
29
.github/dependabot.yml
vendored
@@ -10,16 +10,41 @@ updates:
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
open-pull-requests-limit: 10
|
||||
ignore:
|
||||
- dependency-name: "@types/node"
|
||||
- package-ecosystem: "gradle"
|
||||
directory: "__tests__/samples/kotlin-dsl"
|
||||
directory: ".github/workflow-samples/gradle-plugin"
|
||||
registries:
|
||||
- gradle-plugin-portal
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "gradle"
|
||||
directory: "__tests__/samples/no-wrapper"
|
||||
directory: ".github/workflow-samples/groovy-dsl"
|
||||
registries:
|
||||
- gradle-plugin-portal
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "gradle"
|
||||
directory: ".github/workflow-samples/java-toolchain"
|
||||
registries:
|
||||
- gradle-plugin-portal
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "gradle"
|
||||
directory: ".github/workflow-samples/kotlin-dsl"
|
||||
registries:
|
||||
- gradle-plugin-portal
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "gradle"
|
||||
directory: ".github/workflow-samples/no-wrapper"
|
||||
registries:
|
||||
- gradle-plugin-portal
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "gradle"
|
||||
directory: ".github/workflow-samples/no-wrapper-gradle-5"
|
||||
registries:
|
||||
- gradle-plugin-portal
|
||||
schedule:
|
||||
|
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionSha256Sum=e5444a57cda4a95f90b0c9446a9e1b47d3d7f69057765bfb54bd4f482542d548
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip
|
||||
distributionSha256Sum=29e49b10984e585d8118b7d0bc452f944e386458df27371b49b4ac1dec4b7fda
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
@@ -7,7 +7,7 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testImplementation('junit:junit:4.12')
|
||||
testImplementation('junit:junit:4.13.2')
|
||||
}
|
||||
|
||||
tasks.named("test").configure {
|
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionSha256Sum=e5444a57cda4a95f90b0c9446a9e1b47d3d7f69057765bfb54bd4f482542d548
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip
|
||||
distributionSha256Sum=29e49b10984e585d8118b7d0bc452f944e386458df27371b49b4ac1dec4b7fda
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
@@ -13,5 +13,5 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testImplementation('junit:junit:4.12')
|
||||
testImplementation('junit:junit:4.13.2')
|
||||
}
|
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionSha256Sum=e5444a57cda4a95f90b0c9446a9e1b47d3d7f69057765bfb54bd4f482542d548
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip
|
||||
distributionSha256Sum=29e49b10984e585d8118b7d0bc452f944e386458df27371b49b4ac1dec4b7fda
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionSha256Sum=e5444a57cda4a95f90b0c9446a9e1b47d3d7f69057765bfb54bd4f482542d548
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip
|
||||
distributionSha256Sum=29e49b10984e585d8118b7d0bc452f944e386458df27371b49b4ac1dec4b7fda
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id("com.gradle.enterprise") version "3.9"
|
||||
id("com.gradle.enterprise") version "3.10"
|
||||
}
|
||||
|
||||
gradleEnterprise {
|
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id("com.gradle.build-scan") version("3.7")
|
||||
id "com.gradle.build-scan" version "3.10"
|
||||
}
|
||||
|
||||
gradleEnterprise {
|
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id "com.gradle.enterprise" version "3.9"
|
||||
id "com.gradle.enterprise" version "3.10"
|
||||
}
|
||||
|
||||
gradleEnterprise {
|
4
.github/workflows/failure-cases.yml
vendored
4
.github/workflows/failure-cases.yml
vendored
@@ -17,7 +17,7 @@ jobs:
|
||||
uses: ./
|
||||
continue-on-error: true
|
||||
with:
|
||||
build-root-directory: __tests__/samples/no-wrapper
|
||||
build-root-directory: .github/workflow-samples/no-wrapper
|
||||
arguments: help
|
||||
|
||||
bad-configuration:
|
||||
@@ -29,6 +29,6 @@ jobs:
|
||||
uses: ./
|
||||
continue-on-error: true
|
||||
with:
|
||||
build-root-directory: __tests__/samples/no-wrapper
|
||||
build-root-directory: .github/workflow-samples/no-wrapper
|
||||
arguments: help
|
||||
cache-disabled: yes
|
||||
|
@@ -4,6 +4,9 @@ on:
|
||||
pull_request:
|
||||
types: [assigned, review_requested]
|
||||
push:
|
||||
paths:
|
||||
- '.github/**'
|
||||
- 'dist/**'
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
@@ -24,7 +27,7 @@ jobs:
|
||||
- name: Invoke with multi-line arguments
|
||||
uses: ./
|
||||
with:
|
||||
build-root-directory: __tests__/samples/groovy-dsl
|
||||
build-root-directory: .github/workflow-samples/groovy-dsl
|
||||
arguments: |
|
||||
--configuration-cache
|
||||
--build-cache
|
||||
|
15
.github/workflows/integTest-caching-config.yml
vendored
15
.github/workflows/integTest-caching-config.yml
vendored
@@ -4,6 +4,9 @@ on:
|
||||
pull_request:
|
||||
types: [assigned, review_requested]
|
||||
push:
|
||||
paths:
|
||||
- '.github/**'
|
||||
- 'dist/**'
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
@@ -33,7 +36,7 @@ jobs:
|
||||
gradle-home-cache-excludes: |
|
||||
caches/build-cache-1
|
||||
- name: Build using Gradle wrapper
|
||||
working-directory: __tests__/samples/groovy-dsl
|
||||
working-directory: .github/workflow-samples/groovy-dsl
|
||||
run: ./gradlew test
|
||||
|
||||
# Test that the gradle-user-home cache will cache dependencies, by running build with --offline
|
||||
@@ -57,7 +60,7 @@ jobs:
|
||||
caches/build-cache-1
|
||||
cache-read-only: true
|
||||
- name: Execute Gradle build with --offline
|
||||
working-directory: __tests__/samples/groovy-dsl
|
||||
working-directory: .github/workflow-samples/groovy-dsl
|
||||
run: ./gradlew test --offline
|
||||
|
||||
# Test that build scans are captured when caching is explicitly disabled
|
||||
@@ -75,7 +78,7 @@ jobs:
|
||||
cache-disabled: true
|
||||
- name: Run Gradle build
|
||||
id: gradle
|
||||
working-directory: __tests__/samples/no-wrapper${{ matrix.build-root-suffix }}
|
||||
working-directory: .github/workflow-samples/no-wrapper${{ matrix.build-root-suffix }}
|
||||
run: gradle help "-DgradleVersionCheck=${{matrix.gradle}}"
|
||||
- name: Check build scan url is captured
|
||||
if: ${{ !steps.gradle.outputs.build-scan-url }}
|
||||
@@ -96,7 +99,7 @@ jobs:
|
||||
uses: ./
|
||||
- name: Run Gradle build
|
||||
id: gradle
|
||||
working-directory: __tests__/samples/no-wrapper${{ matrix.build-root-suffix }}
|
||||
working-directory: .github/workflow-samples/no-wrapper${{ matrix.build-root-suffix }}
|
||||
run: gradle help "-DgradleVersionCheck=${{matrix.gradle}}"
|
||||
- name: Check build scan url is captured
|
||||
if: ${{ !steps.gradle.outputs.build-scan-url }}
|
||||
@@ -121,7 +124,7 @@ jobs:
|
||||
with:
|
||||
cache-write-only: true
|
||||
- name: Build using Gradle wrapper
|
||||
working-directory: __tests__/samples/groovy-dsl
|
||||
working-directory: .github/workflow-samples/groovy-dsl
|
||||
run: ./gradlew test
|
||||
|
||||
verify-write-only-build:
|
||||
@@ -140,6 +143,6 @@ jobs:
|
||||
with:
|
||||
cache-read-only: true
|
||||
- name: Execute Gradle build with --offline
|
||||
working-directory: __tests__/samples/groovy-dsl
|
||||
working-directory: .github/workflow-samples/groovy-dsl
|
||||
run: ./gradlew test --offline
|
||||
|
||||
|
@@ -4,6 +4,9 @@ on:
|
||||
pull_request:
|
||||
types: [assigned, review_requested]
|
||||
push:
|
||||
paths:
|
||||
- '.github/**'
|
||||
- 'dist/**'
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
@@ -28,7 +31,7 @@ jobs:
|
||||
- name: Setup Gradle
|
||||
uses: ./
|
||||
- name: Groovy build with configuration-cache enabled
|
||||
working-directory: __tests__/samples/groovy-dsl
|
||||
working-directory: .github/workflow-samples/groovy-dsl
|
||||
run: ./gradlew test --configuration-cache
|
||||
|
||||
configuration-cache-groovy:
|
||||
@@ -48,7 +51,7 @@ jobs:
|
||||
cache-read-only: true
|
||||
- name: Groovy build with configuration-cache enabled
|
||||
id: execute
|
||||
working-directory: __tests__/samples/groovy-dsl
|
||||
working-directory: .github/workflow-samples/groovy-dsl
|
||||
run: ./gradlew test --configuration-cache
|
||||
- name: Check that configuration-cache was used
|
||||
if: ${{ steps.execute.outputs.task_configured == 'yes' }}
|
||||
@@ -76,7 +79,7 @@ jobs:
|
||||
with:
|
||||
cache-read-only: true
|
||||
- name: Check execute Gradle build with configuration cache enabled (but not restored)
|
||||
working-directory: __tests__/samples/groovy-dsl
|
||||
working-directory: .github/workflow-samples/groovy-dsl
|
||||
run: ./gradlew test --configuration-cache
|
||||
|
||||
seed-build-kotlin:
|
||||
@@ -92,7 +95,7 @@ jobs:
|
||||
- name: Setup Gradle
|
||||
uses: ./
|
||||
- name: Execute 'help' with configuration-cache enabled
|
||||
working-directory: __tests__/samples/kotlin-dsl
|
||||
working-directory: .github/workflow-samples/kotlin-dsl
|
||||
run: ./gradlew help --configuration-cache
|
||||
|
||||
modify-build-kotlin:
|
||||
@@ -109,7 +112,7 @@ jobs:
|
||||
- name: Setup Gradle
|
||||
uses: ./
|
||||
- name: Execute 'test' with configuration-cache enabled
|
||||
working-directory: __tests__/samples/kotlin-dsl
|
||||
working-directory: .github/workflow-samples/kotlin-dsl
|
||||
run: ./gradlew test --configuration-cache
|
||||
|
||||
# Test restore configuration-cache from the third build invocation
|
||||
@@ -130,7 +133,7 @@ jobs:
|
||||
cache-read-only: true
|
||||
- name: Execute 'test' again with configuration-cache enabled
|
||||
id: execute
|
||||
working-directory: __tests__/samples/kotlin-dsl
|
||||
working-directory: .github/workflow-samples/kotlin-dsl
|
||||
run: ./gradlew test --configuration-cache
|
||||
- name: Check that configuration-cache was used
|
||||
if: ${{ steps.execute.outputs.task_configured == 'yes' }}
|
||||
|
@@ -4,6 +4,9 @@ on:
|
||||
pull_request:
|
||||
types: [assigned, review_requested]
|
||||
push:
|
||||
paths:
|
||||
- '.github/**'
|
||||
- 'dist/**'
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
@@ -24,7 +27,7 @@ jobs:
|
||||
- name: Setup Gradle
|
||||
uses: ./
|
||||
- name: Build using Gradle wrapper
|
||||
working-directory: __tests__/samples/groovy-dsl
|
||||
working-directory: .github/workflow-samples/groovy-dsl
|
||||
run: ./gradlew test
|
||||
|
||||
# Test that the gradle-user-home cache will cache dependencies, by running build with --offline
|
||||
@@ -42,7 +45,7 @@ jobs:
|
||||
with:
|
||||
cache-read-only: true
|
||||
- name: Execute Gradle build with --offline
|
||||
working-directory: __tests__/samples/groovy-dsl
|
||||
working-directory: .github/workflow-samples/groovy-dsl
|
||||
run: ./gradlew test --offline
|
||||
|
||||
# Test that the gradle-user-home cache will cache and restore local build-cache
|
||||
@@ -60,7 +63,7 @@ jobs:
|
||||
with:
|
||||
cache-read-only: true
|
||||
- name: Execute Gradle build and verify tasks from cache
|
||||
working-directory: __tests__/samples/groovy-dsl
|
||||
working-directory: .github/workflow-samples/groovy-dsl
|
||||
run: ./gradlew test -DverifyCachedBuild=true
|
||||
|
||||
# Check that the build can run when Gradle User Home is not fully restored
|
||||
@@ -80,6 +83,6 @@ jobs:
|
||||
with:
|
||||
cache-read-only: true
|
||||
- name: Check executee Gradle build
|
||||
working-directory: __tests__/samples/groovy-dsl
|
||||
working-directory: .github/workflow-samples/groovy-dsl
|
||||
run: ./gradlew test
|
||||
|
||||
|
@@ -4,6 +4,9 @@ on:
|
||||
pull_request:
|
||||
types: [assigned, review_requested]
|
||||
push:
|
||||
paths:
|
||||
- '.github/**'
|
||||
- 'dist/**'
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
@@ -24,7 +27,7 @@ jobs:
|
||||
- name: Setup Gradle
|
||||
uses: ./
|
||||
- name: Build using Gradle wrapper
|
||||
working-directory: __tests__/samples/java-toolchain
|
||||
working-directory: .github/workflow-samples/java-toolchain
|
||||
run: ./gradlew test --info
|
||||
|
||||
# Test that the gradle-user-home cache will cache the toolchain, by running build with --offline
|
||||
@@ -42,5 +45,5 @@ jobs:
|
||||
with:
|
||||
cache-read-only: true
|
||||
- name: Execute Gradle build with --offline
|
||||
working-directory: __tests__/samples/java-toolchain
|
||||
working-directory: .github/workflow-samples/java-toolchain
|
||||
run: ./gradlew test --info --offline
|
||||
|
@@ -4,6 +4,9 @@ on:
|
||||
pull_request:
|
||||
types: [assigned, review_requested]
|
||||
push:
|
||||
paths:
|
||||
- '.github/**'
|
||||
- 'dist/**'
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
@@ -21,10 +24,10 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v2
|
||||
- name: Exucute Gradle build
|
||||
- name: Execute Gradle build
|
||||
uses: ./
|
||||
with:
|
||||
build-root-directory: __tests__/samples/groovy-dsl
|
||||
build-root-directory: .github/workflow-samples/groovy-dsl
|
||||
arguments: test
|
||||
|
||||
# Test that the gradle-user-home is restored
|
||||
@@ -41,6 +44,6 @@ jobs:
|
||||
uses: ./
|
||||
with:
|
||||
cache-read-only: true
|
||||
build-root-directory: __tests__/samples/groovy-dsl
|
||||
build-root-directory: .github/workflow-samples/groovy-dsl
|
||||
arguments: test --offline -DverifyCachedBuild=true
|
||||
|
||||
|
15
.github/workflows/integTest-execution.yml
vendored
15
.github/workflows/integTest-execution.yml
vendored
@@ -4,6 +4,9 @@ on:
|
||||
pull_request:
|
||||
types: [assigned, review_requested]
|
||||
push:
|
||||
paths:
|
||||
- '.github/**'
|
||||
- 'dist/**'
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
@@ -30,20 +33,20 @@ jobs:
|
||||
uses: ./
|
||||
with:
|
||||
gradle-version: 6.9
|
||||
build-root-directory: __tests__/samples/no-wrapper
|
||||
build-root-directory: .github/workflow-samples/no-wrapper
|
||||
arguments: help -DgradleVersionCheck=6.9
|
||||
- name: Test use Gradle version alias
|
||||
uses: ./
|
||||
with:
|
||||
gradle-version: release-candidate
|
||||
build-root-directory: __tests__/samples/no-wrapper
|
||||
build-root-directory: .github/workflow-samples/no-wrapper
|
||||
arguments: help
|
||||
- name: Test use defined Gradle executable
|
||||
uses: ./
|
||||
with:
|
||||
gradle-executable: __tests__/samples/groovy-dsl/gradlew${{ matrix.script-suffix }}
|
||||
build-root-directory: __tests__/samples/no-wrapper
|
||||
arguments: help -DgradleVersionCheck=7.4.1
|
||||
gradle-executable: .github/workflow-samples/groovy-dsl/gradlew${{ matrix.script-suffix }}
|
||||
build-root-directory: .github/workflow-samples/no-wrapper
|
||||
arguments: help -DgradleVersionCheck=7.4.2
|
||||
|
||||
gradle-versions:
|
||||
strategy:
|
||||
@@ -64,7 +67,7 @@ jobs:
|
||||
id: gradle
|
||||
with:
|
||||
gradle-version: ${{matrix.gradle}}
|
||||
build-root-directory: __tests__/samples/no-wrapper${{ matrix.build-root-suffix }}
|
||||
build-root-directory: .github/workflow-samples/no-wrapper${{ matrix.build-root-suffix }}
|
||||
arguments: help -DgradleVersionCheck=${{matrix.gradle}}
|
||||
- name: Check build scan url
|
||||
if: ${{ !steps.gradle.outputs.build-scan-url }}
|
||||
|
@@ -4,6 +4,9 @@ on:
|
||||
pull_request:
|
||||
types: [assigned, review_requested]
|
||||
push:
|
||||
paths:
|
||||
- '.github/**'
|
||||
- 'dist/**'
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
@@ -27,7 +30,7 @@ jobs:
|
||||
- name: Setup Gradle
|
||||
uses: ./
|
||||
- name: Build using Gradle wrapper
|
||||
working-directory: __tests__/samples/groovy-dsl
|
||||
working-directory: .github/workflow-samples/groovy-dsl
|
||||
run: ./gradlew test --info
|
||||
|
||||
# Test that the gradle-user-home cache will cache dependencies, by running build with --offline
|
||||
@@ -45,7 +48,7 @@ jobs:
|
||||
with:
|
||||
cache-read-only: true
|
||||
- name: Execute Gradle build with --offline
|
||||
working-directory: __tests__/samples/groovy-dsl
|
||||
working-directory: .github/workflow-samples/groovy-dsl
|
||||
run: ./gradlew test --offline --info
|
||||
|
||||
# Test that the gradle-user-home cache will cache and restore local build-cache
|
||||
@@ -63,5 +66,5 @@ jobs:
|
||||
with:
|
||||
cache-read-only: true
|
||||
- name: Execute Gradle build and verify tasks from cache
|
||||
working-directory: __tests__/samples/groovy-dsl
|
||||
working-directory: .github/workflow-samples/groovy-dsl
|
||||
run: ./gradlew test -DverifyCachedBuild=true --info
|
||||
|
11
.github/workflows/integTest-gradle-versions.yml
vendored
11
.github/workflows/integTest-gradle-versions.yml
vendored
@@ -4,6 +4,9 @@ on:
|
||||
pull_request:
|
||||
types: [assigned, review_requested]
|
||||
push:
|
||||
paths:
|
||||
- '.github/**'
|
||||
- 'dist/**'
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
@@ -31,21 +34,21 @@ jobs:
|
||||
with:
|
||||
gradle-version: 6.9
|
||||
- name: Test uses Gradle v6.9
|
||||
working-directory: __tests__/samples/no-wrapper
|
||||
working-directory: .github/workflow-samples/no-wrapper
|
||||
run: gradle help "-DgradleVersionCheck=6.9"
|
||||
- name: Setup Gradle with v7.1.1
|
||||
uses: ./
|
||||
with:
|
||||
gradle-version: 7.1.1
|
||||
- name: Test uses Gradle v7.1.1
|
||||
working-directory: __tests__/samples/no-wrapper
|
||||
working-directory: .github/workflow-samples/no-wrapper
|
||||
run: gradle help "-DgradleVersionCheck=7.1.1"
|
||||
- name: Setup Gradle with release-candidate
|
||||
uses: ./
|
||||
with:
|
||||
gradle-version: release-candidate
|
||||
- name: Test use release-candidate
|
||||
working-directory: __tests__/samples/no-wrapper
|
||||
working-directory: .github/workflow-samples/no-wrapper
|
||||
run: gradle help
|
||||
|
||||
gradle-versions:
|
||||
@@ -68,7 +71,7 @@ jobs:
|
||||
gradle-version: ${{ matrix.gradle }}
|
||||
- name: Run Gradle build
|
||||
id: gradle
|
||||
working-directory: __tests__/samples/no-wrapper${{ matrix.build-root-suffix }}
|
||||
working-directory: .github/workflow-samples/no-wrapper${{ matrix.build-root-suffix }}
|
||||
run: gradle help "-DgradleVersionCheck=${{matrix.gradle}}"
|
||||
- name: Check build scan url
|
||||
if: ${{ !steps.gradle.outputs.build-scan-url }}
|
||||
|
@@ -4,6 +4,9 @@ on:
|
||||
pull_request:
|
||||
types: [assigned, review_requested]
|
||||
push:
|
||||
paths:
|
||||
- '.github/**'
|
||||
- 'dist/**'
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
@@ -25,7 +28,7 @@ jobs:
|
||||
- name: Setup Gradle
|
||||
uses: ./
|
||||
- name: Build gradle-plugin project
|
||||
working-directory: __tests__/samples/gradle-plugin
|
||||
working-directory: .github/workflow-samples/gradle-plugin
|
||||
run: ./gradlew build
|
||||
|
||||
verify-build:
|
||||
@@ -40,5 +43,5 @@ jobs:
|
||||
- name: Setup Gradle
|
||||
uses: ./
|
||||
- name: Build gradle-plugin project
|
||||
working-directory: __tests__/samples/gradle-plugin
|
||||
working-directory: .github/workflow-samples/gradle-plugin
|
||||
run: ./gradlew build --offline
|
||||
|
@@ -4,6 +4,9 @@ on:
|
||||
pull_request:
|
||||
types: [assigned, review_requested]
|
||||
push:
|
||||
paths:
|
||||
- '.github/**'
|
||||
- 'dist/**'
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
@@ -25,7 +28,7 @@ jobs:
|
||||
- name: Setup Gradle
|
||||
uses: ./
|
||||
- name: Build kotlin-dsl project
|
||||
working-directory: __tests__/samples/kotlin-dsl
|
||||
working-directory: .github/workflow-samples/kotlin-dsl
|
||||
run: ./gradlew build
|
||||
|
||||
verify-build:
|
||||
@@ -40,5 +43,5 @@ jobs:
|
||||
- name: Setup Gradle
|
||||
uses: ./
|
||||
- name: Build kotlin-dsl project
|
||||
working-directory: __tests__/samples/kotlin-dsl
|
||||
working-directory: .github/workflow-samples/kotlin-dsl
|
||||
run: ./gradlew build --offline
|
||||
|
19
.github/workflows/pr-build-scan-comment.yml
vendored
19
.github/workflows/pr-build-scan-comment.yml
vendored
@@ -6,16 +6,15 @@ jobs:
|
||||
gradle:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-java@v2
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 11
|
||||
- uses: ./
|
||||
- id: gradle
|
||||
working-directory: __tests__/samples/kotlin-dsl
|
||||
run: ./gradlew help
|
||||
- name: "Comment build scan url"
|
||||
- name: Checkout project sources
|
||||
uses: actions/checkout@v2
|
||||
- name: Setup Gradle
|
||||
uses: ./
|
||||
- name: Run build with Gradle wrapper
|
||||
id: gradle
|
||||
working-directory: .github/workflow-samples/kotlin-dsl
|
||||
run: ./gradlew build --scan
|
||||
- name: "Add build scan URL as PR comment"
|
||||
uses: actions/github-script@v5
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
|
45
README.md
45
README.md
@@ -206,7 +206,7 @@ cache-disabled: true
|
||||
|
||||
### Cache keys
|
||||
|
||||
For distributions downloaded to satisfy a `gradle-version` parametere are stored outside of Gradle User Home and cached separately. The cache key is unique to the downloaded distribution and will not change over time.
|
||||
Distributions downloaded to satisfy a `gradle-version` parameter are stored outside of Gradle User Home and cached separately. The cache key is unique to the downloaded distribution and will not change over time.
|
||||
|
||||
The state of the Gradle User Home and configuration-cache are highly dependent on the Gradle execution, so the cache key is composed of the current commit hash and the GitHub actions job id.
|
||||
As such, the cache key is likely to change on each subsequent run of GitHub actions.
|
||||
@@ -288,6 +288,32 @@ Each build is different, and some builds produce more Gradle User Home content t
|
||||
[Cache debugging ](#cache-debugging-and-analysis) can provide insight into which cache entries are the largest,
|
||||
and you can selectively [exclude content using `gradle-home-cache-exclude`](#gradle-user-home-cache-tuning).
|
||||
|
||||
## Saving build outputs
|
||||
|
||||
By default, a GitHub Actions workflow using `gradle-build-action` will record the log output and any Build Scan links for your build,
|
||||
but any output files generated by the build will not be saved.
|
||||
|
||||
To save selected files from your build execution, you can use the core [Upload-Artifact](https://github.com/actions/upload-artifact) action.
|
||||
For example:
|
||||
|
||||
```yaml
|
||||
jobs:
|
||||
gradle:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout project sources
|
||||
uses: actions/checkout@v2
|
||||
- name: Setup Gradle
|
||||
uses: gradle/gradle-build-action@v2
|
||||
- name: Run build with Gradle wrapper
|
||||
run: ./gradlew build --scan
|
||||
- name: Upload build reports
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: build-reports
|
||||
path: build/reports/
|
||||
```
|
||||
|
||||
## Build scans
|
||||
|
||||
If your build publishes a [build scan](https://gradle.com/build-scans/) the `gradle-build-action` action will:
|
||||
@@ -304,15 +330,14 @@ jobs:
|
||||
gradle:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-java@v2
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 11
|
||||
- uses: gradle/gradle-build-action@v2
|
||||
- id: gradle
|
||||
run: ./gradlew build
|
||||
- name: "Comment build scan url"
|
||||
- name: Checkout project sources
|
||||
uses: actions/checkout@v2
|
||||
- name: Setup Gradle
|
||||
uses: gradle/gradle-build-action@v2
|
||||
- name: Run build with Gradle wrapper
|
||||
id: gradle
|
||||
run: ./gradlew build --scan
|
||||
- name: "Add build scan URL as PR comment"
|
||||
uses: actions/github-script@v5
|
||||
if: github.event_name == 'pull_request' && failure()
|
||||
with:
|
||||
|
262
dist/main/index.js
vendored
262
dist/main/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/main/index.js.map
vendored
2
dist/main/index.js.map
vendored
File diff suppressed because one or more lines are too long
3913
dist/main/sourcemap-register.js
vendored
3913
dist/main/sourcemap-register.js
vendored
File diff suppressed because one or more lines are too long
262
dist/post/index.js
vendored
262
dist/post/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/post/index.js.map
vendored
2
dist/post/index.js.map
vendored
File diff suppressed because one or more lines are too long
3913
dist/post/sourcemap-register.js
vendored
3913
dist/post/sourcemap-register.js
vendored
File diff suppressed because one or more lines are too long
@@ -3,10 +3,8 @@ module.exports = {
|
||||
moduleFileExtensions: ['js', 'ts', 'json'],
|
||||
testEnvironment: 'node',
|
||||
testMatch: ['**/*.test.ts'],
|
||||
testRunner: 'jest-circus/runner',
|
||||
transform: {
|
||||
'^.+\\.ts$': 'ts-jest'
|
||||
},
|
||||
verbose: true,
|
||||
setupFilesAfterEnv: ['./jest.setup.js']
|
||||
verbose: true
|
||||
}
|
||||
|
@@ -1 +0,0 @@
|
||||
jest.setTimeout(10000) // in milliseconds
|
4214
package-lock.json
generated
4214
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
30
package.json
30
package.json
@@ -24,30 +24,28 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/cache": "2.0.0",
|
||||
"@actions/core": "1.6.0",
|
||||
"@actions/cache": "2.0.4",
|
||||
"@actions/core": "1.8.2",
|
||||
"@actions/exec": "1.1.1",
|
||||
"@actions/github": "5.0.0",
|
||||
"@actions/glob": "0.2.1",
|
||||
"@actions/http-client": "1.0.11",
|
||||
"@actions/tool-cache": "1.7.2",
|
||||
"@actions/github": "5.0.3",
|
||||
"@actions/glob": "0.3.0",
|
||||
"@actions/http-client": "2.0.1",
|
||||
"@actions/tool-cache": "2.0.1",
|
||||
"string-argv": "0.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "27.4.1",
|
||||
"@types/node": "16.11.21",
|
||||
"@types/unzipper": "0.10.5",
|
||||
"@typescript-eslint/parser": "5.17.0",
|
||||
"@zeit/ncc": "0.22.3",
|
||||
"eslint": "8.12.0",
|
||||
"@typescript-eslint/parser": "5.23.0",
|
||||
"@vercel/ncc": "0.33.4",
|
||||
"eslint": "8.15.0",
|
||||
"eslint-plugin-github": "4.3.6",
|
||||
"eslint-plugin-jest": "26.1.3",
|
||||
"jest": "27.5.1",
|
||||
"jest-circus": "27.5.1",
|
||||
"eslint-plugin-jest": "26.2.2",
|
||||
"jest": "28.1.0",
|
||||
"js-yaml": "4.1.0",
|
||||
"patch-package": "6.4.7",
|
||||
"prettier": "2.6.1",
|
||||
"ts-jest": "27.1.4",
|
||||
"typescript": "4.6.3"
|
||||
"prettier": "2.6.2",
|
||||
"ts-jest": "28.0.2",
|
||||
"typescript": "4.6.4"
|
||||
}
|
||||
}
|
||||
|
@@ -26,24 +26,10 @@ index 16b20f7..aea77ba 100644
|
||||
+ constructor(key: string, size?: number);
|
||||
+}
|
||||
diff --git a/node_modules/@actions/cache/lib/cache.js b/node_modules/@actions/cache/lib/cache.js
|
||||
index dd31592..cbe378a 100644
|
||||
index 0b5a2a8..757ad88 100644
|
||||
--- a/node_modules/@actions/cache/lib/cache.js
|
||||
+++ b/node_modules/@actions/cache/lib/cache.js
|
||||
@@ -37,6 +37,13 @@ class ReserveCacheError extends Error {
|
||||
}
|
||||
}
|
||||
exports.ReserveCacheError = ReserveCacheError;
|
||||
+class CacheEntry {
|
||||
+ constructor(key, size) {
|
||||
+ this.key = key;
|
||||
+ this.size = size;
|
||||
+ }
|
||||
+}
|
||||
+exports.CacheEntry = CacheEntry;
|
||||
function checkPaths(paths) {
|
||||
if (!paths || paths.length === 0) {
|
||||
throw new ValidationError(`Path Validation Error: At least one directory or file path is required`);
|
||||
@@ -93,6 +100,7 @@ function restoreCache(paths, primaryKey, restoreKeys, options) {
|
||||
@@ -93,6 +93,7 @@ function restoreCache(paths, primaryKey, restoreKeys, options) {
|
||||
}
|
||||
const archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod));
|
||||
core.debug(`Archive Path: ${archivePath}`);
|
||||
@@ -51,7 +37,7 @@ index dd31592..cbe378a 100644
|
||||
try {
|
||||
// Download the cache from the cache entry
|
||||
yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options);
|
||||
@@ -100,6 +108,7 @@ function restoreCache(paths, primaryKey, restoreKeys, options) {
|
||||
@@ -100,6 +101,7 @@ function restoreCache(paths, primaryKey, restoreKeys, options) {
|
||||
yield tar_1.listTar(archivePath, compressionMethod);
|
||||
}
|
||||
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
|
||||
@@ -59,7 +45,7 @@ index dd31592..cbe378a 100644
|
||||
core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
|
||||
yield tar_1.extractTar(archivePath, compressionMethod);
|
||||
core.info('Cache restored successfully');
|
||||
@@ -113,7 +122,7 @@ function restoreCache(paths, primaryKey, restoreKeys, options) {
|
||||
@@ -113,7 +115,7 @@ function restoreCache(paths, primaryKey, restoreKeys, options) {
|
||||
core.debug(`Failed to delete archive: ${error}`);
|
||||
}
|
||||
}
|
||||
@@ -68,7 +54,7 @@ index dd31592..cbe378a 100644
|
||||
});
|
||||
}
|
||||
exports.restoreCache = restoreCache;
|
||||
@@ -144,6 +153,7 @@ function saveCache(paths, key, options) {
|
||||
@@ -138,6 +140,7 @@ function saveCache(paths, key, options) {
|
||||
const archiveFolder = yield utils.createTempDirectory();
|
||||
const archivePath = path.join(archiveFolder, utils.getCacheFileName(compressionMethod));
|
||||
core.debug(`Archive Path: ${archivePath}`);
|
||||
@@ -76,15 +62,15 @@ index dd31592..cbe378a 100644
|
||||
try {
|
||||
yield tar_1.createTar(archiveFolder, cachePaths, compressionMethod);
|
||||
if (core.isDebug()) {
|
||||
@@ -151,6 +161,7 @@ function saveCache(paths, key, options) {
|
||||
@@ -145,6 +148,7 @@ function saveCache(paths, key, options) {
|
||||
}
|
||||
const fileSizeLimit = 10 * 1024 * 1024 * 1024; // 10GB per repo limit
|
||||
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
|
||||
+ savedEntry.size = archiveFileSize;
|
||||
core.debug(`File Size: ${archiveFileSize}`);
|
||||
if (archiveFileSize > fileSizeLimit) {
|
||||
throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`);
|
||||
@@ -167,7 +178,7 @@ function saveCache(paths, key, options) {
|
||||
// For GHES, this check will take place in ReserveCache API with enterprise file size limit
|
||||
if (archiveFileSize > fileSizeLimit && !utils.isGhes()) {
|
||||
@@ -176,8 +180,15 @@ function saveCache(paths, key, options) {
|
||||
core.debug(`Failed to delete archive: ${error}`);
|
||||
}
|
||||
}
|
||||
@@ -93,3 +79,12 @@ index dd31592..cbe378a 100644
|
||||
});
|
||||
}
|
||||
exports.saveCache = saveCache;
|
||||
+class CacheEntry {
|
||||
+ constructor(key, size) {
|
||||
+ this.key = key;
|
||||
+ this.size = size;
|
||||
+ }
|
||||
+}
|
||||
+exports.CacheEntry = CacheEntry;
|
||||
//# sourceMappingURL=cache.js.map
|
||||
\ No newline at end of file
|
@@ -1,2 +1 @@
|
||||
- [FIX] - Upgrade `minimist` from `1.2.5` -> `1.2.6`
|
||||
- [FIX] - Support cache entries > 2Gb via library upgrade to `@actions/cache` from `1.0.10` -> `2.0.0`.
|
||||
[FIX] Save/restore exploded Gradle dist rather than zip
|
||||
|
@@ -294,6 +294,28 @@ export class GradleHomeEntryExtractor extends AbstractEntryExtractor {
|
||||
super(gradleUserHome, 'gradle-home')
|
||||
}
|
||||
|
||||
async extract(listener: CacheListener): Promise<void> {
|
||||
await this.deleteWrapperZips()
|
||||
return super.extract(listener)
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete any downloaded wrapper zip files that are not needed after extraction.
|
||||
* These files are cleaned up by Gradle >= 7.5, but for older versions we remove them manually.
|
||||
*/
|
||||
private async deleteWrapperZips(): Promise<void> {
|
||||
const wrapperZips = path.resolve(this.gradleUserHome, 'wrapper/dists/*/*/*.zip')
|
||||
const globber = await glob.create(wrapperZips, {
|
||||
implicitDescendants: false,
|
||||
followSymbolicLinks: false
|
||||
})
|
||||
|
||||
for (const p of await globber.glob()) {
|
||||
cacheDebug(`Deleting wrapper zip: ${p}`)
|
||||
tryDelete(p)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the extracted cache entry definitions, which determine which artifacts will be cached
|
||||
* separately from the rest of the Gradle User Home cache entry.
|
||||
@@ -304,13 +326,19 @@ export class GradleHomeEntryExtractor extends AbstractEntryExtractor {
|
||||
patterns: string[],
|
||||
bundle: boolean
|
||||
): ExtractedCacheEntryDefinition => {
|
||||
const resolvedPattern = patterns.map(x => path.resolve(this.gradleUserHome, x)).join('\n')
|
||||
return new ExtractedCacheEntryDefinition(artifactType, resolvedPattern, bundle)
|
||||
const resolvedPatterns = patterns
|
||||
.map(x => {
|
||||
const isDir = x.endsWith('/')
|
||||
const resolved = path.resolve(this.gradleUserHome, x)
|
||||
return isDir ? `${resolved}/` : resolved // Restore trailing '/' removed by path.resolve()
|
||||
})
|
||||
.join('\n')
|
||||
return new ExtractedCacheEntryDefinition(artifactType, resolvedPatterns, bundle)
|
||||
}
|
||||
|
||||
return [
|
||||
entryDefinition('generated-gradle-jars', ['caches/*/generated-gradle-jars/*.jar'], false),
|
||||
entryDefinition('wrapper-zips', ['wrapper/dists/*/*/*.zip'], false),
|
||||
entryDefinition('wrapper-zips', ['wrapper/dists/*/*/'], false), // Entire wrapper directory cached together
|
||||
entryDefinition('java-toolchains', ['jdks/*.zip', 'jdks/*.tar.gz'], false),
|
||||
entryDefinition('dependencies', ['caches/modules-*/files-*/*/*/*/*'], true),
|
||||
entryDefinition('instrumented-jars', ['caches/jars-*/*'], true),
|
||||
|
Reference in New Issue
Block a user