Skip to content

Commit

Permalink
Improve on "Add Windows to the mix" (#52)
Browse files Browse the repository at this point in the history
* Support more OTP+Windows versions (try to bridge the gap with gleam-lang/setup-erlang that seems to support pre-21 versions)
* Merge ci.yml and test.yml
* Add Elixir to the Windows mix
* Hopefully improve error/warning messages
* Adapt the doc.s to the current reality
* Add option version-type (loose by default, for compatibility)
  • Loading branch information
paulo-ferraz-oliveira authored Jul 8, 2021
1 parent 82b4475 commit d8a37f5
Show file tree
Hide file tree
Showing 21 changed files with 499 additions and 258 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/ci.yml → .github/workflows/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: ci
name: action

on:
push:
Expand All @@ -11,7 +11,7 @@ on:

jobs:
check_integrity:
name: Make sure expected pre-release actions are performed
name: Expected local npm actions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -30,3 +30,13 @@ jobs:
- run: npm run licenses
- name: Check if build left artifacts
run: git diff --exit-code

unit_test:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with: {node-version: '12'}
- run: npm ci
- run: npm test
62 changes: 5 additions & 57 deletions .github/workflows/test.yml → .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: test
name: ubuntu

on:
push:
Expand All @@ -10,23 +10,11 @@ on:
- main

jobs:
unit_test:
name: Pre-release unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with: {node-version: '12'}
- run: npm ci
- run: npm test

integration_test_ubuntu:
integration_test:
name: >
Pre-release integration tests
(Ubuntu ${{matrix.combo.os}},
Erlang/OTP ${{matrix.combo.otp-version}},
Elixir ${{matrix.combo.elixir-version}},
rebar3 ${{matrix.combo.rebar3-version}})
OTP ${{matrix.combo.otp-version}},
Elixir ${{matrix.combo.elixir-version}},
rebar3 ${{matrix.combo.rebar3-version}}
runs-on: ${{matrix.combo.os}}
strategy:
fail-fast: false
Expand Down Expand Up @@ -138,43 +126,3 @@ jobs:
cd test-projects/rebar3
rebar3 ct
if: ${{matrix.combo.rebar3-version}}

integration_test_windows:
name: >
Pre-release integration tests
(Windows ${{matrix.combo.os}},
Erlang/OTP ${{matrix.combo.otp-version}},
rebar3 ${{matrix.combo.rebar3-version}})
runs-on: ${{matrix.combo.os}}
strategy:
fail-fast: false
matrix:
combo:
- otp-version: '24.0.2'
rebar3-version: '3.16'
os: 'windows-2019'
- otp-version: '23.0'
rebar3-version: '3.15'
os: 'windows-2019'
- otp-version: '24.0.2'
rebar3-version: '3.16'
os: 'windows-2016'
- otp-version: '23.0'
rebar3-version: '3.15'
os: 'windows-2016'
steps:
- uses: actions/checkout@v2
- name: Use erlef/setup-beam
id: setup-beam
uses: ./
with:
otp-version: ${{matrix.combo.otp-version}}
rebar3-version: ${{matrix.combo.rebar3-version}}
- name: Erlang/OTP version (action)
run: echo "Erlang/OTP ${{steps.setup-beam.outputs.otp-version}}"
- name: rebar3 version (action)
run: echo "rebar3 ${{steps.setup-beam.outputs.rebar3-version}}"
- name: Run rebar3 project tests
run: |
cd test-projects/rebar3
rebar3 ct
87 changes: 87 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
name: windows

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
integration_test:
name: >
OTP ${{matrix.combo.otp-version}},
Elixir ${{matrix.combo.elixir-version}},
rebar3 ${{matrix.combo.rebar3-version}}
runs-on: ${{matrix.combo.os}}
strategy:
fail-fast: false
matrix:
combo:
- otp-version: '24.0.2'
rebar3-version: '3.16'
os: 'windows-2019'
- otp-version: '23.0'
rebar3-version: '3.15'
os: 'windows-2019'
- otp-version: '24.0.2'
rebar3-version: '3.16'
os: 'windows-2016'
- otp-version: '23.0'
rebar3-version: '3.15'
os: 'windows-2016'
- otp-version: '22.3'
rebar3-version: '3.15'
os: 'windows-2016'
- otp-version: '22.0'
rebar3-version: '3.15'
os: 'windows-2016'
- otp-version: '21.3'
rebar3-version: '3.15'
os: 'windows-2016'
- otp-version: '21.0'
rebar3-version: '3.15'
os: 'windows-2016'
- elixir-version: 'v1.10'
otp-version: '23'
rebar3-version: '3.14'
os: 'windows-latest'
- elixir-version: 'v1.11'
otp-version: '24'
rebar3-version: '3.15'
os: 'windows-latest'
steps:
- uses: actions/checkout@v2
- name: Use erlef/setup-beam
id: setup-beam
uses: ./
with:
otp-version: ${{matrix.combo.otp-version}}
elixir-version: ${{matrix.combo.elixir-version}}
rebar3-version: ${{matrix.combo.rebar3-version}}
- name: Erlang/OTP version (action)
run: echo "Erlang/OTP ${{steps.setup-beam.outputs.otp-version}}"
- name: Elixir version (action)
run: echo "Elixir ${{steps.setup-beam.outputs.elixir-version}}"
if: ${{matrix.combo.elixir-version}}
- name: rebar3 version (action)
run: echo "rebar3 ${{steps.setup-beam.outputs.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 Mix project tests
run: |
cd test-projects/mix
mix deps.get
mix test
if: ${{matrix.combo.elixir-version}}
- name: Run rebar3 project tests
run: |
cd test-projects/rebar3
rebar3 ct
if: ${{matrix.combo.rebar3-version}}
51 changes: 28 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<!-- markdownlint-disable MD013 -->
# setup-beam [![GitHub Actions Test][test-img]][test] [![GitHub Actions CI][ci-img]][ci]
# setup-beam [![GitHub Actions][action-img]][action] [![GitHub Actions][ubuntu-img]][ubuntu] [![GitHub Actions][windows-img]][windows]

[test]: https://github.com/erlef/setup-beam
[test-img]: https://github.com/erlef/setup-beam/workflows/test/badge.svg
[ci]: https://github.com/erlef/setup-beam
[ci-img]: https://github.com/erlef/setup-beam/workflows/ci/badge.svg
[action]: https://github.com/erlef/setup-beam
[action-img]: https://github.com/erlef/setup-beam/workflows/action/badge.svg
[ubuntu]: https://github.com/erlef/setup-beam
[ubuntu-img]: https://github.com/erlef/setup-beam/workflows/ubuntu/badge.svg
[windows]: https://github.com/erlef/setup-beam
[windows-img]: https://github.com/erlef/setup-beam/workflows/windows/badge.svg

This action sets up an Erlang/OTP environment for use in a GitHub Actions
workflow by:
Expand All @@ -14,7 +16,7 @@ workflow by:
- optionally, installing `rebar3`
- optionally, installing `hex`

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

## Usage

Expand All @@ -23,9 +25,10 @@ See [action.yml](action.yml) for the action's specification.
**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.
`rebar3` versions, and setting option `version-type` to `strict`.
However, values like `22.x`, or even `>22`, are also accepted, and we attempt to resolve them
according to semantic versioning rules.
according to semantic versioning rules. This implicitly means `version-type` is `loose`,
which is also the default value for this option.

Additionally, it is recommended that one specifies Erlang/OTP, Elixir and `rebar3` versions
using YAML strings, as these examples do, so that numbers like `23.0` don't
Expand All @@ -35,20 +38,22 @@ For pre-release Elixir versions, such as `1.11.0-rc.0`, use the full version
specifier (`1.11.0-rc.0`). Pre-release versions are opt-in, so `1.11.x` will
not match a pre-release.

### Compatibility between Ubuntu and Erlang/OTP
### Compatibility between Operating System and Erlang/OTP

This list presents the known working version combos between Ubuntu
This list presents the known working version combos between the target operating system
and Erlang/OTP.

| Ubuntu | Erlang/OTP | Status
|- |- |-
| ubuntu-16.04 | 17 - 24 | ✅
| ubuntu-18.04 | 17 - 24 | ✅
| ubuntu-20.04 | 20 - 24 | ✅
| windows-2016 | 23 - 24 | ✅
| windows-2019 | 23 - 24 | ✅
| Operating system | Erlang/OTP | Status
|- |- |-
| ubuntu-16.04 | 17 - 24 | ✅
| ubuntu-18.04 | 17 - 24 | ✅
| ubuntu-20.04 | 20 - 24 | ✅
| windows-2016 | 21* - 24 | ✅
| windows-2019 | 21* - 24 | ✅

### Basic example (Elixir)
**Note** *: prior to 23, Windows builds are only available for minor versions, e.g. 21.0, 21.3, 22.0, etc.

### Basic example (Erlang/OTP + Elixir, on Ubuntu)

```yaml
# create this in .github/workflows/ci.yml
Expand All @@ -67,7 +72,7 @@ jobs:
- run: mix test
```
### Basic example (`rebar3`)
### Basic example (Erlang/OTP + `rebar3`, on Ubuntu)

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

### Matrix example (Elixir)
### Matrix example (Erlang/OTP + Elixir, on Ubuntu)

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

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

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

### Basic example (`rebar3` on Windows 2016)
### Basic example (Erlang/OTP + `rebar3`, on Windows)

```yaml
# create this in .github/workflows/ci.yml
Expand All @@ -145,7 +150,7 @@ jobs:
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
with:
otp-version: '24.0.2'
otp-version: '24'
rebar3-version: '3.16.1'
- run: rebar3 ct
```
Expand Down
Loading

0 comments on commit d8a37f5

Please sign in to comment.