Merge branch 'master' into releases/v1

This commit is contained in:
Paul Merlin 2020-09-13 13:48:42 +02:00
commit 90ccf054e6
11 changed files with 2400 additions and 1498 deletions

View file

@ -25,7 +25,7 @@ jobs:
- name: Test dist download
uses: ./
with:
gradle-version: 6.6-milestone-1
gradle-version: rc
build-root-directory: __tests__/data/basic
dependencies-cache-enabled: true
configuration-cache-enabled: true
@ -33,7 +33,7 @@ jobs:
- name: Stop Gradle daemon
uses: ./
with:
gradle-version: 6.6-milestone-1
gradle-version: rc
build-root-directory: __tests__/data/basic
dependencies-cache-enabled: true
configuration-cache-enabled: true

View file

@ -9,19 +9,19 @@ describe('cache', () => {
'__tests__/data/basic/gradle/wrapper/gradle-wrapper.properties'
)
)
expect(version).toBe('6.5-bin')
expect(version).toBe('6.6.1-bin')
})
it('for -bin dist', async () => {
const version = cacheWrapper.extractGradleWrapperSlugFromDistUri(
'distributionUrl=https\\://services.gradle.org/distributions/gradle-6.5-bin.zip'
'distributionUrl=https\\://services.gradle.org/distributions/gradle-6.6.1-bin.zip'
)
expect(version).toBe('6.5-bin')
expect(version).toBe('6.6.1-bin')
})
it('for -all dist', async () => {
const version = cacheWrapper.extractGradleWrapperSlugFromDistUri(
'distributionUrl=https\\://services.gradle.org/distributions/gradle-6.5-all.zip'
'distributionUrl=https\\://services.gradle.org/distributions/gradle-6.6.1-all.zip'
)
expect(version).toBe('6.5-all')
expect(version).toBe('6.6.1-all')
})
it('for milestone', async () => {
const version = cacheWrapper.extractGradleWrapperSlugFromDistUri(

View file

@ -10,7 +10,7 @@ describe('crypto-utils', () => {
expect(hash).toBe(
process.platform === 'win32'
? '3364336e94e746ce65a31748a6371b7efd7d499e18ad605c74c91cde0edc0a44'
: '4ebb65b45e6f6796d5ec6ace96e9471cc6573d294c54f99c4920fe5328e75bab'
: '63b9f14f65d014e585099c9c274b9dcbddf5cfd1a8978e5a24efb89ff9304348'
)
})
it('a directory with a glob', async () => {
@ -21,7 +21,7 @@ describe('crypto-utils', () => {
expect(hash).toBe(
process.platform === 'win32'
? '3364336e94e746ce65a31748a6371b7efd7d499e18ad605c74c91cde0edc0a44'
: '4ebb65b45e6f6796d5ec6ace96e9471cc6573d294c54f99c4920fe5328e75bab'
: '63b9f14f65d014e585099c9c274b9dcbddf5cfd1a8978e5a24efb89ff9304348'
)
})
it('a directory with globs', async () => {
@ -32,7 +32,7 @@ describe('crypto-utils', () => {
expect(hash).toBe(
process.platform === 'win32'
? 'd9b66fded38f79f601ce745d64ed726a8df8c0b242b02bcd2c1d331f54742ad6'
: 'aa72a837158799fbadd1c4aff94fcc2b5bb9dc6ad8d12f6337d047d4b0c8f79e'
: 'f42cd10636f09799f4e01cc84e7ae906cc1d9140f1446f8dcd054d19cbc44c2b'
)
})
})

View file

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

2
dist/main/index.js vendored

File diff suppressed because one or more lines are too long

2
dist/post/index.js vendored

File diff suppressed because one or more lines are too long

3807
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -24,30 +24,30 @@
"author": "Paul Merlin <paul@nosphere.org>",
"license": "MIT",
"dependencies": {
"@actions/cache": "0.2.1",
"@actions/core": "1.2.4",
"@actions/cache": "1.0.2",
"@actions/core": "1.2.5",
"@actions/exec": "1.0.4",
"@actions/glob": "0.1.0",
"@actions/io": "1.0.2",
"@actions/tool-cache": "1.5.5",
"@actions/tool-cache": "1.6.0",
"string-argv": "0.3.1",
"typed-rest-client": "1.7.3",
"unzipper": "0.10.11"
},
"devDependencies": {
"@types/jest": "26.0.0",
"@types/jest": "26.0.13",
"@types/node": "12.12.6",
"@types/unzipper": "0.10.3",
"@typescript-eslint/parser": "3.3.0",
"@typescript-eslint/parser": "4.1.0",
"@zeit/ncc": "0.22.3",
"eslint": "7.3.0",
"eslint-plugin-github": "4.0.1",
"eslint-plugin-jest": "23.16.0",
"jest": "26.0.1",
"jest-circus": "26.0.1",
"eslint": "7.9.0",
"eslint-plugin-github": "4.1.1",
"eslint-plugin-jest": "24.0.1",
"jest": "26.4.2",
"jest-circus": "26.4.2",
"js-yaml": "3.14.0",
"prettier": "2.0.5",
"ts-jest": "26.1.1",
"typescript": "3.9.5"
"prettier": "2.1.1",
"ts-jest": "26.3.0",
"typescript": "4.0.2"
}
}

View file

@ -26,7 +26,7 @@ export async function restoreCachedWrapperDist(
if (!wrapperSlug) return
const wrapperCacheKey = `wrapper-${wrapperSlug}`
const wrapperCachePath = path.join(
const wrapperCachePath = path.resolve(
os.homedir(),
`.gradle/wrapper/dists/gradle-${wrapperSlug}`
)
@ -35,21 +35,30 @@ export async function restoreCachedWrapperDist(
core.saveState(WRAPPER_CACHE_KEY, wrapperCacheKey)
core.saveState(WRAPPER_CACHE_PATH, wrapperCachePath)
const restoredKey = await cache.restoreCache(
[wrapperCachePath],
wrapperCacheKey
)
try {
const restoredKey = await cache.restoreCache(
[wrapperCachePath],
wrapperCacheKey
)
if (!restoredKey) {
if (!restoredKey) {
core.info(
'Wrapper installation cache not found, expect a Gradle distribution download.'
)
return
}
core.saveState(WRAPPER_CACHE_RESULT, restoredKey)
core.info(
'Wrapper installation cache not found, expect a Gradle distribution download.'
`Wrapper installation restored from cache key: ${restoredKey}`
)
return
} catch (error) {
core.info(
`Wrapper installation cache restore failed, expect a Gradle distribution download\n ${error}`
)
return
}
core.saveState(WRAPPER_CACHE_RESULT, restoredKey)
core.info(`Wrapper installation restored from cache key: ${restoredKey}`)
return
}
export async function cacheWrapperDist(): Promise<void> {

View file

@ -18,12 +18,9 @@ export async function execute(
ignoreReturnCode: true,
listeners: {
stdline: (line: string) => {
if (line.startsWith('Publishing build scan...')) {
if (line.includes('Publishing build scan...')) {
publishing = true
}
if (publishing && line.length === 0) {
publishing = false
}
if (publishing && line.startsWith('http')) {
buildScanUrl = line.trim()
publishing = false

View file

@ -41,9 +41,10 @@ async function gradleReleaseCandidate(): Promise<string> {
const versionInfo = await gradleVersionDeclaration(
`${gradleVersionsBaseUrl}/release-candidate`
)
if (versionInfo) {
if (versionInfo && versionInfo.version && versionInfo.downloadUrl) {
return provisionGradle(versionInfo.version, versionInfo.downloadUrl)
}
core.info('No current release-candidate found, will fallback to current')
return gradleCurrent()
}