mirror of
https://github.com/gradle/actions.git
synced 2025-12-08 17:15:46 +08:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db19848a5f | ||
|
|
941b289d84 | ||
|
|
bce7daca54 | ||
|
|
11eaed9738 | ||
|
|
cd62d9c9ef | ||
|
|
a54fb6a5bb | ||
|
|
ef36f81b41 | ||
|
|
18998bc43e | ||
|
|
a772c14b33 | ||
|
|
7763d71170 | ||
|
|
9ab93ee864 | ||
|
|
d124ec149f | ||
|
|
6ccde15122 |
2
.github/workflows/ci-init-script-check.yml
vendored
2
.github/workflows/ci-init-script-check.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
|||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
java-version: 8
|
java-version: 11
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
uses: gradle/actions/setup-gradle@v3 # Use a released version to avoid breakages
|
uses: gradle/actions/setup-gradle@v3 # Use a released version to avoid breakages
|
||||||
- name: Run integration tests
|
- name: Run integration tests
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ jobs:
|
|||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
java-version: 8
|
java-version: 11
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
id: setup-gradle
|
id: setup-gradle
|
||||||
uses: ./setup-gradle
|
uses: ./setup-gradle
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ permissions:
|
|||||||
env:
|
env:
|
||||||
SKIP_DIST: ${{ inputs.skip-dist }}
|
SKIP_DIST: ${{ inputs.skip-dist }}
|
||||||
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: dependency-graph-${{ inputs.cache-key-prefix }}
|
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: dependency-graph-${{ inputs.cache-key-prefix }}
|
||||||
|
GITHUB_DEPENDENCY_GRAPH_REF: 'refs/tags/v0.0.1' # Use a different ref to avoid updating the real dependency graph for the repository
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
groovy-generate:
|
groovy-generate:
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ on:
|
|||||||
env:
|
env:
|
||||||
SKIP_DIST: ${{ inputs.skip-dist }}
|
SKIP_DIST: ${{ inputs.skip-dist }}
|
||||||
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: dependency-submission-failures-${{ inputs.cache-key-prefix }}
|
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: dependency-submission-failures-${{ inputs.cache-key-prefix }}
|
||||||
|
GITHUB_DEPENDENCY_GRAPH_REF: 'refs/tags/v0.0.1' # Use a different ref to avoid updating the real dependency graph for the repository
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
failing-build:
|
failing-build:
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ permissions:
|
|||||||
env:
|
env:
|
||||||
SKIP_DIST: ${{ inputs.skip-dist }}
|
SKIP_DIST: ${{ inputs.skip-dist }}
|
||||||
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: dependency-submission-${{ inputs.cache-key-prefix }}
|
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: dependency-submission-${{ inputs.cache-key-prefix }}
|
||||||
|
GITHUB_DEPENDENCY_GRAPH_REF: 'refs/tags/v0.0.1' # Use a different ref to avoid updating the real dependency graph for the repository
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
groovy-generate-and-upload:
|
groovy-generate-and-upload:
|
||||||
@@ -223,8 +224,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
gradle-version: ${{ matrix.gradle }}
|
gradle-version: ${{ matrix.gradle }}
|
||||||
build-root-directory: .github/workflow-samples/no-wrapper${{ matrix.build-root-suffix }}
|
build-root-directory: .github/workflow-samples/no-wrapper${{ matrix.build-root-suffix }}
|
||||||
env:
|
|
||||||
GITHUB_DEPENDENCY_GRAPH_REF: 'refs/tags/v0.0.1' # Use a different ref to avoid updating the real dependency graph for the repository
|
|
||||||
|
|
||||||
after-setup-gradle:
|
after-setup-gradle:
|
||||||
strategy:
|
strategy:
|
||||||
|
|||||||
7
.github/workflows/integ-test-execution.yml
vendored
7
.github/workflows/integ-test-execution.yml
vendored
@@ -61,12 +61,17 @@ jobs:
|
|||||||
gradle: [7.5.1, 6.9.2, 5.6.4, 4.10.3, 3.5.1]
|
gradle: [7.5.1, 6.9.2, 5.6.4, 4.10.3, 3.5.1]
|
||||||
os: ${{fromJSON(inputs.runner-os)}}
|
os: ${{fromJSON(inputs.runner-os)}}
|
||||||
include:
|
include:
|
||||||
|
- java-version: 11
|
||||||
- gradle: 5.6.4
|
- gradle: 5.6.4
|
||||||
build-root-suffix: -gradle-5
|
build-root-suffix: -gradle-5
|
||||||
- gradle: 4.10.3
|
- gradle: 4.10.3
|
||||||
build-root-suffix: -gradle-4
|
build-root-suffix: -gradle-4
|
||||||
- gradle: 3.5.1
|
- gradle: 3.5.1
|
||||||
build-root-suffix: -gradle-4
|
build-root-suffix: -gradle-4
|
||||||
|
java-version: 8
|
||||||
|
exclude:
|
||||||
|
- os: macos-latest # Java 8 is not supported on macos-latest, so we cannot test Gradle 3.5.1
|
||||||
|
gradle: 3.5.1
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
@@ -78,7 +83,7 @@ jobs:
|
|||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
java-version: 8
|
java-version: ${{ matrix.java-version }}
|
||||||
- name: Run Gradle build
|
- name: Run Gradle build
|
||||||
uses: ./setup-gradle
|
uses: ./setup-gradle
|
||||||
id: gradle
|
id: gradle
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ jobs:
|
|||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
java-version: 8
|
java-version: 11
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
id: setup-gradle
|
id: setup-gradle
|
||||||
uses: ./setup-gradle
|
uses: ./setup-gradle
|
||||||
|
|||||||
@@ -76,12 +76,17 @@ jobs:
|
|||||||
gradle: [7.3, 6.9, 5.6.4, 4.10.3, 3.5.1]
|
gradle: [7.3, 6.9, 5.6.4, 4.10.3, 3.5.1]
|
||||||
os: ${{fromJSON(inputs.runner-os)}}
|
os: ${{fromJSON(inputs.runner-os)}}
|
||||||
include:
|
include:
|
||||||
|
- java-version: 11
|
||||||
- gradle: 5.6.4
|
- gradle: 5.6.4
|
||||||
build-root-suffix: -gradle-5
|
build-root-suffix: -gradle-5
|
||||||
- gradle: 4.10.3
|
- gradle: 4.10.3
|
||||||
build-root-suffix: -gradle-4
|
build-root-suffix: -gradle-4
|
||||||
- gradle: 3.5.1
|
- gradle: 3.5.1
|
||||||
build-root-suffix: -gradle-4
|
build-root-suffix: -gradle-4
|
||||||
|
java-version: 8
|
||||||
|
exclude:
|
||||||
|
- os: macos-latest # Java 8 is not supported on macos-latest, so we cannot test Gradle 3.5.1
|
||||||
|
gradle: 3.5.1
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
@@ -93,7 +98,7 @@ jobs:
|
|||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
java-version: 8
|
java-version: ${{ matrix.java-version }}
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
id: setup-gradle
|
id: setup-gradle
|
||||||
uses: ./setup-gradle
|
uses: ./setup-gradle
|
||||||
|
|||||||
2
build
2
build
@@ -5,7 +5,7 @@ cd sources
|
|||||||
case "$1" in
|
case "$1" in
|
||||||
all)
|
all)
|
||||||
npm clean-install
|
npm clean-install
|
||||||
nprm run all
|
npm run all
|
||||||
;;
|
;;
|
||||||
act)
|
act)
|
||||||
# Build and copy outputs to the dist directory
|
# Build and copy outputs to the dist directory
|
||||||
|
|||||||
51
dist/dependency-submission/main/index.js
vendored
51
dist/dependency-submission/main/index.js
vendored
@@ -144686,6 +144686,7 @@ async function setup(config) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (option === configuration_1.DependencyGraphOption.DownloadAndSubmit) {
|
if (option === configuration_1.DependencyGraphOption.DownloadAndSubmit) {
|
||||||
|
maybeExportVariable('DEPENDENCY_GRAPH_REPORT_DIR', config.getReportDirectory());
|
||||||
await downloadAndSubmitDependencyGraphs(config);
|
await downloadAndSubmitDependencyGraphs(config);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -144779,17 +144780,15 @@ async function submitDependencyGraphs(dependencyGraphFiles) {
|
|||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
if (error instanceof request_error_1.RequestError) {
|
if (error instanceof request_error_1.RequestError) {
|
||||||
throw new Error(translateErrorMessage(dependencyGraphFile, error));
|
error.message = translateErrorMessage(dependencyGraphFile, error);
|
||||||
}
|
|
||||||
else {
|
|
||||||
throw error;
|
|
||||||
}
|
}
|
||||||
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function translateErrorMessage(jsonFile, error) {
|
function translateErrorMessage(jsonFile, error) {
|
||||||
const relativeJsonFile = getRelativePathFromWorkspace(jsonFile);
|
const relativeJsonFile = getRelativePathFromWorkspace(jsonFile);
|
||||||
const mainWarning = `Dependency submission failed for ${relativeJsonFile}.\n${String(error)}`;
|
const mainWarning = `Dependency submission failed for ${relativeJsonFile}.\n${error.message}`;
|
||||||
if (error.message === 'Resource not accessible by integration') {
|
if (error.message === 'Resource not accessible by integration') {
|
||||||
return `${mainWarning}
|
return `${mainWarning}
|
||||||
Please ensure that the 'contents: write' permission is available for the workflow job.
|
Please ensure that the 'contents: write' permission is available for the workflow job.
|
||||||
@@ -145097,6 +145096,9 @@ function handleMainActionError(error) {
|
|||||||
}
|
}
|
||||||
else if (error instanceof JobFailure) {
|
else if (error instanceof JobFailure) {
|
||||||
core.setFailed(String(error));
|
core.setFailed(String(error));
|
||||||
|
if (error.stack) {
|
||||||
|
core.info(error.stack);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core.setFailed(String(error));
|
core.setFailed(String(error));
|
||||||
@@ -145109,6 +145111,9 @@ exports.handleMainActionError = handleMainActionError;
|
|||||||
function handlePostActionError(error) {
|
function handlePostActionError(error) {
|
||||||
if (error instanceof JobFailure) {
|
if (error instanceof JobFailure) {
|
||||||
core.setFailed(String(error));
|
core.setFailed(String(error));
|
||||||
|
if (error.stack) {
|
||||||
|
core.info(error.stack);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core.warning(`Unhandled error in Gradle post-action - job will continue: ${error}`);
|
core.warning(`Unhandled error in Gradle post-action - job will continue: ${error}`);
|
||||||
@@ -145460,7 +145465,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.generateJobSummary = void 0;
|
exports.renderSummaryTable = exports.generateJobSummary = void 0;
|
||||||
const core = __importStar(__nccwpck_require__(42186));
|
const core = __importStar(__nccwpck_require__(42186));
|
||||||
const github = __importStar(__nccwpck_require__(95438));
|
const github = __importStar(__nccwpck_require__(95438));
|
||||||
const request_error_1 = __nccwpck_require__(10537);
|
const request_error_1 = __nccwpck_require__(10537);
|
||||||
@@ -145532,6 +145537,7 @@ Note that this permission is never available for a workflow triggered from a rep
|
|||||||
function renderSummaryTable(results) {
|
function renderSummaryTable(results) {
|
||||||
return `${renderDeprecations()}\n${renderBuildResults(results)}`;
|
return `${renderDeprecations()}\n${renderBuildResults(results)}`;
|
||||||
}
|
}
|
||||||
|
exports.renderSummaryTable = renderSummaryTable;
|
||||||
function renderDeprecations() {
|
function renderDeprecations() {
|
||||||
const deprecations = (0, deprecation_collector_1.getDeprecations)();
|
const deprecations = (0, deprecation_collector_1.getDeprecations)();
|
||||||
if (deprecations.length === 0) {
|
if (deprecations.length === 0) {
|
||||||
@@ -145560,7 +145566,7 @@ function renderBuildResults(results) {
|
|||||||
<th>Requested Tasks</th>
|
<th>Requested Tasks</th>
|
||||||
<th>Gradle Version</th>
|
<th>Gradle Version</th>
|
||||||
<th>Build Outcome</th>
|
<th>Build Outcome</th>
|
||||||
<th>Build Scan®</th>
|
<th>Build Scan®</th>
|
||||||
</tr>${results.map(result => renderBuildResultRow(result)).join('')}
|
</tr>${results.map(result => renderBuildResultRow(result)).join('')}
|
||||||
</table>
|
</table>
|
||||||
`;
|
`;
|
||||||
@@ -145580,16 +145586,35 @@ function renderOutcome(result) {
|
|||||||
}
|
}
|
||||||
function renderBuildScan(result) {
|
function renderBuildScan(result) {
|
||||||
if (result.buildScanFailed) {
|
if (result.buildScanFailed) {
|
||||||
return renderBuildScanBadge('PUBLISH_FAILED', 'orange', 'https://docs.gradle.com/develocity/gradle-plugin/#troubleshooting');
|
return renderBuildScanBadge({
|
||||||
|
text: 'Publish failed',
|
||||||
|
alt: 'Build Scan publish failed',
|
||||||
|
color: 'orange',
|
||||||
|
logo: false,
|
||||||
|
targetUrl: 'https://docs.gradle.com/develocity/gradle-plugin/#troubleshooting'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (result.buildScanUri) {
|
if (result.buildScanUri) {
|
||||||
return renderBuildScanBadge('PUBLISHED', '06A0CE', result.buildScanUri);
|
return renderBuildScanBadge({
|
||||||
|
text: 'Build Scan®',
|
||||||
|
alt: 'Build Scan published',
|
||||||
|
color: '06A0CE',
|
||||||
|
logo: true,
|
||||||
|
targetUrl: result.buildScanUri
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return renderBuildScanBadge('NOT_PUBLISHED', 'lightgrey', 'https://scans.gradle.com');
|
return renderBuildScanBadge({
|
||||||
|
text: 'Not published',
|
||||||
|
alt: 'Build Scan not published',
|
||||||
|
color: 'lightgrey',
|
||||||
|
logo: false,
|
||||||
|
targetUrl: 'https://scans.gradle.com'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
function renderBuildScanBadge(outcomeText, outcomeColor, targetUrl) {
|
function renderBuildScanBadge({ text, alt, color, logo, targetUrl }) {
|
||||||
const badgeUrl = `https://img.shields.io/badge/Build%20Scan%C2%AE-${outcomeText}-${outcomeColor}?logo=Gradle`;
|
const encodedText = encodeURIComponent(text);
|
||||||
const badgeHtml = `<img src="${badgeUrl}" alt="Build Scan ${outcomeText}" />`;
|
const badgeUrl = `https://img.shields.io/badge/${encodedText}-${color}${logo ? '?logo=Gradle' : ''}`;
|
||||||
|
const badgeHtml = `<img src="${badgeUrl}" alt="${alt}" />`;
|
||||||
return `<a href="${targetUrl}" rel="nofollow" target="_blank">${badgeHtml}</a>`;
|
return `<a href="${targetUrl}" rel="nofollow" target="_blank">${badgeHtml}</a>`;
|
||||||
}
|
}
|
||||||
function truncateString(str, maxLength) {
|
function truncateString(str, maxLength) {
|
||||||
|
|||||||
2
dist/dependency-submission/main/index.js.map
vendored
2
dist/dependency-submission/main/index.js.map
vendored
File diff suppressed because one or more lines are too long
42
dist/dependency-submission/post/index.js
vendored
42
dist/dependency-submission/post/index.js
vendored
@@ -96253,6 +96253,9 @@ function handleMainActionError(error) {
|
|||||||
}
|
}
|
||||||
else if (error instanceof JobFailure) {
|
else if (error instanceof JobFailure) {
|
||||||
core.setFailed(String(error));
|
core.setFailed(String(error));
|
||||||
|
if (error.stack) {
|
||||||
|
core.info(error.stack);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core.setFailed(String(error));
|
core.setFailed(String(error));
|
||||||
@@ -96265,6 +96268,9 @@ exports.handleMainActionError = handleMainActionError;
|
|||||||
function handlePostActionError(error) {
|
function handlePostActionError(error) {
|
||||||
if (error instanceof JobFailure) {
|
if (error instanceof JobFailure) {
|
||||||
core.setFailed(String(error));
|
core.setFailed(String(error));
|
||||||
|
if (error.stack) {
|
||||||
|
core.info(error.stack);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core.warning(`Unhandled error in Gradle post-action - job will continue: ${error}`);
|
core.warning(`Unhandled error in Gradle post-action - job will continue: ${error}`);
|
||||||
@@ -96307,7 +96313,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.generateJobSummary = void 0;
|
exports.renderSummaryTable = exports.generateJobSummary = void 0;
|
||||||
const core = __importStar(__nccwpck_require__(2186));
|
const core = __importStar(__nccwpck_require__(2186));
|
||||||
const github = __importStar(__nccwpck_require__(5438));
|
const github = __importStar(__nccwpck_require__(5438));
|
||||||
const request_error_1 = __nccwpck_require__(537);
|
const request_error_1 = __nccwpck_require__(537);
|
||||||
@@ -96379,6 +96385,7 @@ Note that this permission is never available for a workflow triggered from a rep
|
|||||||
function renderSummaryTable(results) {
|
function renderSummaryTable(results) {
|
||||||
return `${renderDeprecations()}\n${renderBuildResults(results)}`;
|
return `${renderDeprecations()}\n${renderBuildResults(results)}`;
|
||||||
}
|
}
|
||||||
|
exports.renderSummaryTable = renderSummaryTable;
|
||||||
function renderDeprecations() {
|
function renderDeprecations() {
|
||||||
const deprecations = (0, deprecation_collector_1.getDeprecations)();
|
const deprecations = (0, deprecation_collector_1.getDeprecations)();
|
||||||
if (deprecations.length === 0) {
|
if (deprecations.length === 0) {
|
||||||
@@ -96407,7 +96414,7 @@ function renderBuildResults(results) {
|
|||||||
<th>Requested Tasks</th>
|
<th>Requested Tasks</th>
|
||||||
<th>Gradle Version</th>
|
<th>Gradle Version</th>
|
||||||
<th>Build Outcome</th>
|
<th>Build Outcome</th>
|
||||||
<th>Build Scan®</th>
|
<th>Build Scan®</th>
|
||||||
</tr>${results.map(result => renderBuildResultRow(result)).join('')}
|
</tr>${results.map(result => renderBuildResultRow(result)).join('')}
|
||||||
</table>
|
</table>
|
||||||
`;
|
`;
|
||||||
@@ -96427,16 +96434,35 @@ function renderOutcome(result) {
|
|||||||
}
|
}
|
||||||
function renderBuildScan(result) {
|
function renderBuildScan(result) {
|
||||||
if (result.buildScanFailed) {
|
if (result.buildScanFailed) {
|
||||||
return renderBuildScanBadge('PUBLISH_FAILED', 'orange', 'https://docs.gradle.com/develocity/gradle-plugin/#troubleshooting');
|
return renderBuildScanBadge({
|
||||||
|
text: 'Publish failed',
|
||||||
|
alt: 'Build Scan publish failed',
|
||||||
|
color: 'orange',
|
||||||
|
logo: false,
|
||||||
|
targetUrl: 'https://docs.gradle.com/develocity/gradle-plugin/#troubleshooting'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (result.buildScanUri) {
|
if (result.buildScanUri) {
|
||||||
return renderBuildScanBadge('PUBLISHED', '06A0CE', result.buildScanUri);
|
return renderBuildScanBadge({
|
||||||
|
text: 'Build Scan®',
|
||||||
|
alt: 'Build Scan published',
|
||||||
|
color: '06A0CE',
|
||||||
|
logo: true,
|
||||||
|
targetUrl: result.buildScanUri
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return renderBuildScanBadge('NOT_PUBLISHED', 'lightgrey', 'https://scans.gradle.com');
|
return renderBuildScanBadge({
|
||||||
|
text: 'Not published',
|
||||||
|
alt: 'Build Scan not published',
|
||||||
|
color: 'lightgrey',
|
||||||
|
logo: false,
|
||||||
|
targetUrl: 'https://scans.gradle.com'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
function renderBuildScanBadge(outcomeText, outcomeColor, targetUrl) {
|
function renderBuildScanBadge({ text, alt, color, logo, targetUrl }) {
|
||||||
const badgeUrl = `https://img.shields.io/badge/Build%20Scan%C2%AE-${outcomeText}-${outcomeColor}?logo=Gradle`;
|
const encodedText = encodeURIComponent(text);
|
||||||
const badgeHtml = `<img src="${badgeUrl}" alt="Build Scan ${outcomeText}" />`;
|
const badgeUrl = `https://img.shields.io/badge/${encodedText}-${color}${logo ? '?logo=Gradle' : ''}`;
|
||||||
|
const badgeHtml = `<img src="${badgeUrl}" alt="${alt}" />`;
|
||||||
return `<a href="${targetUrl}" rel="nofollow" target="_blank">${badgeHtml}</a>`;
|
return `<a href="${targetUrl}" rel="nofollow" target="_blank">${badgeHtml}</a>`;
|
||||||
}
|
}
|
||||||
function truncateString(str, maxLength) {
|
function truncateString(str, maxLength) {
|
||||||
|
|||||||
2
dist/dependency-submission/post/index.js.map
vendored
2
dist/dependency-submission/post/index.js.map
vendored
File diff suppressed because one or more lines are too long
51
dist/setup-gradle/main/index.js
vendored
51
dist/setup-gradle/main/index.js
vendored
@@ -144686,6 +144686,7 @@ async function setup(config) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (option === configuration_1.DependencyGraphOption.DownloadAndSubmit) {
|
if (option === configuration_1.DependencyGraphOption.DownloadAndSubmit) {
|
||||||
|
maybeExportVariable('DEPENDENCY_GRAPH_REPORT_DIR', config.getReportDirectory());
|
||||||
await downloadAndSubmitDependencyGraphs(config);
|
await downloadAndSubmitDependencyGraphs(config);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -144779,17 +144780,15 @@ async function submitDependencyGraphs(dependencyGraphFiles) {
|
|||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
if (error instanceof request_error_1.RequestError) {
|
if (error instanceof request_error_1.RequestError) {
|
||||||
throw new Error(translateErrorMessage(dependencyGraphFile, error));
|
error.message = translateErrorMessage(dependencyGraphFile, error);
|
||||||
}
|
|
||||||
else {
|
|
||||||
throw error;
|
|
||||||
}
|
}
|
||||||
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function translateErrorMessage(jsonFile, error) {
|
function translateErrorMessage(jsonFile, error) {
|
||||||
const relativeJsonFile = getRelativePathFromWorkspace(jsonFile);
|
const relativeJsonFile = getRelativePathFromWorkspace(jsonFile);
|
||||||
const mainWarning = `Dependency submission failed for ${relativeJsonFile}.\n${String(error)}`;
|
const mainWarning = `Dependency submission failed for ${relativeJsonFile}.\n${error.message}`;
|
||||||
if (error.message === 'Resource not accessible by integration') {
|
if (error.message === 'Resource not accessible by integration') {
|
||||||
return `${mainWarning}
|
return `${mainWarning}
|
||||||
Please ensure that the 'contents: write' permission is available for the workflow job.
|
Please ensure that the 'contents: write' permission is available for the workflow job.
|
||||||
@@ -145025,6 +145024,9 @@ function handleMainActionError(error) {
|
|||||||
}
|
}
|
||||||
else if (error instanceof JobFailure) {
|
else if (error instanceof JobFailure) {
|
||||||
core.setFailed(String(error));
|
core.setFailed(String(error));
|
||||||
|
if (error.stack) {
|
||||||
|
core.info(error.stack);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core.setFailed(String(error));
|
core.setFailed(String(error));
|
||||||
@@ -145037,6 +145039,9 @@ exports.handleMainActionError = handleMainActionError;
|
|||||||
function handlePostActionError(error) {
|
function handlePostActionError(error) {
|
||||||
if (error instanceof JobFailure) {
|
if (error instanceof JobFailure) {
|
||||||
core.setFailed(String(error));
|
core.setFailed(String(error));
|
||||||
|
if (error.stack) {
|
||||||
|
core.info(error.stack);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core.warning(`Unhandled error in Gradle post-action - job will continue: ${error}`);
|
core.warning(`Unhandled error in Gradle post-action - job will continue: ${error}`);
|
||||||
@@ -145388,7 +145393,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.generateJobSummary = void 0;
|
exports.renderSummaryTable = exports.generateJobSummary = void 0;
|
||||||
const core = __importStar(__nccwpck_require__(42186));
|
const core = __importStar(__nccwpck_require__(42186));
|
||||||
const github = __importStar(__nccwpck_require__(95438));
|
const github = __importStar(__nccwpck_require__(95438));
|
||||||
const request_error_1 = __nccwpck_require__(10537);
|
const request_error_1 = __nccwpck_require__(10537);
|
||||||
@@ -145460,6 +145465,7 @@ Note that this permission is never available for a workflow triggered from a rep
|
|||||||
function renderSummaryTable(results) {
|
function renderSummaryTable(results) {
|
||||||
return `${renderDeprecations()}\n${renderBuildResults(results)}`;
|
return `${renderDeprecations()}\n${renderBuildResults(results)}`;
|
||||||
}
|
}
|
||||||
|
exports.renderSummaryTable = renderSummaryTable;
|
||||||
function renderDeprecations() {
|
function renderDeprecations() {
|
||||||
const deprecations = (0, deprecation_collector_1.getDeprecations)();
|
const deprecations = (0, deprecation_collector_1.getDeprecations)();
|
||||||
if (deprecations.length === 0) {
|
if (deprecations.length === 0) {
|
||||||
@@ -145488,7 +145494,7 @@ function renderBuildResults(results) {
|
|||||||
<th>Requested Tasks</th>
|
<th>Requested Tasks</th>
|
||||||
<th>Gradle Version</th>
|
<th>Gradle Version</th>
|
||||||
<th>Build Outcome</th>
|
<th>Build Outcome</th>
|
||||||
<th>Build Scan®</th>
|
<th>Build Scan®</th>
|
||||||
</tr>${results.map(result => renderBuildResultRow(result)).join('')}
|
</tr>${results.map(result => renderBuildResultRow(result)).join('')}
|
||||||
</table>
|
</table>
|
||||||
`;
|
`;
|
||||||
@@ -145508,16 +145514,35 @@ function renderOutcome(result) {
|
|||||||
}
|
}
|
||||||
function renderBuildScan(result) {
|
function renderBuildScan(result) {
|
||||||
if (result.buildScanFailed) {
|
if (result.buildScanFailed) {
|
||||||
return renderBuildScanBadge('PUBLISH_FAILED', 'orange', 'https://docs.gradle.com/develocity/gradle-plugin/#troubleshooting');
|
return renderBuildScanBadge({
|
||||||
|
text: 'Publish failed',
|
||||||
|
alt: 'Build Scan publish failed',
|
||||||
|
color: 'orange',
|
||||||
|
logo: false,
|
||||||
|
targetUrl: 'https://docs.gradle.com/develocity/gradle-plugin/#troubleshooting'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (result.buildScanUri) {
|
if (result.buildScanUri) {
|
||||||
return renderBuildScanBadge('PUBLISHED', '06A0CE', result.buildScanUri);
|
return renderBuildScanBadge({
|
||||||
|
text: 'Build Scan®',
|
||||||
|
alt: 'Build Scan published',
|
||||||
|
color: '06A0CE',
|
||||||
|
logo: true,
|
||||||
|
targetUrl: result.buildScanUri
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return renderBuildScanBadge('NOT_PUBLISHED', 'lightgrey', 'https://scans.gradle.com');
|
return renderBuildScanBadge({
|
||||||
|
text: 'Not published',
|
||||||
|
alt: 'Build Scan not published',
|
||||||
|
color: 'lightgrey',
|
||||||
|
logo: false,
|
||||||
|
targetUrl: 'https://scans.gradle.com'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
function renderBuildScanBadge(outcomeText, outcomeColor, targetUrl) {
|
function renderBuildScanBadge({ text, alt, color, logo, targetUrl }) {
|
||||||
const badgeUrl = `https://img.shields.io/badge/Build%20Scan%C2%AE-${outcomeText}-${outcomeColor}?logo=Gradle`;
|
const encodedText = encodeURIComponent(text);
|
||||||
const badgeHtml = `<img src="${badgeUrl}" alt="Build Scan ${outcomeText}" />`;
|
const badgeUrl = `https://img.shields.io/badge/${encodedText}-${color}${logo ? '?logo=Gradle' : ''}`;
|
||||||
|
const badgeHtml = `<img src="${badgeUrl}" alt="${alt}" />`;
|
||||||
return `<a href="${targetUrl}" rel="nofollow" target="_blank">${badgeHtml}</a>`;
|
return `<a href="${targetUrl}" rel="nofollow" target="_blank">${badgeHtml}</a>`;
|
||||||
}
|
}
|
||||||
function truncateString(str, maxLength) {
|
function truncateString(str, maxLength) {
|
||||||
|
|||||||
2
dist/setup-gradle/main/index.js.map
vendored
2
dist/setup-gradle/main/index.js.map
vendored
File diff suppressed because one or more lines are too long
51
dist/setup-gradle/post/index.js
vendored
51
dist/setup-gradle/post/index.js
vendored
@@ -142139,6 +142139,7 @@ async function setup(config) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (option === configuration_1.DependencyGraphOption.DownloadAndSubmit) {
|
if (option === configuration_1.DependencyGraphOption.DownloadAndSubmit) {
|
||||||
|
maybeExportVariable('DEPENDENCY_GRAPH_REPORT_DIR', config.getReportDirectory());
|
||||||
await downloadAndSubmitDependencyGraphs(config);
|
await downloadAndSubmitDependencyGraphs(config);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -142232,17 +142233,15 @@ async function submitDependencyGraphs(dependencyGraphFiles) {
|
|||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
if (error instanceof request_error_1.RequestError) {
|
if (error instanceof request_error_1.RequestError) {
|
||||||
throw new Error(translateErrorMessage(dependencyGraphFile, error));
|
error.message = translateErrorMessage(dependencyGraphFile, error);
|
||||||
}
|
|
||||||
else {
|
|
||||||
throw error;
|
|
||||||
}
|
}
|
||||||
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function translateErrorMessage(jsonFile, error) {
|
function translateErrorMessage(jsonFile, error) {
|
||||||
const relativeJsonFile = getRelativePathFromWorkspace(jsonFile);
|
const relativeJsonFile = getRelativePathFromWorkspace(jsonFile);
|
||||||
const mainWarning = `Dependency submission failed for ${relativeJsonFile}.\n${String(error)}`;
|
const mainWarning = `Dependency submission failed for ${relativeJsonFile}.\n${error.message}`;
|
||||||
if (error.message === 'Resource not accessible by integration') {
|
if (error.message === 'Resource not accessible by integration') {
|
||||||
return `${mainWarning}
|
return `${mainWarning}
|
||||||
Please ensure that the 'contents: write' permission is available for the workflow job.
|
Please ensure that the 'contents: write' permission is available for the workflow job.
|
||||||
@@ -142478,6 +142477,9 @@ function handleMainActionError(error) {
|
|||||||
}
|
}
|
||||||
else if (error instanceof JobFailure) {
|
else if (error instanceof JobFailure) {
|
||||||
core.setFailed(String(error));
|
core.setFailed(String(error));
|
||||||
|
if (error.stack) {
|
||||||
|
core.info(error.stack);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core.setFailed(String(error));
|
core.setFailed(String(error));
|
||||||
@@ -142490,6 +142492,9 @@ exports.handleMainActionError = handleMainActionError;
|
|||||||
function handlePostActionError(error) {
|
function handlePostActionError(error) {
|
||||||
if (error instanceof JobFailure) {
|
if (error instanceof JobFailure) {
|
||||||
core.setFailed(String(error));
|
core.setFailed(String(error));
|
||||||
|
if (error.stack) {
|
||||||
|
core.info(error.stack);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core.warning(`Unhandled error in Gradle post-action - job will continue: ${error}`);
|
core.warning(`Unhandled error in Gradle post-action - job will continue: ${error}`);
|
||||||
@@ -142532,7 +142537,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.generateJobSummary = void 0;
|
exports.renderSummaryTable = exports.generateJobSummary = void 0;
|
||||||
const core = __importStar(__nccwpck_require__(42186));
|
const core = __importStar(__nccwpck_require__(42186));
|
||||||
const github = __importStar(__nccwpck_require__(95438));
|
const github = __importStar(__nccwpck_require__(95438));
|
||||||
const request_error_1 = __nccwpck_require__(10537);
|
const request_error_1 = __nccwpck_require__(10537);
|
||||||
@@ -142604,6 +142609,7 @@ Note that this permission is never available for a workflow triggered from a rep
|
|||||||
function renderSummaryTable(results) {
|
function renderSummaryTable(results) {
|
||||||
return `${renderDeprecations()}\n${renderBuildResults(results)}`;
|
return `${renderDeprecations()}\n${renderBuildResults(results)}`;
|
||||||
}
|
}
|
||||||
|
exports.renderSummaryTable = renderSummaryTable;
|
||||||
function renderDeprecations() {
|
function renderDeprecations() {
|
||||||
const deprecations = (0, deprecation_collector_1.getDeprecations)();
|
const deprecations = (0, deprecation_collector_1.getDeprecations)();
|
||||||
if (deprecations.length === 0) {
|
if (deprecations.length === 0) {
|
||||||
@@ -142632,7 +142638,7 @@ function renderBuildResults(results) {
|
|||||||
<th>Requested Tasks</th>
|
<th>Requested Tasks</th>
|
||||||
<th>Gradle Version</th>
|
<th>Gradle Version</th>
|
||||||
<th>Build Outcome</th>
|
<th>Build Outcome</th>
|
||||||
<th>Build Scan®</th>
|
<th>Build Scan®</th>
|
||||||
</tr>${results.map(result => renderBuildResultRow(result)).join('')}
|
</tr>${results.map(result => renderBuildResultRow(result)).join('')}
|
||||||
</table>
|
</table>
|
||||||
`;
|
`;
|
||||||
@@ -142652,16 +142658,35 @@ function renderOutcome(result) {
|
|||||||
}
|
}
|
||||||
function renderBuildScan(result) {
|
function renderBuildScan(result) {
|
||||||
if (result.buildScanFailed) {
|
if (result.buildScanFailed) {
|
||||||
return renderBuildScanBadge('PUBLISH_FAILED', 'orange', 'https://docs.gradle.com/develocity/gradle-plugin/#troubleshooting');
|
return renderBuildScanBadge({
|
||||||
|
text: 'Publish failed',
|
||||||
|
alt: 'Build Scan publish failed',
|
||||||
|
color: 'orange',
|
||||||
|
logo: false,
|
||||||
|
targetUrl: 'https://docs.gradle.com/develocity/gradle-plugin/#troubleshooting'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (result.buildScanUri) {
|
if (result.buildScanUri) {
|
||||||
return renderBuildScanBadge('PUBLISHED', '06A0CE', result.buildScanUri);
|
return renderBuildScanBadge({
|
||||||
|
text: 'Build Scan®',
|
||||||
|
alt: 'Build Scan published',
|
||||||
|
color: '06A0CE',
|
||||||
|
logo: true,
|
||||||
|
targetUrl: result.buildScanUri
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return renderBuildScanBadge('NOT_PUBLISHED', 'lightgrey', 'https://scans.gradle.com');
|
return renderBuildScanBadge({
|
||||||
|
text: 'Not published',
|
||||||
|
alt: 'Build Scan not published',
|
||||||
|
color: 'lightgrey',
|
||||||
|
logo: false,
|
||||||
|
targetUrl: 'https://scans.gradle.com'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
function renderBuildScanBadge(outcomeText, outcomeColor, targetUrl) {
|
function renderBuildScanBadge({ text, alt, color, logo, targetUrl }) {
|
||||||
const badgeUrl = `https://img.shields.io/badge/Build%20Scan%C2%AE-${outcomeText}-${outcomeColor}?logo=Gradle`;
|
const encodedText = encodeURIComponent(text);
|
||||||
const badgeHtml = `<img src="${badgeUrl}" alt="Build Scan ${outcomeText}" />`;
|
const badgeUrl = `https://img.shields.io/badge/${encodedText}-${color}${logo ? '?logo=Gradle' : ''}`;
|
||||||
|
const badgeHtml = `<img src="${badgeUrl}" alt="${alt}" />`;
|
||||||
return `<a href="${targetUrl}" rel="nofollow" target="_blank">${badgeHtml}</a>`;
|
return `<a href="${targetUrl}" rel="nofollow" target="_blank">${badgeHtml}</a>`;
|
||||||
}
|
}
|
||||||
function truncateString(str, maxLength) {
|
function truncateString(str, maxLength) {
|
||||||
|
|||||||
2
dist/setup-gradle/post/index.js.map
vendored
2
dist/setup-gradle/post/index.js.map
vendored
File diff suppressed because one or more lines are too long
6
dist/wrapper-validation/main/index.js
vendored
6
dist/wrapper-validation/main/index.js
vendored
@@ -90294,6 +90294,9 @@ function handleMainActionError(error) {
|
|||||||
}
|
}
|
||||||
else if (error instanceof JobFailure) {
|
else if (error instanceof JobFailure) {
|
||||||
core.setFailed(String(error));
|
core.setFailed(String(error));
|
||||||
|
if (error.stack) {
|
||||||
|
core.info(error.stack);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core.setFailed(String(error));
|
core.setFailed(String(error));
|
||||||
@@ -90306,6 +90309,9 @@ exports.handleMainActionError = handleMainActionError;
|
|||||||
function handlePostActionError(error) {
|
function handlePostActionError(error) {
|
||||||
if (error instanceof JobFailure) {
|
if (error instanceof JobFailure) {
|
||||||
core.setFailed(String(error));
|
core.setFailed(String(error));
|
||||||
|
if (error.stack) {
|
||||||
|
core.info(error.stack);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core.warning(`Unhandled error in Gradle post-action - job will continue: ${error}`);
|
core.warning(`Unhandled error in Gradle post-action - job will continue: ${error}`);
|
||||||
|
|||||||
2
dist/wrapper-validation/main/index.js.map
vendored
2
dist/wrapper-validation/main/index.js.map
vendored
File diff suppressed because one or more lines are too long
@@ -22,6 +22,7 @@ export async function setup(config: DependencyGraphConfig): Promise<void> {
|
|||||||
}
|
}
|
||||||
// Download and submit early, for compatability with dependency review.
|
// Download and submit early, for compatability with dependency review.
|
||||||
if (option === DependencyGraphOption.DownloadAndSubmit) {
|
if (option === DependencyGraphOption.DownloadAndSubmit) {
|
||||||
|
maybeExportVariable('DEPENDENCY_GRAPH_REPORT_DIR', config.getReportDirectory())
|
||||||
await downloadAndSubmitDependencyGraphs(config)
|
await downloadAndSubmitDependencyGraphs(config)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -124,17 +125,16 @@ async function submitDependencyGraphs(dependencyGraphFiles: string[]): Promise<v
|
|||||||
await submitDependencyGraphFile(dependencyGraphFile)
|
await submitDependencyGraphFile(dependencyGraphFile)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error instanceof RequestError) {
|
if (error instanceof RequestError) {
|
||||||
throw new Error(translateErrorMessage(dependencyGraphFile, error))
|
error.message = translateErrorMessage(dependencyGraphFile, error)
|
||||||
} else {
|
|
||||||
throw error
|
|
||||||
}
|
}
|
||||||
|
throw error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function translateErrorMessage(jsonFile: string, error: RequestError): string {
|
function translateErrorMessage(jsonFile: string, error: RequestError): string {
|
||||||
const relativeJsonFile = getRelativePathFromWorkspace(jsonFile)
|
const relativeJsonFile = getRelativePathFromWorkspace(jsonFile)
|
||||||
const mainWarning = `Dependency submission failed for ${relativeJsonFile}.\n${String(error)}`
|
const mainWarning = `Dependency submission failed for ${relativeJsonFile}.\n${error.message}`
|
||||||
if (error.message === 'Resource not accessible by integration') {
|
if (error.message === 'Resource not accessible by integration') {
|
||||||
return `${mainWarning}
|
return `${mainWarning}
|
||||||
Please ensure that the 'contents: write' permission is available for the workflow job.
|
Please ensure that the 'contents: write' permission is available for the workflow job.
|
||||||
|
|||||||
@@ -22,7 +22,10 @@ export function handleMainActionError(error: unknown): void {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (error instanceof JobFailure) {
|
} else if (error instanceof JobFailure) {
|
||||||
core.setFailed(String(error)) // No stack trace for JobFailure: these are known errors
|
core.setFailed(String(error))
|
||||||
|
if (error.stack) {
|
||||||
|
core.info(error.stack)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
core.setFailed(String(error))
|
core.setFailed(String(error))
|
||||||
if (error instanceof Error && error.stack) {
|
if (error instanceof Error && error.stack) {
|
||||||
@@ -34,6 +37,9 @@ export function handleMainActionError(error: unknown): void {
|
|||||||
export function handlePostActionError(error: unknown): void {
|
export function handlePostActionError(error: unknown): void {
|
||||||
if (error instanceof JobFailure) {
|
if (error instanceof JobFailure) {
|
||||||
core.setFailed(String(error))
|
core.setFailed(String(error))
|
||||||
|
if (error.stack) {
|
||||||
|
core.info(error.stack)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
core.warning(`Unhandled error in Gradle post-action - job will continue: ${error}`)
|
core.warning(`Unhandled error in Gradle post-action - job will continue: ${error}`)
|
||||||
if (error instanceof Error && error.stack) {
|
if (error instanceof Error && error.stack) {
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ Note that this permission is never available for a workflow triggered from a rep
|
|||||||
return mainWarning
|
return mainWarning
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderSummaryTable(results: BuildResult[]): string {
|
export function renderSummaryTable(results: BuildResult[]): string {
|
||||||
return `${renderDeprecations()}\n${renderBuildResults(results)}`
|
return `${renderDeprecations()}\n${renderBuildResults(results)}`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,7 +113,7 @@ function renderBuildResults(results: BuildResult[]): string {
|
|||||||
<th>Requested Tasks</th>
|
<th>Requested Tasks</th>
|
||||||
<th>Gradle Version</th>
|
<th>Gradle Version</th>
|
||||||
<th>Build Outcome</th>
|
<th>Build Outcome</th>
|
||||||
<th>Build Scan®</th>
|
<th>Build Scan®</th>
|
||||||
</tr>${results.map(result => renderBuildResultRow(result)).join('')}
|
</tr>${results.map(result => renderBuildResultRow(result)).join('')}
|
||||||
</table>
|
</table>
|
||||||
`
|
`
|
||||||
@@ -134,23 +134,46 @@ function renderOutcome(result: BuildResult): string {
|
|||||||
return result.buildFailed ? ':x:' : ':white_check_mark:'
|
return result.buildFailed ? ':x:' : ':white_check_mark:'
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderBuildScan(result: BuildResult): string {
|
interface BadgeSpec {
|
||||||
if (result.buildScanFailed) {
|
text: string
|
||||||
return renderBuildScanBadge(
|
alt: string
|
||||||
'PUBLISH_FAILED',
|
color: string
|
||||||
'orange',
|
logo: boolean
|
||||||
'https://docs.gradle.com/develocity/gradle-plugin/#troubleshooting'
|
targetUrl: string
|
||||||
)
|
|
||||||
}
|
|
||||||
if (result.buildScanUri) {
|
|
||||||
return renderBuildScanBadge('PUBLISHED', '06A0CE', result.buildScanUri)
|
|
||||||
}
|
|
||||||
return renderBuildScanBadge('NOT_PUBLISHED', 'lightgrey', 'https://scans.gradle.com')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderBuildScanBadge(outcomeText: string, outcomeColor: string, targetUrl: string): string {
|
function renderBuildScan(result: BuildResult): string {
|
||||||
const badgeUrl = `https://img.shields.io/badge/Build%20Scan%C2%AE-${outcomeText}-${outcomeColor}?logo=Gradle`
|
if (result.buildScanFailed) {
|
||||||
const badgeHtml = `<img src="${badgeUrl}" alt="Build Scan ${outcomeText}" />`
|
return renderBuildScanBadge({
|
||||||
|
text: 'Publish failed',
|
||||||
|
alt: 'Build Scan publish failed',
|
||||||
|
color: 'orange',
|
||||||
|
logo: false,
|
||||||
|
targetUrl: 'https://docs.gradle.com/develocity/gradle-plugin/#troubleshooting'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (result.buildScanUri) {
|
||||||
|
return renderBuildScanBadge({
|
||||||
|
text: 'Build Scan®',
|
||||||
|
alt: 'Build Scan published',
|
||||||
|
color: '06A0CE',
|
||||||
|
logo: true,
|
||||||
|
targetUrl: result.buildScanUri
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return renderBuildScanBadge({
|
||||||
|
text: 'Not published',
|
||||||
|
alt: 'Build Scan not published',
|
||||||
|
color: 'lightgrey',
|
||||||
|
logo: false,
|
||||||
|
targetUrl: 'https://scans.gradle.com'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderBuildScanBadge({text, alt, color, logo, targetUrl}: BadgeSpec): string {
|
||||||
|
const encodedText = encodeURIComponent(text)
|
||||||
|
const badgeUrl = `https://img.shields.io/badge/${encodedText}-${color}${logo ? '?logo=Gradle' : ''}`
|
||||||
|
const badgeHtml = `<img src="${badgeUrl}" alt="${alt}" />`
|
||||||
return `<a href="${targetUrl}" rel="nofollow" target="_blank">${badgeHtml}</a>`
|
return `<a href="${targetUrl}" rel="nofollow" target="_blank">${badgeHtml}</a>`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ if (gradleVersion < GradleVersion.version("5.2") ||
|
|||||||
if (getVariable('GITHUB_DEPENDENCY_GRAPH_CONTINUE_ON_FAILURE') != "true") {
|
if (getVariable('GITHUB_DEPENDENCY_GRAPH_CONTINUE_ON_FAILURE') != "true") {
|
||||||
throw new GradleException("Dependency Graph is not supported for ${gradleVersion}. No dependency snapshot will be generated.")
|
throw new GradleException("Dependency Graph is not supported for ${gradleVersion}. No dependency snapshot will be generated.")
|
||||||
}
|
}
|
||||||
println "::warning::Dependency Graph is not supported for ${gradleVersion}. No dependency snapshot will be generated."
|
logger.warn("::warning::Dependency Graph is not supported for ${gradleVersion}. No dependency snapshot will be generated.")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -23,11 +23,11 @@ if (isTopLevelBuild) {
|
|||||||
def reportFile = getUniqueReportFile(getVariable('GITHUB_DEPENDENCY_GRAPH_JOB_CORRELATOR'))
|
def reportFile = getUniqueReportFile(getVariable('GITHUB_DEPENDENCY_GRAPH_JOB_CORRELATOR'))
|
||||||
|
|
||||||
if (reportFile == null) {
|
if (reportFile == null) {
|
||||||
println "::warning::No dependency snapshot generated for step. Could not determine unique job correlator - specify GITHUB_DEPENDENCY_GRAPH_JOB_CORRELATOR var for this step."
|
logger.warn("::warning::No dependency snapshot generated for step. Could not determine unique job correlator - specify GITHUB_DEPENDENCY_GRAPH_JOB_CORRELATOR var for this step.")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
println "Generating dependency graph into '${reportFile}'"
|
logger.lifecycle("Generating dependency graph into '${reportFile}'")
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: 'gradle-actions.github-dependency-graph-gradle-plugin-apply.groovy'
|
apply from: 'gradle-actions.github-dependency-graph-gradle-plugin-apply.groovy'
|
||||||
|
|||||||
177
sources/test/jest/job-summary.test.ts
Normal file
177
sources/test/jest/job-summary.test.ts
Normal file
@@ -0,0 +1,177 @@
|
|||||||
|
import { BuildResult } from '../../src/build-results'
|
||||||
|
import { renderSummaryTable } from '../../src/job-summary'
|
||||||
|
import dedent from 'dedent'
|
||||||
|
|
||||||
|
|
||||||
|
const successfulHelpBuild: BuildResult = {
|
||||||
|
rootProjectName: 'root',
|
||||||
|
rootProjectDir: '/',
|
||||||
|
requestedTasks: 'help',
|
||||||
|
gradleVersion: '8.0',
|
||||||
|
gradleHomeDir: '/opt/gradle',
|
||||||
|
buildFailed: false,
|
||||||
|
buildScanUri: 'https://scans.gradle.com/s/abc123',
|
||||||
|
buildScanFailed: false
|
||||||
|
}
|
||||||
|
|
||||||
|
const failedHelpBuild: BuildResult = {
|
||||||
|
...successfulHelpBuild,
|
||||||
|
buildFailed: true
|
||||||
|
}
|
||||||
|
|
||||||
|
const longArgsBuild: BuildResult = {
|
||||||
|
...successfulHelpBuild,
|
||||||
|
requestedTasks: 'check publishMyLongNamePluginPublicationToMavenCentral publishMyLongNamePluginPublicationToPluginPortal',
|
||||||
|
}
|
||||||
|
|
||||||
|
const scanPublishDisabledBuild: BuildResult = {
|
||||||
|
...successfulHelpBuild,
|
||||||
|
buildScanUri: '',
|
||||||
|
buildScanFailed: false,
|
||||||
|
}
|
||||||
|
|
||||||
|
const scanPublishFailedBuild: BuildResult = {
|
||||||
|
...successfulHelpBuild,
|
||||||
|
buildScanUri: '',
|
||||||
|
buildScanFailed: true,
|
||||||
|
}
|
||||||
|
|
||||||
|
describe('renderSummaryTable', () => {
|
||||||
|
describe('renders', () => {
|
||||||
|
it('successful build', () => {
|
||||||
|
const table = renderSummaryTable([successfulHelpBuild])
|
||||||
|
expect(table.trim()).toBe(dedent`
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th>Gradle Root Project</th>
|
||||||
|
<th>Requested Tasks</th>
|
||||||
|
<th>Gradle Version</th>
|
||||||
|
<th>Build Outcome</th>
|
||||||
|
<th>Build Scan®</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>root</td>
|
||||||
|
<td>help</td>
|
||||||
|
<td align='center'>8.0</td>
|
||||||
|
<td align='center'>:white_check_mark:</td>
|
||||||
|
<td><a href="https://scans.gradle.com/s/abc123" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Build%20Scan%C2%AE-06A0CE?logo=Gradle" alt="Build Scan published" /></a></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
`);
|
||||||
|
})
|
||||||
|
it('failed build', () => {
|
||||||
|
const table = renderSummaryTable([failedHelpBuild])
|
||||||
|
expect(table.trim()).toBe(dedent`
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th>Gradle Root Project</th>
|
||||||
|
<th>Requested Tasks</th>
|
||||||
|
<th>Gradle Version</th>
|
||||||
|
<th>Build Outcome</th>
|
||||||
|
<th>Build Scan®</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>root</td>
|
||||||
|
<td>help</td>
|
||||||
|
<td align='center'>8.0</td>
|
||||||
|
<td align='center'>:x:</td>
|
||||||
|
<td><a href="https://scans.gradle.com/s/abc123" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Build%20Scan%C2%AE-06A0CE?logo=Gradle" alt="Build Scan published" /></a></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
`);
|
||||||
|
})
|
||||||
|
describe('when build scan', () => {
|
||||||
|
it('publishing disabled', () => {
|
||||||
|
const table = renderSummaryTable([scanPublishDisabledBuild])
|
||||||
|
expect(table.trim()).toBe(dedent`
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th>Gradle Root Project</th>
|
||||||
|
<th>Requested Tasks</th>
|
||||||
|
<th>Gradle Version</th>
|
||||||
|
<th>Build Outcome</th>
|
||||||
|
<th>Build Scan®</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>root</td>
|
||||||
|
<td>help</td>
|
||||||
|
<td align='center'>8.0</td>
|
||||||
|
<td align='center'>:white_check_mark:</td>
|
||||||
|
<td><a href="https://scans.gradle.com" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Not%20published-lightgrey" alt="Build Scan not published" /></a></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
`);
|
||||||
|
})
|
||||||
|
it('publishing failed', () => {
|
||||||
|
const table = renderSummaryTable([scanPublishFailedBuild])
|
||||||
|
expect(table.trim()).toBe(dedent`
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th>Gradle Root Project</th>
|
||||||
|
<th>Requested Tasks</th>
|
||||||
|
<th>Gradle Version</th>
|
||||||
|
<th>Build Outcome</th>
|
||||||
|
<th>Build Scan®</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>root</td>
|
||||||
|
<td>help</td>
|
||||||
|
<td align='center'>8.0</td>
|
||||||
|
<td align='center'>:white_check_mark:</td>
|
||||||
|
<td><a href="https://docs.gradle.com/develocity/gradle-plugin/#troubleshooting" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Publish%20failed-orange" alt="Build Scan publish failed" /></a></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
`);
|
||||||
|
})
|
||||||
|
})
|
||||||
|
it('multiple builds', () => {
|
||||||
|
const table = renderSummaryTable([successfulHelpBuild, failedHelpBuild])
|
||||||
|
expect(table.trim()).toBe(dedent`
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th>Gradle Root Project</th>
|
||||||
|
<th>Requested Tasks</th>
|
||||||
|
<th>Gradle Version</th>
|
||||||
|
<th>Build Outcome</th>
|
||||||
|
<th>Build Scan®</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>root</td>
|
||||||
|
<td>help</td>
|
||||||
|
<td align='center'>8.0</td>
|
||||||
|
<td align='center'>:white_check_mark:</td>
|
||||||
|
<td><a href="https://scans.gradle.com/s/abc123" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Build%20Scan%C2%AE-06A0CE?logo=Gradle" alt="Build Scan published" /></a></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>root</td>
|
||||||
|
<td>help</td>
|
||||||
|
<td align='center'>8.0</td>
|
||||||
|
<td align='center'>:x:</td>
|
||||||
|
<td><a href="https://scans.gradle.com/s/abc123" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Build%20Scan%C2%AE-06A0CE?logo=Gradle" alt="Build Scan published" /></a></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
`);
|
||||||
|
})
|
||||||
|
it('truncating long requested tasks', () => {
|
||||||
|
const table = renderSummaryTable([longArgsBuild])
|
||||||
|
expect(table.trim()).toBe(dedent`
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th>Gradle Root Project</th>
|
||||||
|
<th>Requested Tasks</th>
|
||||||
|
<th>Gradle Version</th>
|
||||||
|
<th>Build Outcome</th>
|
||||||
|
<th>Build Scan®</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>root</td>
|
||||||
|
<td><div title='check publishMyLongNamePluginPublicationToMavenCentral publishMyLongNamePluginPublicationToPluginPortal'>check publishMyLongNamePluginPublicationToMavenCentral publ…</div></td>
|
||||||
|
<td align='center'>8.0</td>
|
||||||
|
<td align='center'>:white_check_mark:</td>
|
||||||
|
<td><a href="https://scans.gradle.com/s/abc123" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Build%20Scan%C2%AE-06A0CE?logo=Gradle" alt="Build Scan published" /></a></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
`);
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user