Introduce rebar-version (#9)

Previously (Remove redundant code) (+27 squashed commits)
Squashed commits:
[0b79c31] Rename as setup-beam
[312b42b] Simplify platform verification
[b43ca96] Prevent use of OTP- prefixed Erlang/OTP versions
[103a236] Move the promise-based approach to an async-based approach

(not testing for failure, so not guaranteeing readable/usable output either)
[1e7f631] Remove local test files
[d03e0c6] Prevent use of -otp- infixed Elixir versions
[697110e] Have versions output in action, not just in tests
[7360781] Ease test validations
[71e6999] Reinstall tests that were there before
[6602f20] Attempt at simplifying regexp matching with build listings
[09247af] Provide for an Elixir to "not OTP" fallback mechanism

(as explained by the comments)
[dfc4083] Attempt at renaming for clarity

We also get rid of return values when not reachable
We also move the `-otp-` part of the Elixir version upstream so it's easy to reason about
  (and update the tests accordingly)
[0d4eb28] Bump our dep.s

(trying to figure out why core.setFailed isn't making the action fail, as it should)
[ebf48ef] Have action fail (with an exception) when no expected version is found

(we otherwise feel that a simple warning is not enough, as it may end up hiding potential bugs)
[8478364] Adapt tests to our actual inputs
[16ea63d] Add prettier again, now sync'ed with jslint

(pass it on the code, already)
[cfc65df] Improve error messages and tests
[a017948] Test unavailable Elixir upon mix
[7f2a3e9] Test failing installations

Also output core.error when expected
[08061ca] Attempt at making shell scripts more robust
[4ee73cb] Separate test code from production code

1. inputs (for CI) are managed by code, not by .yml env. variables
2. rebar3_builds.txt added for stable repeatability
3. tests tweaked to make it easier to modify and drop dependency on production code
4. `dist` regenerated (duplicate files gone)
5. setup-elixir.js tweaked to this new reality
[d17fed4] Remove prettier from the package
[7d6f8f5] Actually break CI when we should
[b972eaf] Remove unrequired element
[0ffa28a] Ease maintenance and readability
[4690169] Fix as per broken tests
[a1371c6] Merge setup-erlang in
This commit is contained in:
Paulo F. Oliveira
2021-03-30 11:54:20 -05:00
committed by GitHub
parent 86521d7b4d
commit 89cb00455a
112 changed files with 10426 additions and 6313 deletions
+56 -12
View File
@@ -1,27 +1,32 @@
# setup-beam
<!-- markdownlint-disable MD013 -->
# setup-beam [![GitHub Actions Test][test-img]][test] [![GitHub Actions CI][ci-img]][ci]
[![](https://github.com/erlef/setup-beam/workflows/Test/badge.svg)](https://github.com/erlef/setup-beam/actions)
[![](https://github.com/erlef/setup-beam/workflows/Licensed/badge.svg)](https://github.com/erlef/setup-beam/actions)
[test]: https://github.com/erlef/setup-beam
[test-img]: https://github.com/erlef/setup-beam/workflows/test/badge.svg
[ci]: https://github.com/erlef/setup-beam
[ci-img]: https://github.com/erlef/setup-beam/workflows/ci/badge.svg
This action sets up an Elixir environment for use in a GitHub Actions
This action sets up an Erlang/OTP environment for use in a GitHub Actions
workflow by:
- Installing OTP
- Installing Elixir
- installing Erlang/OTP
- optionally, installing Elixir
- optionally, installing `rebar3`
**Note** Currently, this action currently only supports Actions' `ubuntu-` runtimes.
**Note** Currently, this action only supports Actions' `ubuntu-` runtimes.
## Usage
See [action.yml](action.yml).
**Note** The OTP release version specification is [relatively
**Note** The Erlang/OTP release version specification is [relatively
complex](http://erlang.org/doc/system_principles/versions.html#version-scheme).
For best results, we recommend specifying exact OTP and Elixir versions.
For best results, we recommend specifying exact Erlang/OTP, Elixir versions, and
`rebar3` versions.
However, values like `22.x` are also accepted, and we attempt to resolve them
according to semantic versioning rules.
Additionally, it is recommended that one specifies OTP and Elixir versions
Additionally, it is recommended that one specifies Erlang/OTP, Elixir and `rebar3` versions
using YAML strings, as these examples do, so that numbers like `23.0` don't
end up being parsed as `23`, which is not equivalent.
@@ -29,7 +34,7 @@ For pre-release Elixir versions, such as `1.11.0-rc.0`, use the full version
specifier (`1.11.0-rc.0`). Pre-release versions are opt-in, so `1.11.x` will
not match a pre-release.
### Basic example
### Basic example (Elixir)
```yaml
on: push
@@ -47,7 +52,24 @@ jobs:
- run: mix test
```
### Matrix example
### Basic example (`rebar3`)
```yaml
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
with:
otp-version: '22.2'
rebar3-version: '3.14.2'
- run: rebar3 ct
```
### Matrix example (Elixir)
```yaml
on: push
@@ -70,6 +92,28 @@ jobs:
- run: mix test
```
### Matrix example (`rebar3`)
```yaml
on: push
jobs:
test:
runs-on: ubuntu-latest
name: Erlang/OTP ${{matrix.otp}} / rebar3 ${{matrix.rebar3}}
strategy:
matrix:
otp: ['20.3', '21.3', '22.2']
rebar3: ['3.14.1', '3.14.3']
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
rebar3-version: ${{matrix.rebar3}}
- run: rebar3 ct
```
### Phoenix example
```yaml