mirror of
https://github.com/erlef/setup-beam.git
synced 2026-07-26 09:40:48 +00:00
* Update some dependencies' versions (also, get rid of husky) * Introduce branch dependency execution We want the most important things to fail first and prevent the other ones from executing e.g. if your dist/ is not updated, there's no point seeing the tests fail * Rid ourselves of bloat * Introduce expectations for upcoming version * Tweak whitespace * Tweak our calls to getVersionFromSpec (increase code consistency) * Remove non-used variable * Start coercing on input, stop sorting/maybe prepending 'v' on input We'll deal with all this in a centralized place to make it easier to reason on the code * Revamp our getVersionFromSpec 1. stop accepting maybePrependWithV0, since this is only used in specialized cases 2. sort versions internally (don't expect it to come sorted) 3. compare rc/strict and .includes in a single go (don't separate these) 4. don't expect already coerced version arrays, coerce them when required (the maybeCoerced version had changed already, which means we're smarter at putting stuff inside the version array) 5. raise an exception if a semver-invalid version is not flagged as strict * Reduce our expectations, but still be appropriate to our mission * Update our tests for our new expectations (start the TDD bit) * Execute npm run build-dist and keep results * Increase inter-job dependency * Don't expect markdownlint to be installed remotely * Revert "Increase inter-job dependency" This reverts commit 500b0fe7e9eec1c4f258b4d16b40719ee1d0a1ad. * Revert "Introduce branch dependency execution" This reverts commit fbe1317a800d7722f4e8b668c073218263d0ab17. * Have all the CI workflows run under the same conditions * Fix as per CI results * Re-establish the possibility to match versions like 22.3.4.2.1.0 We cheat on the semver matching: 1. we keep an ordered list of versions that respect e.g. 22.3.4 2. if we match 22.3.4 when fetching a version, we get the last value from the list of versions that respect it, e.g. 22.3.4.2.1.0 (since this is ordered, it should work as previously expected) This increases code complexity for getVersionFromSpec, but hopefully not by much... We also remove throw-based test cases (non-versions will fail later, with null), and add some tests to prove our need code. * Trim out linting practices But still keep them useful
228 lines
7.7 KiB
YAML
228 lines
7.7 KiB
YAML
---
|
|
name: ubuntu
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
integration_test:
|
|
name: >
|
|
OTP ${{matrix.combo.otp-version}},
|
|
Elixir ${{matrix.combo.elixir-version}},
|
|
Gleam ${{matrix.combo.gleam-version}},
|
|
rebar3 ${{matrix.combo.rebar3-version}}
|
|
runs-on: ${{matrix.combo.os}}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
combo:
|
|
- otp-version: '26.0'
|
|
elixir-version: 'v1.14-otp-25'
|
|
os: 'ubuntu-latest'
|
|
version-type: 'strict'
|
|
- otp-version: '26.0'
|
|
elixir-version: '1.14.5'
|
|
os: 'ubuntu-latest'
|
|
version-type: 'strict'
|
|
- otp-version: '25.2'
|
|
elixir-version: '1.14.3'
|
|
os: 'ubuntu-latest'
|
|
- otp-version: '25.2'
|
|
elixir-version: '1.14.3'
|
|
os: 'ubuntu-latest'
|
|
version-type: 'strict'
|
|
- otp-version: '25'
|
|
elixir-version: '1'
|
|
rebar3-version: '3'
|
|
os: 'ubuntu-22.04'
|
|
- otp-version: '24'
|
|
elixir-version: '1'
|
|
rebar3-version: '3'
|
|
os: 'ubuntu-22.04'
|
|
- otp-version: '25.0'
|
|
elixir-version: 'v1.13.4-otp-25'
|
|
rebar3-version: '3.18.0'
|
|
os: 'ubuntu-latest'
|
|
version-type: 'strict'
|
|
- otp-version: '25.0'
|
|
elixir-version: 'v1.13.4'
|
|
rebar3-version: '3.18.0'
|
|
os: 'ubuntu-latest'
|
|
version-type: 'strict'
|
|
- otp-version: '25'
|
|
rebar3-version: 'nightly'
|
|
os: 'ubuntu-latest'
|
|
- otp-version: '24'
|
|
rebar3-version: 'nightly'
|
|
os: 'ubuntu-latest'
|
|
- elixir-version: 'v1.4'
|
|
otp-version: '20'
|
|
rebar3-version: '3.15.0'
|
|
os: 'ubuntu-20.04'
|
|
- elixir-version: 'v1.4'
|
|
otp-version: '20'
|
|
rebar3-version: '3.11'
|
|
os: 'ubuntu-20.04'
|
|
- elixir-version: 'v1.6'
|
|
otp-version: '21'
|
|
rebar3-version: '3.12'
|
|
os: 'ubuntu-20.04'
|
|
- elixir-version: 'v1.6'
|
|
otp-version: '21'
|
|
rebar3-version: '3.12'
|
|
os: 'ubuntu-20.04'
|
|
- elixir-version: 'v1.7'
|
|
otp-version: '22'
|
|
rebar3-version: '3.13'
|
|
os: 'ubuntu-20.04'
|
|
- elixir-version: 'v1.7'
|
|
otp-version: '22'
|
|
rebar3-version: '3.13'
|
|
os: 'ubuntu-20.04'
|
|
- elixir-version: 'v1.10'
|
|
otp-version: '23'
|
|
rebar3-version: '3.14'
|
|
os: 'ubuntu-20.04'
|
|
- elixir-version: 'v1.13.4'
|
|
otp-version: '25.0.2'
|
|
rebar3-version: '3.19'
|
|
os: 'ubuntu-20.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'
|
|
- elixir-version: 'v1.13.4'
|
|
otp-version: '25.0.2'
|
|
rebar3-version: '3.19'
|
|
os: 'ubuntu-20.04'
|
|
- elixir-version: 'v1.11.0'
|
|
otp-version: '22.3.4.2'
|
|
os: 'ubuntu-20.04'
|
|
version-type: 'strict'
|
|
- elixir-version: '1.10.3'
|
|
otp-version: '22.3.4.1'
|
|
os: 'ubuntu-20.04'
|
|
version-type: 'strict'
|
|
- elixir-version: 'main'
|
|
otp-version: '23.1'
|
|
os: 'ubuntu-20.04'
|
|
version-type: 'strict'
|
|
- elixir-version: 'main'
|
|
otp-version: '25'
|
|
os: 'ubuntu-20.04'
|
|
version-type: 'strict'
|
|
- gleam-version: '0.23'
|
|
otp-version: '24'
|
|
os: 'ubuntu-latest'
|
|
disable_problem_matchers: true
|
|
- gleam-version: '0.23.0-rc1'
|
|
otp-version: '24'
|
|
os: 'ubuntu-latest'
|
|
disable_problem_matchers: true
|
|
- gleam-version: '0.23.0-rc1'
|
|
otp-version: false
|
|
os: 'ubuntu-latest'
|
|
disable_problem_matchers: true
|
|
- gleam-version: '0.22.0' # Version with Gleam's old archive naming convention
|
|
otp-version: '24'
|
|
os: 'ubuntu-latest'
|
|
disable_problem_matchers: true
|
|
- elixir-version: 'v1.13'
|
|
otp-version: '24'
|
|
escript_packages: 'hex protobuf'
|
|
escript_script: 'protoc-gen-elixir --version'
|
|
os: 'ubuntu-latest'
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Use erlef/setup-beam
|
|
id: setup-beam
|
|
uses: ./
|
|
with:
|
|
otp-version: ${{matrix.combo.otp-version}}
|
|
elixir-version: ${{matrix.combo.elixir-version}}
|
|
gleam-version: ${{matrix.combo.gleam-version}}
|
|
rebar3-version: ${{matrix.combo.rebar3-version}}
|
|
version-type: ${{matrix.combo.version-type}}
|
|
- name: Erlang/OTP version (action)
|
|
run: echo "Erlang/OTP ${{steps.setup-beam.outputs.otp-version}}"
|
|
if: ${{matrix.combo.otp-version}}
|
|
- name: Elixir version (action)
|
|
run: echo "Elixir ${{steps.setup-beam.outputs.elixir-version}}"
|
|
if: ${{matrix.combo.elixir-version}}
|
|
- name: Gleam version (action)
|
|
run: echo "Gleam ${{steps.setup-beam.outputs.gleam-version}}"
|
|
if: ${{matrix.combo.gleam-version}}
|
|
- name: rebar3 version (action)
|
|
run: echo "rebar3 ${{steps.setup-beam.outputs.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.combo.elixir-version}}
|
|
- name: Run Elixir/Mix project tests
|
|
run: |
|
|
cd test/projects/elixir_mix
|
|
mix deps.get
|
|
mix test
|
|
if: ${{matrix.combo.elixir-version}}
|
|
- name: Run Erlang/rebar3 project tests
|
|
run: |
|
|
cd test/projects/erlang_rebar3
|
|
rebar3 ct
|
|
if: ${{matrix.combo.rebar3-version}}
|
|
- name: Format Gleam project (without installing Erlang/OTP)
|
|
run: |
|
|
cd test/projects/gleam_gleam
|
|
gleam format
|
|
if: ${{ matrix.combo.gleam-version && !matrix.combo.otp-version }}
|
|
- name: Run Gleam project tests (without `rebar3`)
|
|
run: |
|
|
cd test/projects/gleam_gleam
|
|
gleam test
|
|
if: ${{ matrix.combo.gleam-version && matrix.combo.otp-version && !matrix.combo.rebar3-version }}
|
|
- name: Run escript
|
|
run: |
|
|
mix escript.install --force ${{matrix.combo.escript_packages}}
|
|
${{matrix.combo.escript_script}}
|
|
if: ${{matrix.combo.escript_packages && matrix.combo.escript_script}}
|
|
environment_variables:
|
|
name: Environment variables
|
|
runs-on: ${{matrix.combo.os}}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
combo:
|
|
- otp-version: '24'
|
|
elixir-version: 'v1.12'
|
|
gleam-version: '0.23.0-rc1'
|
|
rebar3-version: 'nightly'
|
|
os: 'ubuntu-latest'
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Use erlef/setup-beam
|
|
id: setup-beam
|
|
uses: ./
|
|
with:
|
|
otp-version: ${{matrix.combo.otp-version}}
|
|
elixir-version: ${{matrix.combo.elixir-version}}
|
|
gleam-version: ${{matrix.combo.gleam-version}}
|
|
rebar3-version: ${{matrix.combo.rebar3-version}}
|
|
- run: env
|
|
- name: List environment variables
|
|
run: |
|
|
[ -n "${INSTALL_DIR_FOR_ELIXIR}" ] && echo "${INSTALL_DIR_FOR_ELIXIR}"
|
|
[ -n "${INSTALL_DIR_FOR_GLEAM}" ] && echo "${INSTALL_DIR_FOR_GLEAM}"
|
|
[ -n "${INSTALL_DIR_FOR_OTP}" ] && echo "${INSTALL_DIR_FOR_OTP}"
|
|
[ -n "${INSTALL_DIR_FOR_REBAR3}" ] && echo "${INSTALL_DIR_FOR_REBAR3}"
|