mirror of
https://github.com/erlef/setup-beam.git
synced 2026-07-23 15:16:08 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 11d59b146c | |||
| e332dc64ad | |||
| b50aa18219 | |||
| a550a4c889 | |||
| d2707f347b |
@@ -20,13 +20,13 @@ jobs:
|
|||||||
node-version: '12'
|
node-version: '12'
|
||||||
- run: npm install -g npm
|
- run: npm install -g npm
|
||||||
- run: npm install
|
- run: npm install
|
||||||
- run: npm run format
|
- run: npm run build
|
||||||
- run: npm install -g markdownlint-cli
|
- run: npm install -g markdownlint-cli
|
||||||
- run: npm run markdownlint
|
- run: npm run markdownlint
|
||||||
- run: npm run shellcheck
|
- run: npm run shellcheck
|
||||||
- run: npm run yamllint
|
- run: npm run yamllint
|
||||||
- run: npm run jslint
|
- run: npm run jslint
|
||||||
- run: npm run licenses
|
- run: npm run licenses
|
||||||
- run: npm run build
|
- run: npm run format
|
||||||
- name: Check if build left artifacts
|
- name: Check if build left artifacts
|
||||||
run: git diff --exit-code
|
run: git diff --exit-code
|
||||||
|
|||||||
+83
-64
@@ -21,99 +21,118 @@ jobs:
|
|||||||
integration_test:
|
integration_test:
|
||||||
name: >
|
name: >
|
||||||
Pre-release integration tests
|
Pre-release integration tests
|
||||||
(Erlang/OTP ${{matrix.pair.otp-version}},
|
(Ubuntu ${{matrix.combo.os}},
|
||||||
Elixir ${{matrix.pair.elixir-version}},
|
Erlang/OTP ${{matrix.combo.otp-version}},
|
||||||
rebar3 ${{matrix.pair.rebar3-version}})
|
Elixir ${{matrix.combo.elixir-version}},
|
||||||
runs-on: ubuntu-18.04
|
rebar3 ${{matrix.combo.rebar3-version}})
|
||||||
|
runs-on: ${{matrix.combo.os}}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
pair:
|
combo:
|
||||||
# Full Versions
|
- elixir-version: 'v1.0'
|
||||||
- otp-version: '22.0'
|
otp-version: '17'
|
||||||
elixir-version: '1.9.1'
|
os: 'ubuntu-16.04'
|
||||||
- otp-version: '22.3.4'
|
- elixir-version: 'v1.0'
|
||||||
rebar3-version: '3.14.4'
|
otp-version: '17'
|
||||||
# Semver ranges
|
os: 'ubuntu-18.04'
|
||||||
- otp-version: '21.x'
|
- elixir-version: 'v1.1'
|
||||||
elixir-version: '<1.9.1'
|
otp-version: '18'
|
||||||
- otp-version: '21.x'
|
os: 'ubuntu-16.04'
|
||||||
rebar3-version: '3.14.4'
|
- elixir-version: 'v1.1'
|
||||||
# Branches
|
otp-version: '18'
|
||||||
- otp-version: '22.0'
|
os: 'ubuntu-18.04'
|
||||||
elixir-version: master
|
- elixir-version: 'v1.2'
|
||||||
- otp-version: 'master'
|
otp-version: '19'
|
||||||
elixir-version: '1.11.3'
|
rebar3-version: '3.10'
|
||||||
# Pre-releases
|
os: 'ubuntu-16.04'
|
||||||
- otp-version: '23.0'
|
- elixir-version: 'v1.2'
|
||||||
elixir-version: '1.11.0-rc.0'
|
otp-version: '19'
|
||||||
# Fallback to Elixir (with no OTP)
|
rebar3-version: '3.10'
|
||||||
- otp-version: '24.0-rc1'
|
os: 'ubuntu-18.04'
|
||||||
elixir-version: '1.9.3'
|
- elixir-version: 'v1.4'
|
||||||
# Miscellaneous combos
|
otp-version: '20'
|
||||||
- elixir-version: 'master'
|
rebar3-version: '3.11'
|
||||||
otp-version: '22.3'
|
os: 'ubuntu-16.04'
|
||||||
- elixir-version: 'master'
|
- elixir-version: 'v1.4'
|
||||||
otp-version: '22'
|
otp-version: '20'
|
||||||
- elixir-version: 'master'
|
rebar3-version: '3.6.0'
|
||||||
otp-version: '^22'
|
os: 'ubuntu-18.04'
|
||||||
- elixir-version: 'master'
|
- elixir-version: 'v1.4'
|
||||||
otp-version: '22'
|
otp-version: '20'
|
||||||
- elixir-version: '1.6.5'
|
rebar3-version: '3.11'
|
||||||
otp-version: 'maint-21'
|
os: 'ubuntu-20.04'
|
||||||
- elixir-version: 'v1.6.5'
|
- elixir-version: 'v1.6'
|
||||||
otp-version: 'maint-21'
|
|
||||||
- elixir-version: 'v1.9.x'
|
|
||||||
otp-version: '21.1'
|
|
||||||
- elixir-version: '1.9.x'
|
|
||||||
otp-version: '21'
|
otp-version: '21'
|
||||||
- elixir-version: 'v1.8.x'
|
rebar3-version: '3.12'
|
||||||
|
os: 'ubuntu-16.04'
|
||||||
|
- elixir-version: 'v1.6'
|
||||||
|
otp-version: '21'
|
||||||
|
rebar3-version: '3.12'
|
||||||
|
os: 'ubuntu-18.04'
|
||||||
|
- elixir-version: 'v1.6'
|
||||||
|
otp-version: '21'
|
||||||
|
rebar3-version: '3.12'
|
||||||
|
os: 'ubuntu-20.04'
|
||||||
|
- elixir-version: 'v1.7'
|
||||||
otp-version: '22'
|
otp-version: '22'
|
||||||
- elixir-version: 'v1.8.x'
|
rebar3-version: '3.13'
|
||||||
otp-version: '23.1'
|
os: 'ubuntu-16.04'
|
||||||
- elixir-version: 'v1.8'
|
- elixir-version: 'v1.7'
|
||||||
otp-version: '^22.3'
|
otp-version: '22'
|
||||||
|
rebar3-version: '3.13'
|
||||||
|
os: 'ubuntu-18.04'
|
||||||
|
- elixir-version: 'v1.7'
|
||||||
|
otp-version: '22'
|
||||||
|
rebar3-version: '3.13'
|
||||||
|
os: 'ubuntu-20.04'
|
||||||
- elixir-version: 'v1.10'
|
- elixir-version: 'v1.10'
|
||||||
otp-version: '21.x'
|
|
||||||
- elixir-version: 'v1.x'
|
|
||||||
otp-version: 'master'
|
|
||||||
- elixir-version: 'v1.11.0-rc.0'
|
|
||||||
otp-version: '23'
|
otp-version: '23'
|
||||||
- elixir-version: 'v1.11.0-rc.0'
|
rebar3-version: '3.14'
|
||||||
otp-version: '23.0'
|
os: 'ubuntu-16.04'
|
||||||
- elixir-version: 'v1.11.0-rc.0'
|
- elixir-version: 'v1.10'
|
||||||
otp-version: 'master'
|
otp-version: '23'
|
||||||
|
rebar3-version: '3.14'
|
||||||
|
os: 'ubuntu-18.04'
|
||||||
|
- elixir-version: 'v1.10'
|
||||||
|
otp-version: '23'
|
||||||
|
rebar3-version: '3.14'
|
||||||
|
os: 'ubuntu-20.04'
|
||||||
|
- elixir-version: 'v1.12'
|
||||||
|
otp-version: '24'
|
||||||
|
rebar3-version: '3.15'
|
||||||
|
os: 'ubuntu-20.04'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Use erlef/setup-beam
|
- name: Use erlef/setup-beam
|
||||||
id: setup-beam
|
id: setup-beam
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
otp-version: ${{matrix.pair.otp-version}}
|
otp-version: ${{matrix.combo.otp-version}}
|
||||||
elixir-version: ${{matrix.pair.elixir-version}}
|
elixir-version: ${{matrix.combo.elixir-version}}
|
||||||
rebar3-version: ${{matrix.pair.rebar3-version}}
|
rebar3-version: ${{matrix.combo.rebar3-version}}
|
||||||
- name: Erlang/OTP version (action)
|
- name: Erlang/OTP version (action)
|
||||||
run: echo "Erlang/OTP ${{steps.setup-beam.outputs.otp-version}}"
|
run: echo "Erlang/OTP ${{steps.setup-beam.outputs.otp-version}}"
|
||||||
- name: Elixir version (action)
|
- name: Elixir version (action)
|
||||||
run: echo "Elixir ${{steps.setup-beam.outputs.elixir-version}}"
|
run: echo "Elixir ${{steps.setup-beam.outputs.elixir-version}}"
|
||||||
if: ${{matrix.pair.elixir-version}}
|
if: ${{matrix.combo.elixir-version}}
|
||||||
- name: rebar3 version (action)
|
- name: rebar3 version (action)
|
||||||
run: echo "rebar3 ${{steps.setup-beam.outputs.rebar3-version}}"
|
run: echo "rebar3 ${{steps.setup-beam.outputs.rebar3-version}}"
|
||||||
if: ${{matrix.pair.rebar3-version}}
|
if: ${{matrix.combo.rebar3-version}}
|
||||||
- name: mix version and help (CLI)
|
- name: mix version and help (CLI)
|
||||||
run: |
|
run: |
|
||||||
mix -v
|
mix -v
|
||||||
mix help local.rebar
|
mix help local.rebar
|
||||||
mix help local.hex
|
mix help local.hex
|
||||||
if: ${{matrix.pair.elixir-version}}
|
if: ${{matrix.combo.elixir-version}}
|
||||||
- name: Run Mix project tests
|
- name: Run Mix project tests
|
||||||
run: |
|
run: |
|
||||||
cd test-projects/mix
|
cd test-projects/mix
|
||||||
mix deps.get
|
mix deps.get
|
||||||
mix test
|
mix test
|
||||||
if: ${{matrix.pair.elixir-version}}
|
if: ${{matrix.combo.elixir-version}}
|
||||||
- name: Run rebar3 project tests
|
- name: Run rebar3 project tests
|
||||||
run: |
|
run: |
|
||||||
cd test-projects/rebar3
|
cd test-projects/rebar3
|
||||||
rebar3 as test do xref,dialyzer,ct,cover
|
rebar3 ct
|
||||||
if: ${{matrix.pair.rebar3-version}}
|
if: ${{matrix.combo.rebar3-version}}
|
||||||
|
|||||||
+3
-3
@@ -1081,7 +1081,7 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
The following software may be included in this product: es-to-primitive, is-boolean-object, is-callable, is-date-object, is-number-object, is-string, is-symbol, object.entries. A copy of the source code may be downloaded from git://github.com/ljharb/es-to-primitive.git (es-to-primitive), git://github.com/ljharb/is-boolean-object.git (is-boolean-object), git://github.com/ljharb/is-callable.git (is-callable), git://github.com/ljharb/is-date-object.git (is-date-object), git://github.com/inspect-js/is-number-object.git (is-number-object), git://github.com/ljharb/is-string.git (is-string), git://github.com/inspect-js/is-symbol.git (is-symbol), git://github.com/es-shims/Object.entries.git (object.entries). This software contains the following license and notice below:
|
The following software may be included in this product: es-to-primitive, is-boolean-object, is-callable, is-date-object, is-number-object, is-string, is-symbol, object.entries. A copy of the source code may be downloaded from git://github.com/ljharb/es-to-primitive.git (es-to-primitive), git://github.com/inspect-js/is-boolean-object.git (is-boolean-object), git://github.com/ljharb/is-callable.git (is-callable), git://github.com/inspect-js/is-date-object.git (is-date-object), git://github.com/inspect-js/is-number-object.git (is-number-object), git://github.com/ljharb/is-string.git (is-string), git://github.com/inspect-js/is-symbol.git (is-symbol), git://github.com/es-shims/Object.entries.git (object.entries). This software contains the following license and notice below:
|
||||||
|
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
@@ -1928,7 +1928,7 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
The following software may be included in this product: is-bigint. A copy of the source code may be downloaded from git+https://github.com/ljharb/is-bigint.git. This software contains the following license and notice below:
|
The following software may be included in this product: is-bigint. A copy of the source code may be downloaded from git+https://github.com/inspect-js/is-bigint.git. This software contains the following license and notice below:
|
||||||
|
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
@@ -2216,7 +2216,7 @@ terms above.
|
|||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
The following software may be included in this product: lodash.clonedeep, lodash.flatten, lodash.snakecase, lodash.truncate. A copy of the source code may be downloaded from https://github.com/lodash/lodash.git (lodash.clonedeep), https://github.com/lodash/lodash.git (lodash.flatten), https://github.com/lodash/lodash.git (lodash.snakecase), https://github.com/lodash/lodash.git (lodash.truncate). This software contains the following license and notice below:
|
The following software may be included in this product: lodash.clonedeep, lodash.snakecase, lodash.truncate. A copy of the source code may be downloaded from https://github.com/lodash/lodash.git (lodash.clonedeep), https://github.com/lodash/lodash.git (lodash.snakecase), https://github.com/lodash/lodash.git (lodash.truncate). This software contains the following license and notice below:
|
||||||
|
|
||||||
Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
||||||
|
|
||||||
|
|||||||
@@ -37,12 +37,12 @@ not match a pre-release.
|
|||||||
### Compatibility between Ubuntu and Erlang/OTP
|
### Compatibility between Ubuntu and Erlang/OTP
|
||||||
|
|
||||||
This list presents the known working version combos between Ubuntu
|
This list presents the known working version combos between Ubuntu
|
||||||
and Erlang/OTP. Non-listed combos are not guaranteed to work.
|
and Erlang/OTP.
|
||||||
|
|
||||||
| Ubuntu | Erlang/OTP | Status
|
| Ubuntu | Erlang/OTP | Status
|
||||||
|- |- |-
|
|- |- |-
|
||||||
| ubuntu-16.04 | 17 - 23 | ✅
|
| ubuntu-16.04 | 17 - 23 | ✅
|
||||||
| ubuntu-18.04 | 20 - 23 | ✅
|
| ubuntu-18.04 | 17 - 23 | ✅
|
||||||
| ubuntu-20.04 | 20 - 23 | ✅
|
| ubuntu-20.04 | 20 - 23 | ✅
|
||||||
|
|
||||||
### Basic example (Elixir)
|
### Basic example (Elixir)
|
||||||
|
|||||||
@@ -98,6 +98,30 @@ async function testOTPVersions() {
|
|||||||
expected = 'OTP-19.3.6'
|
expected = 'OTP-19.3.6'
|
||||||
got = await setupElixir.getOTPVersion(spec, osVersion)
|
got = await setupElixir.getOTPVersion(spec, osVersion)
|
||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
|
|
||||||
|
spec = '20'
|
||||||
|
osVersion = 'ubuntu-20.04'
|
||||||
|
expected = 'OTP-20.3.8'
|
||||||
|
got = await setupElixir.getOTPVersion(spec, osVersion)
|
||||||
|
assert.deepStrictEqual(got, expected)
|
||||||
|
|
||||||
|
spec = '20.x'
|
||||||
|
osVersion = 'ubuntu-20.04'
|
||||||
|
expected = 'OTP-20.3.8'
|
||||||
|
got = await setupElixir.getOTPVersion(spec, osVersion)
|
||||||
|
assert.deepStrictEqual(got, expected)
|
||||||
|
|
||||||
|
spec = '20.0'
|
||||||
|
osVersion = 'ubuntu-20.04'
|
||||||
|
expected = 'OTP-20.0.5'
|
||||||
|
got = await setupElixir.getOTPVersion(spec, osVersion)
|
||||||
|
assert.deepStrictEqual(got, expected)
|
||||||
|
|
||||||
|
spec = '20.0.x'
|
||||||
|
osVersion = 'ubuntu-20.04'
|
||||||
|
expected = 'OTP-20.0.5'
|
||||||
|
got = await setupElixir.getOTPVersion(spec, osVersion)
|
||||||
|
assert.deepStrictEqual(got, expected)
|
||||||
}
|
}
|
||||||
|
|
||||||
async function testElixirVersions() {
|
async function testElixirVersions() {
|
||||||
@@ -130,18 +154,18 @@ async function testRebar3Versions() {
|
|||||||
let expected
|
let expected
|
||||||
let spec
|
let spec
|
||||||
|
|
||||||
spec = '3.13.x'
|
spec = '3.10.x'
|
||||||
expected = '3.13.2'
|
expected = '3.10.0'
|
||||||
got = await setupElixir.getRebar3Version(spec)
|
got = await setupElixir.getRebar3Version(spec)
|
||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
|
|
||||||
spec = '3.13.2'
|
spec = '3.10.0'
|
||||||
expected = '3.13.2'
|
expected = '3.10.0'
|
||||||
got = await setupElixir.getRebar3Version(spec)
|
got = await setupElixir.getRebar3Version(spec)
|
||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
|
|
||||||
spec = '3.13'
|
spec = '3.10'
|
||||||
expected = '3.13.2'
|
expected = '3.10.0'
|
||||||
got = await setupElixir.getRebar3Version(spec)
|
got = await setupElixir.getRebar3Version(spec)
|
||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+90
-56
@@ -1067,11 +1067,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
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;
|
||||||
|
};
|
||||||
var _a;
|
var _a;
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
const assert_1 = __nccwpck_require__(2357);
|
const assert_1 = __nccwpck_require__(2357);
|
||||||
const fs = __nccwpck_require__(5747);
|
const fs = __importStar(__nccwpck_require__(5747));
|
||||||
const path = __nccwpck_require__(5622);
|
const path = __importStar(__nccwpck_require__(5622));
|
||||||
_a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink;
|
_a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink;
|
||||||
exports.IS_WINDOWS = process.platform === 'win32';
|
exports.IS_WINDOWS = process.platform === 'win32';
|
||||||
function exists(fsPath) {
|
function exists(fsPath) {
|
||||||
@@ -1269,11 +1276,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
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 }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
const childProcess = __nccwpck_require__(3129);
|
const childProcess = __importStar(__nccwpck_require__(3129));
|
||||||
const path = __nccwpck_require__(5622);
|
const path = __importStar(__nccwpck_require__(5622));
|
||||||
const util_1 = __nccwpck_require__(1669);
|
const util_1 = __nccwpck_require__(1669);
|
||||||
const ioUtil = __nccwpck_require__(1962);
|
const ioUtil = __importStar(__nccwpck_require__(1962));
|
||||||
const exec = util_1.promisify(childProcess.exec);
|
const exec = util_1.promisify(childProcess.exec);
|
||||||
/**
|
/**
|
||||||
* Copies a file or folder.
|
* Copies a file or folder.
|
||||||
@@ -1441,58 +1455,73 @@ function which(tool, check) {
|
|||||||
throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);
|
throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
try {
|
const matches = yield findInPath(tool);
|
||||||
// build the list of extensions to try
|
if (matches && matches.length > 0) {
|
||||||
const extensions = [];
|
return matches[0];
|
||||||
if (ioUtil.IS_WINDOWS && process.env.PATHEXT) {
|
|
||||||
for (const extension of process.env.PATHEXT.split(path.delimiter)) {
|
|
||||||
if (extension) {
|
|
||||||
extensions.push(extension);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// if it's rooted, return it if exists. otherwise return empty.
|
|
||||||
if (ioUtil.isRooted(tool)) {
|
|
||||||
const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
|
|
||||||
if (filePath) {
|
|
||||||
return filePath;
|
|
||||||
}
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
// if any path separators, return empty
|
|
||||||
if (tool.includes('/') || (ioUtil.IS_WINDOWS && tool.includes('\\'))) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
// build the list of directories
|
|
||||||
//
|
|
||||||
// Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
|
|
||||||
// it feels like we should not do this. Checking the current directory seems like more of a use
|
|
||||||
// case of a shell, and the which() function exposed by the toolkit should strive for consistency
|
|
||||||
// across platforms.
|
|
||||||
const directories = [];
|
|
||||||
if (process.env.PATH) {
|
|
||||||
for (const p of process.env.PATH.split(path.delimiter)) {
|
|
||||||
if (p) {
|
|
||||||
directories.push(p);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// return the first match
|
|
||||||
for (const directory of directories) {
|
|
||||||
const filePath = yield ioUtil.tryGetExecutablePath(directory + path.sep + tool, extensions);
|
|
||||||
if (filePath) {
|
|
||||||
return filePath;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
catch (err) {
|
|
||||||
throw new Error(`which failed with message ${err.message}`);
|
|
||||||
}
|
}
|
||||||
|
return '';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.which = which;
|
exports.which = which;
|
||||||
|
/**
|
||||||
|
* Returns a list of all occurrences of the given tool on the system path.
|
||||||
|
*
|
||||||
|
* @returns Promise<string[]> the paths of the tool
|
||||||
|
*/
|
||||||
|
function findInPath(tool) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
if (!tool) {
|
||||||
|
throw new Error("parameter 'tool' is required");
|
||||||
|
}
|
||||||
|
// build the list of extensions to try
|
||||||
|
const extensions = [];
|
||||||
|
if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) {
|
||||||
|
for (const extension of process.env['PATHEXT'].split(path.delimiter)) {
|
||||||
|
if (extension) {
|
||||||
|
extensions.push(extension);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// if it's rooted, return it if exists. otherwise return empty.
|
||||||
|
if (ioUtil.isRooted(tool)) {
|
||||||
|
const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
|
||||||
|
if (filePath) {
|
||||||
|
return [filePath];
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
// if any path separators, return empty
|
||||||
|
if (tool.includes(path.sep)) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
// build the list of directories
|
||||||
|
//
|
||||||
|
// Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
|
||||||
|
// it feels like we should not do this. Checking the current directory seems like more of a use
|
||||||
|
// case of a shell, and the which() function exposed by the toolkit should strive for consistency
|
||||||
|
// across platforms.
|
||||||
|
const directories = [];
|
||||||
|
if (process.env.PATH) {
|
||||||
|
for (const p of process.env.PATH.split(path.delimiter)) {
|
||||||
|
if (p) {
|
||||||
|
directories.push(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// find all matches
|
||||||
|
const matches = [];
|
||||||
|
for (const directory of directories) {
|
||||||
|
const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions);
|
||||||
|
if (filePath) {
|
||||||
|
matches.push(filePath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return matches;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.findInPath = findInPath;
|
||||||
function readCopyOptions(options) {
|
function readCopyOptions(options) {
|
||||||
const force = options.force == null ? true : options.force;
|
const force = options.force == null ? true : options.force;
|
||||||
const recursive = Boolean(options.recursive);
|
const recursive = Boolean(options.recursive);
|
||||||
@@ -4751,11 +4780,13 @@ async function getElixirVersion(exSpec0, otpVersion) {
|
|||||||
if (elixirVersions.get(elixirVersion).includes(otpMatch[1])) {
|
if (elixirVersions.get(elixirVersion).includes(otpMatch[1])) {
|
||||||
// ... and it's available: use it!
|
// ... and it's available: use it!
|
||||||
elixirVersionWithOTP = `${elixirVersion}-otp-${otpVersionMajor}`
|
elixirVersionWithOTP = `${elixirVersion}-otp-${otpVersionMajor}`
|
||||||
core.info(`Using Elixir / -otp- version ${elixirVersionWithOTP}`)
|
core.info(
|
||||||
|
`Using Elixir ${elixirVersion} (built for OTP ${otpVersionMajor})`,
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
// ... and it's not available: fallback to the "generic" version (v1.4.5 only).
|
// ... and it's not available: fallback to the "generic" version (v1.4.5 only).
|
||||||
elixirVersionWithOTP = elixirVersion
|
elixirVersionWithOTP = elixirVersion
|
||||||
core.info(`Using Elixir ${elixirVersionWithOTP}`)
|
core.info(`Using Elixir ${elixirVersion}`)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
@@ -4791,7 +4822,10 @@ async function getOTPVersions(osVersion) {
|
|||||||
.forEach((line) => {
|
.forEach((line) => {
|
||||||
const otpMatch = line.match(/^(OTP-)?([^ ]+)/)
|
const otpMatch = line.match(/^(OTP-)?([^ ]+)/)
|
||||||
|
|
||||||
const otpVersion = otpMatch[2]
|
let otpVersion = otpMatch[2]
|
||||||
|
if (semver.validRange(otpVersion)) {
|
||||||
|
otpVersion = semver.minVersion(otpVersion).version
|
||||||
|
}
|
||||||
otpVersions.set(otpVersion, otpMatch[0]) // we keep the original for later reference
|
otpVersions.set(otpVersion, otpMatch[0]) // we keep the original for later reference
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -4825,7 +4859,7 @@ async function getElixirVersions() {
|
|||||||
|
|
||||||
async function getRebar3Versions() {
|
async function getRebar3Versions() {
|
||||||
const resultJSON = await get(
|
const resultJSON = await get(
|
||||||
'https://api.github.com/repos/erlang/rebar3/releases',
|
'https://api.github.com/repos/erlang/rebar3/releases?per_page=100',
|
||||||
)
|
)
|
||||||
const rebar3VersionsListing = JSON.parse(resultJSON)
|
const rebar3VersionsListing = JSON.parse(resultJSON)
|
||||||
.map((x) => x.tag_name)
|
.map((x) => x.tag_name)
|
||||||
|
|||||||
Vendored
+9
@@ -15,6 +15,15 @@ MIT
|
|||||||
|
|
||||||
@actions/io
|
@actions/io
|
||||||
MIT
|
MIT
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright 2019 GitHub
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
lru-cache
|
lru-cache
|
||||||
ISC
|
ISC
|
||||||
|
|||||||
Generated
+450
-339
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "setup-beam",
|
"name": "setup-beam",
|
||||||
"version": "1.7.0",
|
"version": "1.7.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
+9
-4
@@ -144,11 +144,13 @@ async function getElixirVersion(exSpec0, otpVersion) {
|
|||||||
if (elixirVersions.get(elixirVersion).includes(otpMatch[1])) {
|
if (elixirVersions.get(elixirVersion).includes(otpMatch[1])) {
|
||||||
// ... and it's available: use it!
|
// ... and it's available: use it!
|
||||||
elixirVersionWithOTP = `${elixirVersion}-otp-${otpVersionMajor}`
|
elixirVersionWithOTP = `${elixirVersion}-otp-${otpVersionMajor}`
|
||||||
core.info(`Using Elixir / -otp- version ${elixirVersionWithOTP}`)
|
core.info(
|
||||||
|
`Using Elixir ${elixirVersion} (built for OTP ${otpVersionMajor})`,
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
// ... and it's not available: fallback to the "generic" version (v1.4.5 only).
|
// ... and it's not available: fallback to the "generic" version (v1.4.5 only).
|
||||||
elixirVersionWithOTP = elixirVersion
|
elixirVersionWithOTP = elixirVersion
|
||||||
core.info(`Using Elixir ${elixirVersionWithOTP}`)
|
core.info(`Using Elixir ${elixirVersion}`)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
@@ -184,7 +186,10 @@ async function getOTPVersions(osVersion) {
|
|||||||
.forEach((line) => {
|
.forEach((line) => {
|
||||||
const otpMatch = line.match(/^(OTP-)?([^ ]+)/)
|
const otpMatch = line.match(/^(OTP-)?([^ ]+)/)
|
||||||
|
|
||||||
const otpVersion = otpMatch[2]
|
let otpVersion = otpMatch[2]
|
||||||
|
if (semver.validRange(otpVersion)) {
|
||||||
|
otpVersion = semver.minVersion(otpVersion).version
|
||||||
|
}
|
||||||
otpVersions.set(otpVersion, otpMatch[0]) // we keep the original for later reference
|
otpVersions.set(otpVersion, otpMatch[0]) // we keep the original for later reference
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -218,7 +223,7 @@ async function getElixirVersions() {
|
|||||||
|
|
||||||
async function getRebar3Versions() {
|
async function getRebar3Versions() {
|
||||||
const resultJSON = await get(
|
const resultJSON = await get(
|
||||||
'https://api.github.com/repos/erlang/rebar3/releases',
|
'https://api.github.com/repos/erlang/rebar3/releases?per_page=100',
|
||||||
)
|
)
|
||||||
const rebar3VersionsListing = JSON.parse(resultJSON)
|
const rebar3VersionsListing = JSON.parse(resultJSON)
|
||||||
.map((x) => x.tag_name)
|
.map((x) => x.tag_name)
|
||||||
|
|||||||
@@ -6,4 +6,8 @@ defmodule TestTest do
|
|||||||
out = Logfmt.encode(foo: "bar")
|
out = Logfmt.encode(foo: "bar")
|
||||||
assert out == "foo=bar"
|
assert out == "foo=bar"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "ensures ssl" do
|
||||||
|
assert {:ok, _} = Application.ensure_all_started(:ssl)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -5,7 +5,10 @@
|
|||||||
-compile([export_all, nowarn_export_all]).
|
-compile([export_all, nowarn_export_all]).
|
||||||
|
|
||||||
all() ->
|
all() ->
|
||||||
[hello_world].
|
[hello_world, ssl_ok].
|
||||||
|
|
||||||
hello_world(_Config) ->
|
hello_world(_Config) ->
|
||||||
?assertEqual(world, mylib:hello()).
|
?assertEqual(world, mylib:hello()).
|
||||||
|
|
||||||
|
ssl_ok(_Config) ->
|
||||||
|
{ok, _} = application:ensure_all_started(ssl).
|
||||||
|
|||||||
Reference in New Issue
Block a user