From 272e4c84fd96e9dae40c558c9d87e5c77b98ebb4 Mon Sep 17 00:00:00 2001 From: Sophia Guo Date: Tue, 17 Nov 2020 15:02:59 -0500 Subject: [PATCH] Updates 1. Updates dependencies 2. Update action output description 3. Update workflow files 4. Delete old workflow files Signed-off-by: Sophia Guo --- .../workflows/NightlyJDK14BuildAndTest.yml | 49 ----- .github/workflows/NightlyJDK8BuildAndTest.yml | 50 ----- ...ghtlyJDK11BuildAndTest.yml => nightly.yml} | 27 ++- .github/workflows/test.yml | 40 ---- action.yml | 3 +- dist/index.js | 176 +++++++++++++++--- package-lock.json | 6 +- 7 files changed, 165 insertions(+), 186 deletions(-) delete mode 100644 .github/workflows/NightlyJDK14BuildAndTest.yml delete mode 100644 .github/workflows/NightlyJDK8BuildAndTest.yml rename .github/workflows/{NightlyJDK11BuildAndTest.yml => nightly.yml} (73%) delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/NightlyJDK14BuildAndTest.yml b/.github/workflows/NightlyJDK14BuildAndTest.yml deleted file mode 100644 index 308d8b5..0000000 --- a/.github/workflows/NightlyJDK14BuildAndTest.yml +++ /dev/null @@ -1,49 +0,0 @@ -############################################################################### -# Copyright (c) 2020, 2020 IBM Corp. and others -# -# This program and the accompanying materials are made available under -# the terms of the Eclipse Public License 2.0 which accompanies this -# distribution and is available at https://www.eclipse.org/legal/epl-2.0/ -# or the Apache License, Version 2.0 which accompanies this distribution and -# is available at https://www.apache.org/licenses/LICENSE-2.0. -# -# This Source Code may also be made available under the following -# Secondary Licenses when the conditions for such availability set -# forth in the Eclipse Public License, v. 2.0 are satisfied: GNU -# General Public License, version 2 with the GNU Classpath -# Exception [1] and GNU General Public License, version 2 with the -# OpenJDK Assembly Exception [2]. -# -# [1] https://www.gnu.org/software/classpath/license.html -# [2] http://openjdk.java.net/legal/assembly-exception.html -# -# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception -############################################################################### -name: "nightly build-openj9 jdk 14" -on: - schedule: - - cron: '30 21 * * 1-5' -jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-16.04, macos-10.15] - steps: - - uses: eclipse/build-openj9@v1 - id: buildJDK - with: - version: 14 - - name: AQA - uses: AdoptOpenJDK/run-aqa@v1 - env: - TEST_JDK_HOME: ${{ steps.buildJDK.outputs.BuildJDKDir }} - with: - build_list: 'functional' - target: '_sanity' - - uses: actions/upload-artifact@v2 - if: failure() - with: - name: test_output - path: ./**/test_output_*/ diff --git a/.github/workflows/NightlyJDK8BuildAndTest.yml b/.github/workflows/NightlyJDK8BuildAndTest.yml deleted file mode 100644 index d4ec850..0000000 --- a/.github/workflows/NightlyJDK8BuildAndTest.yml +++ /dev/null @@ -1,50 +0,0 @@ -############################################################################### -# Copyright (c) 2020, 2020 IBM Corp. and others -# -# This program and the accompanying materials are made available under -# the terms of the Eclipse Public License 2.0 which accompanies this -# distribution and is available at https://www.eclipse.org/legal/epl-2.0/ -# or the Apache License, Version 2.0 which accompanies this distribution and -# is available at https://www.apache.org/licenses/LICENSE-2.0. -# -# This Source Code may also be made available under the following -# Secondary Licenses when the conditions for such availability set -# forth in the Eclipse Public License, v. 2.0 are satisfied: GNU -# General Public License, version 2 with the GNU Classpath -# Exception [1] and GNU General Public License, version 2 with the -# OpenJDK Assembly Exception [2]. -# -# [1] https://www.gnu.org/software/classpath/license.html -# [2] http://openjdk.java.net/legal/assembly-exception.html -# -# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception -############################################################################### -name: "nightly build-openj9 jdk 8" -on: - schedule: - - cron: '30 21 * * 1-5' - -jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-16.04] - steps: - - uses: eclipse/build-openj9@v1 - id: buildJDK - with: - version: 8 - - name: AQA - uses: AdoptOpenJDK/run-aqa@v1 - env: - TEST_JDK_HOME: ${{ steps.buildJDK.outputs.BuildJDKDir }} - with: - build_list: 'functional' - target: '_sanity' - - uses: actions/upload-artifact@v2 - if: failure() - with: - name: test_output - path: ./**/test_output_*/ diff --git a/.github/workflows/NightlyJDK11BuildAndTest.yml b/.github/workflows/nightly.yml similarity index 73% rename from .github/workflows/NightlyJDK11BuildAndTest.yml rename to .github/workflows/nightly.yml index b3c23be..dd780be 100644 --- a/.github/workflows/NightlyJDK11BuildAndTest.yml +++ b/.github/workflows/nightly.yml @@ -19,7 +19,7 @@ # # SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception ############################################################################### -name: "nightly build-openj9 jdk 11" +name: "nightly build-openj9" on: schedule: - cron: '30 21 * * 1-5' @@ -31,20 +31,19 @@ jobs: fail-fast: false matrix: os: [ubuntu-16.04, macos-10.15, windows-2016] + version: [8, 11, 15] + exclude: + # excludes jdk 8 on Mac( not valid), jdk8 on windows( not enabled), jdk11 on windows( issue opened) + - os: macos-10.15 + version: 8 + - os: windows-2016 + version: 8 + - os: windows-2016 + version: 11 #https://github.com/eclipse/build-openj9/issues/2 steps: + - uses: actions/checkout@v1 - uses: eclipse/build-openj9@v1 id: buildJDK with: - version: 11 - - name: AQA - uses: AdoptOpenJDK/run-aqa@v1 - env: - TEST_JDK_HOME: ${{ steps.buildJDK.outputs.BuildJDKDir }} - with: - build_list: 'functional' - target: '_sanity' - - uses: actions/upload-artifact@v2 - if: failure() - with: - name: test_output - path: ./**/test_output_*/ + version: ${{ matrix.version }} + - run: ${{ steps.buildJDK.outputs.BuildJDKDir }}/bin/java -version diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 248107d..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,40 +0,0 @@ -############################################################################### -# Copyright (c) 2020, 2020 IBM Corp. and others -# -# This program and the accompanying materials are made available under -# the terms of the Eclipse Public License 2.0 which accompanies this -# distribution and is available at https://www.eclipse.org/legal/epl-2.0/ -# or the Apache License, Version 2.0 which accompanies this distribution and -# is available at https://www.apache.org/licenses/LICENSE-2.0. -# -# This Source Code may also be made available under the following -# Secondary Licenses when the conditions for such availability set -# forth in the Eclipse Public License, v. 2.0 are satisfied: GNU -# General Public License, version 2 with the GNU Classpath -# Exception [1] and GNU General Public License, version 2 with the -# OpenJDK Assembly Exception [2]. -# -# [1] https://www.gnu.org/software/classpath/license.html -# [2] http://openjdk.java.net/legal/assembly-exception.html -# -# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception -############################################################################### -name: "test branch tip" -on: - push: - branches-ignore: - - '**' -jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [windows-2016, ubuntu-16.04, macos-latest] - steps: - - uses: actions/checkout@v1 - - uses: ./ - id: buildJDK - with: - version: 11 - - run: ${{ steps.buildJDK.outputs.BuildJDKDir }}/bin/java -version diff --git a/action.yml b/action.yml index 8e8c55c..faade0b 100644 --- a/action.yml +++ b/action.yml @@ -31,7 +31,8 @@ inputs: required: false default: false outputs: - BuildJDKDir: # build jdk images directory + BuildJDKDir: + description: 'build jdk images directory' runs: using: 'node12' main: 'dist/index.js' diff --git a/dist/index.js b/dist/index.js index b627281..b6b7fab 100644 --- a/dist/index.js +++ b/dist/index.js @@ -941,6 +941,32 @@ module.exports = require("tls"); /***/ }), +/***/ 82: +/***/ (function(__unusedmodule, exports) { + +"use strict"; + +// We use any as a valid input type +/* eslint-disable @typescript-eslint/no-explicit-any */ +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * Sanitizes an input into a string so it can be passed into issueCommand safely + * @param input input to sanitize into a string + */ +function toCommandValue(input) { + if (input === null || input === undefined) { + return ''; + } + else if (typeof input === 'string' || input instanceof String) { + return input; + } + return JSON.stringify(input); +} +exports.toCommandValue = toCommandValue; +//# sourceMappingURL=utils.js.map + +/***/ }), + /***/ 87: /***/ (function(module) { @@ -948,6 +974,42 @@ module.exports = require("os"); /***/ }), +/***/ 102: +/***/ (function(__unusedmodule, exports, __webpack_require__) { + +"use strict"; + +// For internal use, subject to change. +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// We use any as a valid input type +/* eslint-disable @typescript-eslint/no-explicit-any */ +const fs = __importStar(__webpack_require__(747)); +const os = __importStar(__webpack_require__(87)); +const utils_1 = __webpack_require__(82); +function issueCommand(command, message) { + const filePath = process.env[`GITHUB_${command}`]; + if (!filePath) { + throw new Error(`Unable to find environment variable for file command ${command}`); + } + if (!fs.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); + } + fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, { + encoding: 'utf8' + }); +} +exports.issueCommand = issueCommand; +//# sourceMappingURL=file-command.js.map + +/***/ }), + /***/ 129: /***/ (function(module) { @@ -2879,17 +2941,25 @@ module.exports = require("crypto"); "use strict"; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; Object.defineProperty(exports, "__esModule", { value: true }); -const os = __webpack_require__(87); +const os = __importStar(__webpack_require__(87)); +const utils_1 = __webpack_require__(82); /** * Commands * * Command Format: - * ##[name key=value;key=value]message + * ::name key=value,key=value::message * * Examples: - * ##[warning]This is the user warning message - * ##[set-secret name=mypassword]definitelyNotAPassword! + * ::warning::This is the message + * ::set-env name=MY_VAR::some value */ function issueCommand(command, properties, message) { const cmd = new Command(command, properties, message); @@ -2914,34 +2984,39 @@ class Command { let cmdStr = CMD_STRING + this.command; if (this.properties && Object.keys(this.properties).length > 0) { cmdStr += ' '; + let first = true; for (const key in this.properties) { if (this.properties.hasOwnProperty(key)) { const val = this.properties[key]; if (val) { - // safely append the val - avoid blowing up when attempting to - // call .replace() if message is not a string for some reason - cmdStr += `${key}=${escape(`${val || ''}`)},`; + if (first) { + first = false; + } + else { + cmdStr += ','; + } + cmdStr += `${key}=${escapeProperty(val)}`; } } } } - cmdStr += CMD_STRING; - // safely append the message - avoid blowing up when attempting to - // call .replace() if message is not a string for some reason - const message = `${this.message || ''}`; - cmdStr += escapeData(message); + cmdStr += `${CMD_STRING}${escapeData(this.message)}`; return cmdStr; } } function escapeData(s) { - return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A'); + return utils_1.toCommandValue(s) + .replace(/%/g, '%25') + .replace(/\r/g, '%0D') + .replace(/\n/g, '%0A'); } -function escape(s) { - return s +function escapeProperty(s) { + return utils_1.toCommandValue(s) + .replace(/%/g, '%25') .replace(/\r/g, '%0D') .replace(/\n/g, '%0A') - .replace(/]/g, '%5D') - .replace(/;/g, '%3B'); + .replace(/:/g, '%3A') + .replace(/,/g, '%2C'); } //# sourceMappingURL=command.js.map @@ -2961,10 +3036,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; Object.defineProperty(exports, "__esModule", { value: true }); const command_1 = __webpack_require__(431); -const os = __webpack_require__(87); -const path = __webpack_require__(622); +const file_command_1 = __webpack_require__(102); +const utils_1 = __webpack_require__(82); +const os = __importStar(__webpack_require__(87)); +const path = __importStar(__webpack_require__(622)); /** * The code to exit an action */ @@ -2985,11 +3069,21 @@ var ExitCode; /** * Sets env variable for this action and future actions in the job * @param name the name of the variable to set - * @param val the value of the variable + * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any function exportVariable(name, val) { - process.env[name] = val; - command_1.issueCommand('set-env', { name }, val); + const convertedVal = utils_1.toCommandValue(val); + process.env[name] = convertedVal; + const filePath = process.env['GITHUB_ENV'] || ''; + if (filePath) { + const delimiter = '_GitHubActionsFileCommandDelimeter_'; + const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`; + file_command_1.issueCommand('ENV', commandValue); + } + else { + command_1.issueCommand('set-env', { name }, convertedVal); + } } exports.exportVariable = exportVariable; /** @@ -3005,7 +3099,13 @@ exports.setSecret = setSecret; * @param inputPath */ function addPath(inputPath) { - command_1.issueCommand('add-path', {}, inputPath); + const filePath = process.env['GITHUB_PATH'] || ''; + if (filePath) { + file_command_1.issueCommand('PATH', inputPath); + } + else { + command_1.issueCommand('add-path', {}, inputPath); + } process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; } exports.addPath = addPath; @@ -3028,12 +3128,22 @@ exports.getInput = getInput; * Sets the value of an output. * * @param name name of the output to set - * @param value value to store + * @param value value to store. Non-string values will be converted to a string via JSON.stringify */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any function setOutput(name, value) { command_1.issueCommand('set-output', { name }, value); } exports.setOutput = setOutput; +/** + * Enables or disables the echoing of commands into stdout for the rest of the step. + * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set. + * + */ +function setCommandEcho(enabled) { + command_1.issue('echo', enabled ? 'on' : 'off'); +} +exports.setCommandEcho = setCommandEcho; //----------------------------------------------------------------------- // Results //----------------------------------------------------------------------- @@ -3050,6 +3160,13 @@ exports.setFailed = setFailed; //----------------------------------------------------------------------- // Logging Commands //----------------------------------------------------------------------- +/** + * Gets whether Actions Step Debug is on or not + */ +function isDebug() { + return process.env['RUNNER_DEBUG'] === '1'; +} +exports.isDebug = isDebug; /** * Writes debug message to user log * @param message debug message @@ -3060,18 +3177,18 @@ function debug(message) { exports.debug = debug; /** * Adds an error issue - * @param message error issue message + * @param message error issue message. Errors will be converted to string via toString() */ function error(message) { - command_1.issue('error', message); + command_1.issue('error', message instanceof Error ? message.toString() : message); } exports.error = error; /** * Adds an warning issue - * @param message warning issue message + * @param message warning issue message. Errors will be converted to string via toString() */ function warning(message) { - command_1.issue('warning', message); + command_1.issue('warning', message instanceof Error ? message.toString() : message); } exports.warning = warning; /** @@ -3129,8 +3246,9 @@ exports.group = group; * Saves state for current action, the state can only be retrieved by this action's post job execution. * * @param name name of the state to store - * @param value value to store + * @param value value to store. Non-string values will be converted to a string via JSON.stringify */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any function saveState(name, value) { command_1.issueCommand('save-state', { name }, value); } diff --git a/package-lock.json b/package-lock.json index 4c295cd..6a06431 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,9 +5,9 @@ "requires": true, "dependencies": { "@actions/core": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.0.tgz", - "integrity": "sha512-ZKdyhlSlyz38S6YFfPnyNgCDZuAF2T0Qv5eHflNWytPS8Qjvz39bZFMry9Bb/dpSnqWcNeav5yM2CTYpJeY+Dw==" + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz", + "integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA==" }, "@actions/exec": { "version": "1.0.3",