Skip to content

Commit

Permalink
Tweak/readme (#295)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulo-ferraz-oliveira authored Jun 28, 2024
1 parent a6e26b2 commit 7f9edf8
Showing 1 changed file with 77 additions and 69 deletions.
146 changes: 77 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,69 @@ with the following correspondence.
| `gleam-version` | `gleam`
| `rebar3-version` | `rebar`

### Example (Erlang/OTP + Elixir, on Ubuntu)
### 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`.
To use other alternative mirrors, add one per line, as shown below.

```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: '26'
# Use `cdn.jsdelivr.net/hex` as an alternative to `builds.hex.pm`
hexpm-mirrors: https://cdn.jsdelivr.net/hex
```
Alternatively, you may try `cdn.jsdelivr.net/hex` if `builds.hex.pm` fails:

```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: '26'
hexpm-mirrors: |
https://builds.hex.pm
https://cdn.jsdelivr.net/hex
```

### Environment variables

Base installation folders (useful for e.g. fetching headers for NIFs) are available in the following
environment variables:

- `INSTALL_DIR_FOR_OTP`: base folder for Erlang/OTP
- `INSTALL_DIR_FOR_ELIXIR`: base folder for Elixir
- `INSTALL_DIR_FOR_GLEAM`: base folder for Gleam
- `INSTALL_DIR_FOR_REBAR3`: base folder for `rebar3`

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

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.

## Examples

### Erlang/OTP + Elixir, on Ubuntu

```yaml
# create this in .github/workflows/ci.yml
Expand All @@ -177,7 +239,7 @@ jobs:
- run: mix test
```

### Example (Erlang/OTP + `rebar3`, on Ubuntu)
### Erlang/OTP + `rebar3`, on Ubuntu

```yaml
# create this in .github/workflows/ci.yml
Expand All @@ -200,7 +262,7 @@ jobs:
- run: rebar3 ct
```

### Example (Erlang/OTP + `rebar3`, on Windows)
### Erlang/OTP + `rebar3`, on Windows

```yaml
# create this in .github/workflows/ci.yml
Expand All @@ -218,7 +280,7 @@ jobs:
- run: rebar3 ct
```

### Example (Gleam on Ubuntu)
### Gleam on Ubuntu

```yaml
# create this in .github/workflows/ci.yml
Expand All @@ -236,7 +298,7 @@ jobs:
- run: gleam test
```

### Example (Gleam on Ubuntu without OTP)
### Gleam on Ubuntu without OTP

```yaml
# create this in .github/workflows/ci.yml
Expand All @@ -256,67 +318,9 @@ jobs:

**Note**: the `otp-version: false` input is only applicable when installing Gleam.

## Alternative hex.pm mirrors
## The project

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`.
To use other alternative mirrors, add one per line, as shown below.

```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: '26'
# Use `cdn.jsdelivr.net/hex` as an alternative to `builds.hex.pm`
hexpm-mirrors: https://cdn.jsdelivr.net/hex
```
Alternatively, you may try `cdn.jsdelivr.net/hex` if `builds.hex.pm` fails:

```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: '26'
hexpm-mirrors: |
https://builds.hex.pm
https://cdn.jsdelivr.net/hex
```

## Environment variables

Base installation folders (useful for e.g. fetching headers for NIFs) are available in the following
environment variables:

- `INSTALL_DIR_FOR_OTP`: base folder for Erlang/OTP
- `INSTALL_DIR_FOR_ELIXIR`: base folder for Elixir
- `INSTALL_DIR_FOR_GLEAM`: base folder for Gleam
- `INSTALL_DIR_FOR_REBAR3`: base folder for `rebar3`

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

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
### Versioning

`setup-beam` has three version paths, described below, for example version `1.8.0`:

Expand All @@ -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 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 action is in active development.
This project's security policy is made explicit in [SECURITY.md](https://github.com/erlef/setup-beam/blob/main/SECURITY.md).

0 comments on commit 7f9edf8

Please sign in to comment.