mirror of
https://github.com/erlef/setup-beam.git
synced 2026-07-23 07:06:07 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b9c58b0450 | |||
| a54aa91870 | |||
| 168876b81a | |||
| ee8d6d1ec3 | |||
| d2ccea2f14 | |||
| e7c76e536e | |||
| 7f9edf8627 |
@@ -44,7 +44,7 @@ jobs:
|
||||
- otp-version: '24.0.2'
|
||||
rebar3-version: '3.16'
|
||||
os: 'windows-2019'
|
||||
- otp-version: '26.2.5'
|
||||
- otp-version: '26.1'
|
||||
rebar3-version: 'nightly'
|
||||
os: 'windows-2019'
|
||||
- otp-version: '23.0'
|
||||
|
||||
@@ -153,110 +153,7 @@ with the following correspondence.
|
||||
| `gleam-version` | `gleam`
|
||||
| `rebar3-version` | `rebar`
|
||||
|
||||
### Example (Erlang/OTP + Elixir, on Ubuntu)
|
||||
|
||||
```yaml
|
||||
# create this in .github/workflows/ci.yml
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-20.04
|
||||
name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
|
||||
strategy:
|
||||
matrix:
|
||||
otp: ['21.1', '22.2', '23.3']
|
||||
elixir: ['1.8.2', '1.9.4']
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: erlef/setup-beam@v1
|
||||
with:
|
||||
otp-version: ${{matrix.otp}}
|
||||
elixir-version: ${{matrix.elixir}}
|
||||
- run: mix deps.get
|
||||
- run: mix test
|
||||
```
|
||||
|
||||
### Example (Erlang/OTP + `rebar3`, on Ubuntu)
|
||||
|
||||
```yaml
|
||||
# create this in .github/workflows/ci.yml
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-20.04
|
||||
name: Erlang/OTP ${{matrix.otp}} / rebar3 ${{matrix.rebar3}}
|
||||
strategy:
|
||||
matrix:
|
||||
otp: ['21.1', '22.2', '23.3']
|
||||
rebar3: ['3.14.1', '3.14.3']
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: erlef/setup-beam@v1
|
||||
with:
|
||||
otp-version: ${{matrix.otp}}
|
||||
rebar3-version: ${{matrix.rebar3}}
|
||||
- run: rebar3 ct
|
||||
```
|
||||
|
||||
### Example (Erlang/OTP + `rebar3`, on Windows)
|
||||
|
||||
```yaml
|
||||
# create this in .github/workflows/ci.yml
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: windows-2022
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: erlef/setup-beam@v1
|
||||
with:
|
||||
otp-version: '24'
|
||||
rebar3-version: '3.16.1'
|
||||
- run: rebar3 ct
|
||||
```
|
||||
|
||||
### Example (Gleam on Ubuntu)
|
||||
|
||||
```yaml
|
||||
# create this in .github/workflows/ci.yml
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: erlef/setup-beam@v1
|
||||
with:
|
||||
otp-version: '24'
|
||||
gleam-version: '0.23.0-rc1'
|
||||
- run: gleam test
|
||||
```
|
||||
|
||||
### Example (Gleam on Ubuntu without OTP)
|
||||
|
||||
```yaml
|
||||
# create this in .github/workflows/ci.yml
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: erlef/setup-beam@v1
|
||||
with:
|
||||
otp-version: false
|
||||
gleam-version: '0.23.0-rc1'
|
||||
- run: gleam check
|
||||
```
|
||||
|
||||
**Note**: the `otp-version: false` input is only applicable when installing Gleam.
|
||||
|
||||
## Alternative hex.pm mirrors
|
||||
### Alternative hex.pm mirrors
|
||||
|
||||
It is possible to use alternative hex.pm mirror(s), in their declared order, with
|
||||
option `hexpm-mirrors`. By default, the action will use `builds.hex.pm`.
|
||||
@@ -297,7 +194,7 @@ jobs:
|
||||
https://cdn.jsdelivr.net/hex
|
||||
```
|
||||
|
||||
## Environment variables
|
||||
### Environment variables
|
||||
|
||||
Base installation folders (useful for e.g. fetching headers for NIFs) are available in the following
|
||||
environment variables:
|
||||
@@ -310,13 +207,120 @@ environment variables:
|
||||
In each of these you'll find folder `bin` where the appropriate binaries, platform-dependant,
|
||||
are found (i.e. `erl`, `erl.exe`, `rebar3`, `rebar3.exe`, ...).
|
||||
|
||||
## Elixir Problem Matchers
|
||||
### Elixir Problem Matchers
|
||||
|
||||
The Elixir Problem Matchers in this repository are adapted from
|
||||
[here](https://github.com/fr1zle/vscode-elixir/blob/45eddb589acd7ac98e0c7305d1c2b24668ca709a/package.json#L70-L118).
|
||||
See [MATCHER_NOTICE](MATCHER_NOTICE.md) for license details.
|
||||
|
||||
## Action versioning
|
||||
## Examples
|
||||
|
||||
### Erlang/OTP + Elixir, on Ubuntu
|
||||
|
||||
```yaml
|
||||
# create this in .github/workflows/ci.yml
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-20.04
|
||||
name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
|
||||
strategy:
|
||||
matrix:
|
||||
otp: ['21.1', '22.2', '23.3']
|
||||
elixir: ['1.8.2', '1.9.4']
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: erlef/setup-beam@v1
|
||||
with:
|
||||
otp-version: ${{matrix.otp}}
|
||||
elixir-version: ${{matrix.elixir}}
|
||||
- run: mix deps.get
|
||||
- run: mix test
|
||||
```
|
||||
|
||||
### Erlang/OTP + `rebar3`, on Ubuntu
|
||||
|
||||
```yaml
|
||||
# create this in .github/workflows/ci.yml
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-20.04
|
||||
name: Erlang/OTP ${{matrix.otp}} / rebar3 ${{matrix.rebar3}}
|
||||
strategy:
|
||||
matrix:
|
||||
otp: ['21.1', '22.2', '23.3']
|
||||
rebar3: ['3.14.1', '3.14.3']
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: erlef/setup-beam@v1
|
||||
with:
|
||||
otp-version: ${{matrix.otp}}
|
||||
rebar3-version: ${{matrix.rebar3}}
|
||||
- run: rebar3 ct
|
||||
```
|
||||
|
||||
### Erlang/OTP + `rebar3`, on Windows
|
||||
|
||||
```yaml
|
||||
# create this in .github/workflows/ci.yml
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: windows-2022
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: erlef/setup-beam@v1
|
||||
with:
|
||||
otp-version: '24'
|
||||
rebar3-version: '3.16.1'
|
||||
- run: rebar3 ct
|
||||
```
|
||||
|
||||
### Gleam on Ubuntu
|
||||
|
||||
```yaml
|
||||
# create this in .github/workflows/ci.yml
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: erlef/setup-beam@v1
|
||||
with:
|
||||
otp-version: '24'
|
||||
gleam-version: '0.23.0-rc1'
|
||||
- run: gleam test
|
||||
```
|
||||
|
||||
### Gleam on Ubuntu without OTP
|
||||
|
||||
```yaml
|
||||
# create this in .github/workflows/ci.yml
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: erlef/setup-beam@v1
|
||||
with:
|
||||
otp-version: false
|
||||
gleam-version: '0.23.0-rc1'
|
||||
- run: gleam check
|
||||
```
|
||||
|
||||
**Note**: the `otp-version: false` input is only applicable when installing Gleam.
|
||||
|
||||
## The project
|
||||
|
||||
### Versioning
|
||||
|
||||
`setup-beam` has three version paths, described below, for example version `1.8.0`:
|
||||
|
||||
@@ -328,14 +332,18 @@ We make a real effort to not introduce incompatibilities without changing the ma
|
||||
version number. To be extra safe against changes causing issues in your CI you should specify
|
||||
an exact version with `@vx.y.z`.
|
||||
|
||||
## License
|
||||
### License
|
||||
|
||||
The scripts and documentation in this project are released under the [MIT license](LICENSE.md).
|
||||
|
||||
## Contributing
|
||||
### Contributing
|
||||
|
||||
Check out [this doc](CONTRIBUTING.md).
|
||||
|
||||
## Current Status
|
||||
### Code of Conduct
|
||||
|
||||
This action is in active development.
|
||||
This project's code of conduct is made explicit in [CODE_OF_CONDUCT.md](https://github.com/erlef/setup-beam/blob/main/CODE_OF_CONDUCT.md).
|
||||
|
||||
### Security
|
||||
|
||||
This project's security policy is made explicit in [SECURITY.md](https://github.com/erlef/setup-beam/blob/main/SECURITY.md).
|
||||
|
||||
Vendored
+4
-2
@@ -9154,7 +9154,7 @@ async function main() {
|
||||
await maybeInstallRebar3(rebar3Spec)
|
||||
|
||||
// undefined is replaced by a function, post- main branch merge
|
||||
const setupBeamVersion = '21a744d'
|
||||
const setupBeamVersion = 'a54aa91'
|
||||
core.setOutput('setup-beam-version', setupBeamVersion)
|
||||
}
|
||||
|
||||
@@ -9536,6 +9536,8 @@ function getVersionFromSpec(spec0, versions0) {
|
||||
// If `version-type: strict` or version is RC, we obtain it directly
|
||||
version = versions0[spec]
|
||||
}
|
||||
} else if (spec0 === 'latest') {
|
||||
version = versions0[versions0.latest]
|
||||
} else if (rangeMax !== null) {
|
||||
// Otherwise, we compare alt. versions' semver ranges to this version, from highest to lowest
|
||||
const thatVersion = spec
|
||||
@@ -9604,7 +9606,7 @@ function isRC(ver) {
|
||||
}
|
||||
|
||||
function isKnownBranch(ver) {
|
||||
return ['main', 'master', 'maint', 'latest'].includes(ver)
|
||||
return ['main', 'master', 'maint'].includes(ver)
|
||||
}
|
||||
|
||||
function githubARMRunnerArchs() {
|
||||
|
||||
+4
-2
@@ -49,7 +49,7 @@ async function main() {
|
||||
await maybeInstallRebar3(rebar3Spec)
|
||||
|
||||
// undefined is replaced by a function, post- main branch merge
|
||||
const setupBeamVersion = '21a744d'
|
||||
const setupBeamVersion = 'a54aa91'
|
||||
core.setOutput('setup-beam-version', setupBeamVersion)
|
||||
}
|
||||
|
||||
@@ -436,6 +436,8 @@ function getVersionFromSpec(spec0, versions0) {
|
||||
// If `version-type: strict` or version is RC, we obtain it directly
|
||||
version = versions0[spec]
|
||||
}
|
||||
} else if (spec0 === 'latest') {
|
||||
version = versions0[versions0.latest]
|
||||
} else if (rangeMax !== null) {
|
||||
// Otherwise, we compare alt. versions' semver ranges to this version, from highest to lowest
|
||||
const thatVersion = spec
|
||||
@@ -504,7 +506,7 @@ function isRC(ver) {
|
||||
}
|
||||
|
||||
function isKnownBranch(ver) {
|
||||
return ['main', 'master', 'maint', 'latest'].includes(ver)
|
||||
return ['main', 'master', 'maint'].includes(ver)
|
||||
}
|
||||
|
||||
function githubARMRunnerArchs() {
|
||||
|
||||
+14
-7
@@ -183,15 +183,17 @@ async function testOTPVersions() {
|
||||
expected = 'maint-26'
|
||||
got = await setupBeam.getOTPVersion(spec, osVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
|
||||
simulateInput('version-type', before)
|
||||
|
||||
before = simulateInput('version-type', 'strict')
|
||||
spec = '27.0'
|
||||
osVersion = 'ubuntu-24.04'
|
||||
expected = 'OTP-27.0'
|
||||
got = await setupBeam.getOTPVersion(spec, osVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
|
||||
simulateInput('version-type', before)
|
||||
|
||||
before = simulateInput('version-type', 'strict')
|
||||
spec = '25.3.2.1'
|
||||
osVersion = 'ubuntu-20.04'
|
||||
expected = 'OTP-25.3.2.1'
|
||||
@@ -308,15 +310,17 @@ async function testLinuxARM64OTPVersions() {
|
||||
expected = 'maint-26'
|
||||
got = await setupBeam.getOTPVersion(spec, osVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
|
||||
simulateInput('version-type', before)
|
||||
|
||||
before = simulateInput('version-type', 'strict')
|
||||
spec = '27.0'
|
||||
osVersion = 'ubuntu-24.04'
|
||||
expected = 'OTP-27.0'
|
||||
got = await setupBeam.getOTPVersion(spec, osVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
|
||||
simulateInput('version-type', before)
|
||||
|
||||
before = simulateInput('version-type', 'strict')
|
||||
spec = '25.3.2.1'
|
||||
osVersion = 'ubuntu-20.04'
|
||||
expected = 'OTP-25.3.2.1'
|
||||
@@ -393,22 +397,24 @@ async function testLinuxAMD64OTPVersions() {
|
||||
expected = 'maint-26'
|
||||
got = await setupBeam.getOTPVersion(spec, osVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
|
||||
simulateInput('version-type', before)
|
||||
|
||||
before = simulateInput('version-type', 'strict')
|
||||
spec = '27.0'
|
||||
osVersion = 'ubuntu-24.04'
|
||||
expected = 'OTP-27.0'
|
||||
got = await setupBeam.getOTPVersion(spec, osVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
|
||||
simulateInput('version-type', before)
|
||||
|
||||
before = simulateInput('version-type', 'strict')
|
||||
spec = '25.3.2.1'
|
||||
osVersion = 'ubuntu-20.04'
|
||||
expected = 'OTP-25.3.2.1'
|
||||
got = await setupBeam.getOTPVersion(spec, osVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
|
||||
simulateInput('version-type', before)
|
||||
|
||||
spec = '19.3.x'
|
||||
osVersion = 'ubuntu-16.04'
|
||||
expected = 'OTP-19.3.6.13'
|
||||
@@ -562,6 +568,7 @@ async function testElixirVersions() {
|
||||
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
simulateInput('version-type', before)
|
||||
|
||||
simulateInput('hexpm-mirrors', hexMirrors, { multiline: true })
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user