Skip to content

Commit

Permalink
Add Erlang 24 to README and some more info on version matching (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulo-ferraz-oliveira authored Jun 9, 2021
1 parent 31cf3db commit e6db7bd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 67 deletions.
2 changes: 1 addition & 1 deletion 3RD_PARTY_LICENSES
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ THE SOFTWARE.

-----

The following software may be included in this product: ansi-regex, ansi-styles, callsites, chalk, has-flag, is-fullwidth-code-point, parent-module, path-key, resolve-from, shebang-regex, string-width, strip-ansi, supports-color, type-fest. A copy of the source code may be downloaded from https://github.com/chalk/ansi-regex.git (ansi-regex), https://github.com/chalk/ansi-styles.git (ansi-styles), https://github.com/sindresorhus/callsites.git (callsites), https://github.com/chalk/chalk.git (chalk), https://github.com/sindresorhus/has-flag.git (has-flag), https://github.com/sindresorhus/is-fullwidth-code-point.git (is-fullwidth-code-point), https://github.com/sindresorhus/parent-module.git (parent-module), https://github.com/sindresorhus/path-key.git (path-key), https://github.com/sindresorhus/resolve-from.git (resolve-from), https://github.com/sindresorhus/shebang-regex.git (shebang-regex), https://github.com/sindresorhus/string-width.git (string-width), https://github.com/chalk/strip-ansi.git (strip-ansi), https://github.com/chalk/supports-color.git (supports-color), https://github.com/sindresorhus/type-fest.git (type-fest). This software contains the following license and notice below:
The following software may be included in this product: ansi-regex, ansi-styles, callsites, chalk, has-flag, is-fullwidth-code-point, parent-module, path-key, resolve-from, shebang-regex, string-width, strip-ansi, supports-color. A copy of the source code may be downloaded from https://github.com/chalk/ansi-regex.git (ansi-regex), https://github.com/chalk/ansi-styles.git (ansi-styles), https://github.com/sindresorhus/callsites.git (callsites), https://github.com/chalk/chalk.git (chalk), https://github.com/sindresorhus/has-flag.git (has-flag), https://github.com/sindresorhus/is-fullwidth-code-point.git (is-fullwidth-code-point), https://github.com/sindresorhus/parent-module.git (parent-module), https://github.com/sindresorhus/path-key.git (path-key), https://github.com/sindresorhus/resolve-from.git (resolve-from), https://github.com/sindresorhus/shebang-regex.git (shebang-regex), https://github.com/sindresorhus/string-width.git (string-width), https://github.com/chalk/strip-ansi.git (strip-ansi), https://github.com/chalk/supports-color.git (supports-color). This software contains the following license and notice below:

MIT License

Expand Down
77 changes: 11 additions & 66 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@ workflow by:
- installing Erlang/OTP
- optionally, installing Elixir
- optionally, installing `rebar3`
- optionally, installing `hex`

**Note** Currently, this action only supports Actions' `ubuntu-` runtimes.

## Usage

See [action.yml](action.yml).
See [action.yml](action.yml) for the action's specification.

**Note** The Erlang/OTP release version specification is [relatively
**Note**: The Erlang/OTP release version specification is [relatively
complex](http://erlang.org/doc/system_principles/versions.html#version-scheme).
For best results, we recommend specifying exact Erlang/OTP, Elixir versions, and
`rebar3` versions.
However, values like `22.x` are also accepted, and we attempt to resolve them
However, values like `22.x`, or even `>22`, are also accepted, and we attempt to resolve them
according to semantic versioning rules.

Additionally, it is recommended that one specifies Erlang/OTP, Elixir and `rebar3` versions
Expand All @@ -41,13 +42,14 @@ and Erlang/OTP.

| Ubuntu | Erlang/OTP | Status
|- |- |-
| ubuntu-16.04 | 17 - 23 | ✅
| ubuntu-18.04 | 17 - 23 | ✅
| ubuntu-20.04 | 20 - 23 | ✅
| ubuntu-16.04 | 17 - 24 | ✅
| ubuntu-18.04 | 17 - 24 | ✅
| ubuntu-20.04 | 20 - 24 | ✅

### Basic example (Elixir)

```yaml
# create this in .github/workflows/ci.yml
on: push

jobs:
Expand All @@ -66,6 +68,7 @@ jobs:
### Basic example (`rebar3`)

```yaml
# create this in .github/workflows/ci.yml
on: push
jobs:
Expand All @@ -83,6 +86,7 @@ jobs:
### Matrix example (Elixir)

```yaml
# create this in .github/workflows/ci.yml
on: push
jobs:
Expand All @@ -106,6 +110,7 @@ jobs:
### Matrix example (`rebar3`)

```yaml
# create this in .github/workflows/ci.yml
on: push
jobs:
Expand All @@ -125,66 +130,6 @@ jobs:
- run: rebar3 ct
```

### Phoenix example

```yaml
on: push
jobs:
test:
runs-on: ubuntu-latest
services:
db:
image: postgres:11
ports: ['5432:5432']
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
with:
otp-version: '22.2'
elixir-version: '1.9.4'
- run: mix deps.get
- run: mix test
```

#### Authenticating with Postgres in Phoenix

When using the Phoenix example above, the `postgres` container has some
default authentication set up. Specifically, it expects a username of
"postgres", and a password of "postgres". It will be available at
`localhost:5432`.

The simplest way of setting these auth values in CI is by checking for the
`GITHUB_ACTIONS` environment variable that is set in all workflows:

```elixir
# config/test.exs
use Mix.Config
# Configure the database for local testing
config :app, App.Repo,
database: "my_app_test",
hostname: "localhost",
pool: Ecto.Adapters.SQL.Sandbox
# Configure the database for GitHub Actions
if System.get_env("GITHUB_ACTIONS") do
config :app, App.Repo,
username: "postgres",
password: "postgres"
end
```

## 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.
Expand Down

0 comments on commit e6db7bd

Please sign in to comment.