2019-08-28 00:00:01 -04:00
|
|
|
# setup-elixir
|
|
|
|
|
|
|
|
|
|
[](https://github.com/actions/setup-elixir/actions)
|
2019-08-28 17:25:36 -04:00
|
|
|
[](https://github.com/actions/setup-elixir/actions)
|
2019-08-28 00:00:01 -04:00
|
|
|
|
|
|
|
|
This actions sets up an Elixir environment for use in Actions by:
|
|
|
|
|
|
|
|
|
|
- Installing OTP
|
|
|
|
|
- Installing Elixir
|
|
|
|
|
|
|
|
|
|
**Note** Currently, this action currently only supports Actions' `ubuntu-` runtimes.
|
|
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
|
|
See [action.yml](action.yml).
|
|
|
|
|
|
|
|
|
|
**Note** The OTP release version specification is [relatively
|
|
|
|
|
complex](http://erlang.org/doc/system_principles/versions.html#version-scheme).
|
|
|
|
|
For best results, the current recommendation is to use a full exact version
|
|
|
|
|
spec from the list available from [Erlang
|
|
|
|
|
Solutions](https://www.erlang-solutions.com/resources/download.html).
|
|
|
|
|
|
|
|
|
|
### Basic example
|
|
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
|
on: push
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
test:
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
steps:
|
2019-08-28 17:54:06 -04:00
|
|
|
- uses: actions/checkout@v1.0.0
|
2019-08-28 00:00:01 -04:00
|
|
|
- uses: actions/setup-elixir@v1.0.0
|
|
|
|
|
with:
|
|
|
|
|
otp-version: 22.x
|
|
|
|
|
elixir-version: 1.9.x
|
|
|
|
|
- run: mix deps.get
|
|
|
|
|
- run: mix test
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Matrix example
|
|
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
|
on: push
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
test:
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
|
|
|
|
|
strategy:
|
|
|
|
|
matrix:
|
|
|
|
|
otp: [20.x, 21.x, 22.x]
|
|
|
|
|
elixir: [1.8.x, 1.9.x]
|
|
|
|
|
steps:
|
2019-08-28 17:54:06 -04:00
|
|
|
- uses: actions/checkout@v1.0.0
|
2019-08-28 00:00:01 -04:00
|
|
|
- uses: actions/setup-elixir@v1.0.0
|
|
|
|
|
with:
|
|
|
|
|
otp-version: ${{matrix.otp}}
|
|
|
|
|
elixir-version: ${{matrix.elixir}}
|
|
|
|
|
- run: mix deps.get
|
|
|
|
|
- run: mix test
|
|
|
|
|
```
|
|
|
|
|
|
2019-08-28 17:54:06 -04:00
|
|
|
### Phoenix example
|
|
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
|
on: push
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
test:
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
|
|
services:
|
|
|
|
|
db:
|
|
|
|
|
image: postgres:11
|
|
|
|
|
ports: ['5432:5432']
|
|
|
|
|
options: >-
|
|
|
|
|
--health-cmd pg_isready
|
|
|
|
|
--health-interval 10s
|
|
|
|
|
--health-timeout 5s
|
|
|
|
|
--health-retries 5
|
|
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
- uses: actions/checkout@v1.0.0
|
|
|
|
|
- uses: actions/setup-elixir@1.0.0
|
|
|
|
|
with:
|
|
|
|
|
otp-version: 22.x
|
|
|
|
|
elixir-version: 1.9.x
|
|
|
|
|
- run: mix deps.get
|
|
|
|
|
- run: mix test
|
|
|
|
|
```
|
|
|
|
|
|
2019-08-28 00:00:01 -04:00
|
|
|
## License
|
|
|
|
|
|
|
|
|
|
The scripts and documentation in this project are released under the [MIT license](LICENSE.md).
|
|
|
|
|
|
|
|
|
|
## Contributing
|
|
|
|
|
|
|
|
|
|
Check out [this doc](CONTRIBUTING.md).
|
|
|
|
|
|
|
|
|
|
## Current Status
|
|
|
|
|
|
|
|
|
|
This action is in active development.
|