erlef / setup-beam

Set up your BEAM-based GitHub Actions workflow (Erlang, Elixir, Gleam, ...)
MIT License
378 stars 51 forks source link

Wrong OTP version installed #215

Closed rlopzc closed 1 year ago

rlopzc commented 1 year ago

When using this:

env:
  ImageOS: "ubuntu22"
  # Elixir and Erlang versions
  OTP_VERSION: "25.3.2.1"
  ELIXIR_VERSION: "1.14.5"
...
      - name: Setup Erlang, Elixir, etc
        uses: erlef/setup-beam@v1
        with:
          otp-version: ${{ env.OTP_VERSION }}
          elixir-version: ${{ env.ELIXIR_VERSION }}

The action outputs: image

image

Not sure why the OTP version gets changed to 25.3.2.2 when it's 25.3.2.1.

paulo-ferraz-oliveira commented 1 year ago

Hi, @rlopzc. It's probably the version coercion mechanism that has an issue. Could you, in the meantime, with version-type: strict, as an input to the action?

paulo-ferraz-oliveira commented 1 year ago

Would you add your inputs to our CI files and pull request so we can go from there, maybe? I'm not sure when/if I'll have time to deal with this soonish, but it seems like an important issue.

paulo-ferraz-oliveira commented 1 year ago

Yeah, so in the case of '25.3.2.1', it seems that semver.validRange("25.3.2.1") evaluates to null, which means we do semver.coerce("25.3.2.1").version, which results in '25.3.2', .

paulo-ferraz-oliveira commented 1 year ago

I could probably make an exception for OTP alone, since its version scheme is not SemVer (or "somewhat closely" compliant). I've looked at a few of the latest tags for Gleam, rebar3, Elixir and Erlang/OTP, and only the last one seems not "somewhat compliant".

rlopzc commented 1 year ago

Hello @paulo-ferraz-oliveira , thanks for the help! Indeed it was fixed by using version-type: strict. I'll close this as now we are installing the specific versions we want :smile:

paulo-ferraz-oliveira commented 1 year ago

I think I'll add a check for this, actually. If a version isn't coercible as semver, we'll need to force 'strict'.

Edit: and then I'll pull request and check what other maintainers think of this approach.