diff --git a/.github/actions/install-llvm/dist/index.js b/.github/actions/install-llvm/dist/index.js index 6c13f27d7..b43cee0d7 100644 --- a/.github/actions/install-llvm/dist/index.js +++ b/.github/actions/install-llvm/dist/index.js @@ -19,7 +19,13 @@ module.exports = /******/ }; /******/ /******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ var threw = true; +/******/ try { +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ threw = false; +/******/ } finally { +/******/ if(threw) delete installedModules[moduleId]; +/******/ } /******/ /******/ // Flag the module as loaded /******/ module.l = true; @@ -1069,6 +1075,32 @@ exports._readLinuxVersionFile = _readLinuxVersionFile; /***/ }), +/***/ 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) { @@ -1076,6 +1108,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 + +/***/ }), + /***/ 104: /***/ (function(__unusedmodule, __webpack_exports__, __webpack_require__) { @@ -3080,6 +3148,7 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); const os = __importStar(__webpack_require__(87)); +const utils_1 = __webpack_require__(82); /** * Commands * @@ -3133,28 +3202,14 @@ class Command { return cmdStr; } } -/** - * 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; function escapeData(s) { - return toCommandValue(s) + return utils_1.toCommandValue(s) .replace(/%/g, '%25') .replace(/\r/g, '%0D') .replace(/\n/g, '%0A'); } function escapeProperty(s) { - return toCommandValue(s) + return utils_1.toCommandValue(s) .replace(/%/g, '%25') .replace(/\r/g, '%0D') .replace(/\n/g, '%0A') @@ -3188,6 +3243,8 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); const command_1 = __webpack_require__(431); +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)); /** @@ -3214,9 +3271,17 @@ var ExitCode; */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function exportVariable(name, val) { - const convertedVal = command_1.toCommandValue(val); + const convertedVal = utils_1.toCommandValue(val); process.env[name] = convertedVal; - command_1.issueCommand('set-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; /** @@ -3232,7 +3297,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; @@ -3392,7 +3463,6 @@ function getState(name) { exports.getState = getState; //# sourceMappingURL=core.js.map - /***/ }), /***/ 533: @@ -3443,6 +3513,7 @@ class HTTPError extends Error { } exports.HTTPError = HTTPError; const IS_WINDOWS = process.platform === 'win32'; +const IS_MAC = process.platform === 'darwin'; const userAgent = 'actions/tool-cache'; /** * Download a tool from an url and stream it into a file @@ -3658,6 +3729,36 @@ function extractTar(file, dest, flags = 'xz') { }); } exports.extractTar = extractTar; +/** + * Extract a xar compatible archive + * + * @param file path to the archive + * @param dest destination directory. Optional. + * @param flags flags for the xar. Optional. + * @returns path to the destination directory + */ +function extractXar(file, dest, flags = []) { + return __awaiter(this, void 0, void 0, function* () { + assert_1.ok(IS_MAC, 'extractXar() not supported on current OS'); + assert_1.ok(file, 'parameter "file" is required'); + dest = yield _createExtractFolder(dest); + let args; + if (flags instanceof Array) { + args = flags; + } + else { + args = [flags]; + } + args.push('-x', '-C', dest, '-f', file); + if (core.isDebug()) { + args.push('-v'); + } + const xarPath = yield io.which('xar', true); + yield exec_1.exec(`"${xarPath}"`, _unique(args)); + return dest; + }); +} +exports.extractXar = extractXar; /** * Extract a zip * @@ -3966,6 +4067,13 @@ function _getGlobal(key, defaultValue) { /* eslint-enable @typescript-eslint/no-explicit-any */ return value !== undefined ? value : defaultValue; } +/** + * Returns an array of unique values. + * @param values Values to make unique. + */ +function _unique(values) { + return Array.from(new Set(values)); +} //# sourceMappingURL=tool-cache.js.map /***/ }), diff --git a/.github/actions/install-llvm/externals/7zr.exe b/.github/actions/install-llvm/externals/7zr.exe index 04e96e723..bb1b30b90 100644 Binary files a/.github/actions/install-llvm/externals/7zr.exe and b/.github/actions/install-llvm/externals/7zr.exe differ diff --git a/.github/actions/install-llvm/package-lock.json b/.github/actions/install-llvm/package-lock.json index 9b21758f5..860c8efbd 100644 --- a/.github/actions/install-llvm/package-lock.json +++ b/.github/actions/install-llvm/package-lock.json @@ -31,9 +31,9 @@ "integrity": "sha512-J8KuFqVPr3p6U8W93DOXlXW6zFvrQAJANdS+vw0YhusLIq+bszW8zmK2Fh1C2kDPX8FMvwIl1OUcFgvJoXLbAg==" }, "@actions/tool-cache": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@actions/tool-cache/-/tool-cache-1.5.5.tgz", - "integrity": "sha512-y/YO37BOaXzOEHpvoGZDLCwvg6XZWQ7Ala4Np4xzrKD1r48mff+K/GAmzXMejnApU7kgqC6lL/aCKTZDCrhdmw==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@actions/tool-cache/-/tool-cache-1.6.0.tgz", + "integrity": "sha512-+fyEBImPD3m5I0o6DflCO0NHY180LPoX8Lo6y4Iez+V17kO8kfkH0VHxb8mUdmD6hn9dWA9Ch1JA20fXoIYUeQ==", "requires": { "@actions/core": "^1.2.3", "@actions/exec": "^1.0.0", @@ -44,9 +44,9 @@ } }, "@zeit/ncc": { - "version": "0.20.5", - "resolved": "https://registry.npmjs.org/@zeit/ncc/-/ncc-0.20.5.tgz", - "integrity": "sha512-XU6uzwvv95DqxciQx+aOLhbyBx/13ky+RK1y88Age9Du3BlA4mMPCy13BGjayOrrumOzlq1XV3SD/BWiZENXlw==" + "version": "0.22.3", + "resolved": "https://registry.npmjs.org/@zeit/ncc/-/ncc-0.22.3.tgz", + "integrity": "sha512-jnCLpLXWuw/PAiJiVbLjA8WBC0IJQbFeUwF4I9M+23MvIxTxk5pD4Q8byQBSPmHQjz5aBoA7AKAElQxMpjrCLQ==" }, "semver": { "version": "6.3.0", diff --git a/.github/actions/install-llvm/package.json b/.github/actions/install-llvm/package.json index 73109996d..9164d8c2c 100644 --- a/.github/actions/install-llvm/package.json +++ b/.github/actions/install-llvm/package.json @@ -11,8 +11,8 @@ "license": "ISC", "dependencies": { "@actions/core": "^1.2.6", - "@actions/exec": "^1.0.1", - "@actions/tool-cache": "^1.1.2", - "@zeit/ncc": "^0.20.5" + "@actions/exec": "^1.0.4", + "@actions/tool-cache": "^1.6.0", + "@zeit/ncc": "^0.22.3" } } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 90aa06755..cd6f2657c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,39 +7,39 @@ env: jobs: - check: - name: Check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - submodules: true - - - name: Install Rust (stable) - uses: actions-rs/toolchain@v1 - with: - profile: minimal - override: true - - - name: Install LLVM - uses: ./.github/actions/install-llvm - - - name: Cargo check - uses: actions-rs/cargo@v1 - with: - command: check +# check: +# name: Check +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v2 +# with: +# submodules: true +# +# - name: Install Rust (stable) +# uses: actions-rs/toolchain@v1 +# with: +# profile: minimal +# override: true +# +# - name: Install LLVM +# uses: ./.github/actions/install-llvm +# +# - name: Cargo check +# uses: actions-rs/cargo@v1 +# with: +# command: check test: name: Test runs-on: ${{ matrix.config.os }} - needs: check + #needs: check strategy: fail-fast: false matrix: config: - - { os: "ubuntu-latest"} - - { os: "windows-2016"} - - { os: "macOS-latest"} + #- { os: "ubuntu-latest"} + - { os: "windows-latest"} + #- { os: "macOS-latest"} steps: - uses: actions/checkout@v2 with: @@ -54,6 +54,8 @@ jobs: - name: Install LLVM uses: ./.github/actions/install-llvm + env: + RUNNER_DEBUG: 1 - name: Cargo build if: ${{ matrix.config.os == 'ubuntu-latest' }} @@ -78,61 +80,60 @@ jobs: with: command: test args: -- --nocapture - - style: - name: Check Style - runs-on: ubuntu-latest - needs: check - steps: - - uses: actions/checkout@v2 - with: - submodules: true - - - name: Install stable toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - override: true - components: clippy, rustfmt - - - name: Run cargo fmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check - - - name: Install LLVM - uses: ./.github/actions/install-llvm - - - name: Run cargo clippy - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --all-features - - tarpaulin: - runs-on: ubuntu-latest - needs: check - steps: - - uses: actions/checkout@v2 - with: - submodules: true - - - name: Install toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - override: true - components: rustfmt - - - name: Install LLVM - uses: ./.github/actions/install-llvm - - - name: Run cargo-tarpaulin - uses: actions-rs/tarpaulin@v0.1 - - - uses: codecov/codecov-action@v1 - with: - file: ${{ steps.coverage.outputs.report }} - name: ${{ matrix.os }} - \ No newline at end of file +# +# style: +# name: Check Style +# runs-on: ubuntu-latest +# needs: check +# steps: +# - uses: actions/checkout@v2 +# with: +# submodules: true +# +# - name: Install stable toolchain +# uses: actions-rs/toolchain@v1 +# with: +# profile: minimal +# override: true +# components: clippy, rustfmt +# +# - name: Run cargo fmt +# uses: actions-rs/cargo@v1 +# with: +# command: fmt +# args: --all -- --check +# +# - name: Install LLVM +# uses: ./.github/actions/install-llvm +# +# - name: Run cargo clippy +# uses: actions-rs/clippy-check@v1 +# with: +# token: ${{ secrets.GITHUB_TOKEN }} +# args: --all-features +# +# tarpaulin: +# runs-on: ubuntu-latest +# needs: check +# steps: +# - uses: actions/checkout@v2 +# with: +# submodules: true +# +# - name: Install toolchain +# uses: actions-rs/toolchain@v1 +# with: +# profile: minimal +# override: true +# components: rustfmt +# +# - name: Install LLVM +# uses: ./.github/actions/install-llvm +# +# - name: Run cargo-tarpaulin +# uses: actions-rs/tarpaulin@v0.1 +# +# - uses: codecov/codecov-action@v1 +# with: +# file: ${{ steps.coverage.outputs.report }} +# name: ${{ matrix.os }}