Compare commits

...

5 Commits

Author SHA1 Message Date
Paulo F. Oliveira 11d59b146c Allow for latest 100 rebar3 versions when fetching from GitHub (#42) 2021-05-27 20:28:05 -05:00
Wojtek Mach e332dc64ad Change how we print installed Elixir version (#36) 2021-05-26 13:29:59 +02:00
Paulo F. Oliveira b50aa18219 v1.7.1 (#35) 2021-05-15 00:29:16 +01:00
Paulo F. Oliveira a550a4c889 Coerce non-semver into semver (#34) 2021-05-15 00:07:41 +01:00
Paulo F. Oliveira d2707f347b Tweak our test combos (#31) 2021-04-19 23:17:55 +01:00
12 changed files with 687 additions and 478 deletions
+2 -2
View File
@@ -20,13 +20,13 @@ jobs:
node-version: '12'
- run: npm install -g npm
- run: npm install
- run: npm run format
- run: npm run build
- run: npm install -g markdownlint-cli
- run: npm run markdownlint
- run: npm run shellcheck
- run: npm run yamllint
- run: npm run jslint
- run: npm run licenses
- run: npm run build
- run: npm run format
- name: Check if build left artifacts
run: git diff --exit-code
+83 -64
View File
@@ -21,99 +21,118 @@ jobs:
integration_test:
name: >
Pre-release integration tests
(Erlang/OTP ${{matrix.pair.otp-version}},
Elixir ${{matrix.pair.elixir-version}},
rebar3 ${{matrix.pair.rebar3-version}})
runs-on: ubuntu-18.04
(Ubuntu ${{matrix.combo.os}},
Erlang/OTP ${{matrix.combo.otp-version}},
Elixir ${{matrix.combo.elixir-version}},
rebar3 ${{matrix.combo.rebar3-version}})
runs-on: ${{matrix.combo.os}}
strategy:
fail-fast: false
matrix:
pair:
# Full Versions
- otp-version: '22.0'
elixir-version: '1.9.1'
- otp-version: '22.3.4'
rebar3-version: '3.14.4'
# Semver ranges
- otp-version: '21.x'
elixir-version: '<1.9.1'
- otp-version: '21.x'
rebar3-version: '3.14.4'
# Branches
- otp-version: '22.0'
elixir-version: master
- otp-version: 'master'
elixir-version: '1.11.3'
# Pre-releases
- otp-version: '23.0'
elixir-version: '1.11.0-rc.0'
# Fallback to Elixir (with no OTP)
- otp-version: '24.0-rc1'
elixir-version: '1.9.3'
# Miscellaneous combos
- elixir-version: 'master'
otp-version: '22.3'
- elixir-version: 'master'
otp-version: '22'
- elixir-version: 'master'
otp-version: '^22'
- elixir-version: 'master'
otp-version: '22'
- elixir-version: '1.6.5'
otp-version: 'maint-21'
- elixir-version: 'v1.6.5'
otp-version: 'maint-21'
- elixir-version: 'v1.9.x'
otp-version: '21.1'
- elixir-version: '1.9.x'
combo:
- elixir-version: 'v1.0'
otp-version: '17'
os: 'ubuntu-16.04'
- elixir-version: 'v1.0'
otp-version: '17'
os: 'ubuntu-18.04'
- elixir-version: 'v1.1'
otp-version: '18'
os: 'ubuntu-16.04'
- elixir-version: 'v1.1'
otp-version: '18'
os: 'ubuntu-18.04'
- elixir-version: 'v1.2'
otp-version: '19'
rebar3-version: '3.10'
os: 'ubuntu-16.04'
- elixir-version: 'v1.2'
otp-version: '19'
rebar3-version: '3.10'
os: 'ubuntu-18.04'
- elixir-version: 'v1.4'
otp-version: '20'
rebar3-version: '3.11'
os: 'ubuntu-16.04'
- elixir-version: 'v1.4'
otp-version: '20'
rebar3-version: '3.6.0'
os: 'ubuntu-18.04'
- elixir-version: 'v1.4'
otp-version: '20'
rebar3-version: '3.11'
os: 'ubuntu-20.04'
- elixir-version: 'v1.6'
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'
- elixir-version: 'v1.8.x'
otp-version: '23.1'
- elixir-version: 'v1.8'
otp-version: '^22.3'
rebar3-version: '3.13'
os: 'ubuntu-16.04'
- elixir-version: 'v1.7'
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'
otp-version: '21.x'
- elixir-version: 'v1.x'
otp-version: 'master'
- elixir-version: 'v1.11.0-rc.0'
otp-version: '23'
- elixir-version: 'v1.11.0-rc.0'
otp-version: '23.0'
- elixir-version: 'v1.11.0-rc.0'
otp-version: 'master'
rebar3-version: '3.14'
os: 'ubuntu-16.04'
- elixir-version: 'v1.10'
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:
- uses: actions/checkout@v2
- name: Use erlef/setup-beam
id: setup-beam
uses: ./
with:
otp-version: ${{matrix.pair.otp-version}}
elixir-version: ${{matrix.pair.elixir-version}}
rebar3-version: ${{matrix.pair.rebar3-version}}
otp-version: ${{matrix.combo.otp-version}}
elixir-version: ${{matrix.combo.elixir-version}}
rebar3-version: ${{matrix.combo.rebar3-version}}
- name: Erlang/OTP version (action)
run: echo "Erlang/OTP ${{steps.setup-beam.outputs.otp-version}}"
- name: Elixir version (action)
run: echo "Elixir ${{steps.setup-beam.outputs.elixir-version}}"
if: ${{matrix.pair.elixir-version}}
if: ${{matrix.combo.elixir-version}}
- name: rebar3 version (action)
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)
run: |
mix -v
mix help local.rebar
mix help local.hex
if: ${{matrix.pair.elixir-version}}
if: ${{matrix.combo.elixir-version}}
- name: Run Mix project tests
run: |
cd test-projects/mix
mix deps.get
mix test
if: ${{matrix.pair.elixir-version}}
if: ${{matrix.combo.elixir-version}}
- name: Run rebar3 project tests
run: |
cd test-projects/rebar3
rebar3 as test do xref,dialyzer,ct,cover
if: ${{matrix.pair.rebar3-version}}
rebar3 ct
if: ${{matrix.combo.rebar3-version}}
+3 -3
View File
@@ -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)
@@ -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
@@ -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/>
+2 -2
View File
@@ -37,12 +37,12 @@ not match a pre-release.
### Compatibility between Ubuntu and Erlang/OTP
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-16.04 | 17 - 23 | ✅
| ubuntu-18.04 | 20 - 23 | ✅
| ubuntu-18.04 | 17 - 23 | ✅
| ubuntu-20.04 | 20 - 23 | ✅
### Basic example (Elixir)
+30 -6
View File
@@ -98,6 +98,30 @@ async function testOTPVersions() {
expected = 'OTP-19.3.6'
got = await setupElixir.getOTPVersion(spec, osVersion)
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() {
@@ -130,18 +154,18 @@ async function testRebar3Versions() {
let expected
let spec
spec = '3.13.x'
expected = '3.13.2'
spec = '3.10.x'
expected = '3.10.0'
got = await setupElixir.getRebar3Version(spec)
assert.deepStrictEqual(got, expected)
spec = '3.13.2'
expected = '3.13.2'
spec = '3.10.0'
expected = '3.10.0'
got = await setupElixir.getRebar3Version(spec)
assert.deepStrictEqual(got, expected)
spec = '3.13'
expected = '3.13.2'
spec = '3.10'
expected = '3.10.0'
got = await setupElixir.getRebar3Version(spec)
assert.deepStrictEqual(got, expected)
}
+90 -56
View File
@@ -1067,11 +1067,18 @@ 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;
};
var _a;
Object.defineProperty(exports, "__esModule", ({ value: true }));
const assert_1 = __nccwpck_require__(2357);
const fs = __nccwpck_require__(5747);
const path = __nccwpck_require__(5622);
const fs = __importStar(__nccwpck_require__(5747));
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;
exports.IS_WINDOWS = process.platform === 'win32';
function exists(fsPath) {
@@ -1269,11 +1276,18 @@ 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 childProcess = __nccwpck_require__(3129);
const path = __nccwpck_require__(5622);
const childProcess = __importStar(__nccwpck_require__(3129));
const path = __importStar(__nccwpck_require__(5622));
const util_1 = __nccwpck_require__(1669);
const ioUtil = __nccwpck_require__(1962);
const ioUtil = __importStar(__nccwpck_require__(1962));
const exec = util_1.promisify(childProcess.exec);
/**
* 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.`);
}
}
return result;
}
try {
// 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('/') || (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}`);
const matches = yield findInPath(tool);
if (matches && matches.length > 0) {
return matches[0];
}
return '';
});
}
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) {
const force = options.force == null ? true : options.force;
const recursive = Boolean(options.recursive);
@@ -4751,11 +4780,13 @@ async function getElixirVersion(exSpec0, otpVersion) {
if (elixirVersions.get(elixirVersion).includes(otpMatch[1])) {
// ... and it's available: use it!
elixirVersionWithOTP = `${elixirVersion}-otp-${otpVersionMajor}`
core.info(`Using Elixir / -otp- version ${elixirVersionWithOTP}`)
core.info(
`Using Elixir ${elixirVersion} (built for OTP ${otpVersionMajor})`,
)
} else {
// ... and it's not available: fallback to the "generic" version (v1.4.5 only).
elixirVersionWithOTP = elixirVersion
core.info(`Using Elixir ${elixirVersionWithOTP}`)
core.info(`Using Elixir ${elixirVersion}`)
}
} else {
throw new Error(
@@ -4791,7 +4822,10 @@ async function getOTPVersions(osVersion) {
.forEach((line) => {
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
})
@@ -4825,7 +4859,7 @@ async function getElixirVersions() {
async function getRebar3Versions() {
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)
.map((x) => x.tag_name)
+9
View File
@@ -15,6 +15,15 @@ MIT
@actions/io
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
ISC
+450 -339
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "setup-beam",
"version": "1.7.0",
"version": "1.7.1",
"license": "MIT",
"private": true,
"scripts": {
+9 -4
View File
@@ -144,11 +144,13 @@ async function getElixirVersion(exSpec0, otpVersion) {
if (elixirVersions.get(elixirVersion).includes(otpMatch[1])) {
// ... and it's available: use it!
elixirVersionWithOTP = `${elixirVersion}-otp-${otpVersionMajor}`
core.info(`Using Elixir / -otp- version ${elixirVersionWithOTP}`)
core.info(
`Using Elixir ${elixirVersion} (built for OTP ${otpVersionMajor})`,
)
} else {
// ... and it's not available: fallback to the "generic" version (v1.4.5 only).
elixirVersionWithOTP = elixirVersion
core.info(`Using Elixir ${elixirVersionWithOTP}`)
core.info(`Using Elixir ${elixirVersion}`)
}
} else {
throw new Error(
@@ -184,7 +186,10 @@ async function getOTPVersions(osVersion) {
.forEach((line) => {
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
})
@@ -218,7 +223,7 @@ async function getElixirVersions() {
async function getRebar3Versions() {
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)
.map((x) => x.tag_name)
+4
View File
@@ -6,4 +6,8 @@ defmodule TestTest do
out = Logfmt.encode(foo: "bar")
assert out == "foo=bar"
end
test "ensures ssl" do
assert {:ok, _} = Application.ensure_all_started(:ssl)
end
end
+4 -1
View File
@@ -5,7 +5,10 @@
-compile([export_all, nowarn_export_all]).
all() ->
[hello_world].
[hello_world, ssl_ok].
hello_world(_Config) ->
?assertEqual(world, mylib:hello()).
ssl_ok(_Config) ->
{ok, _} = application:ensure_all_started(ssl).