Skip to content

Commit

Permalink
Add Windows to the mix (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulo-ferraz-oliveira authored Jun 24, 2021
1 parent dd4eb24 commit 82b4475
Show file tree
Hide file tree
Showing 21 changed files with 562 additions and 177 deletions.
23 changes: 13 additions & 10 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ extends:
- airbnb
parserOptions:
ecmaVersion: 12
rules: {
indent: ["warn", 2],
max-len: ["warn", 100],
no-console: 0,
no-undef: "error",
no-unused-vars: ["error", {"varsIgnorePattern": "^_"}],
no-use-before-define: 0,
operator-linebreak: 0,
require-jsdoc: 0,
rules:
indent: ["warn", 2]
max-len: ["warn", 100]
no-console: 0
no-undef: "error"
no-unused-vars: ["error", {"varsIgnorePattern": "^_"}]
no-use-before-define: 0
operator-linebreak: 0
require-jsdoc: 0
semi: 0
}

settings:
react:
version: 999.999.999
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:
- run: npm install -g npm
- run: npm install
- run: npm run build
- run: npm run format
- run: npm install -g markdownlint-cli
- run: npm run markdownlint
- run: npm run shellcheck
- run: npm run yamllint
- run: npm run jslint
- run: npm run licenses
- run: npm run format
- name: Check if build left artifacts
run: git diff --exit-code
52 changes: 47 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
name: test

on:
push: {branches: main}
pull_request: {branches: main}
repository_dispatch:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
unit_test:
Expand All @@ -18,7 +20,7 @@ jobs:
- run: npm ci
- run: npm test

integration_test:
integration_test_ubuntu:
name: >
Pre-release integration tests
(Ubuntu ${{matrix.combo.os}},
Expand Down Expand Up @@ -136,3 +138,43 @@ 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
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ and Erlang/OTP.
| ubuntu-16.04 | 17 - 24 | ✅
| ubuntu-18.04 | 17 - 24 | ✅
| ubuntu-20.04 | 20 - 24 | ✅
| windows-2016 | 23 - 24 | ✅
| windows-2019 | 23 - 24 | ✅

### Basic example (Elixir)

Expand Down Expand Up @@ -130,6 +132,24 @@ jobs:
- run: rebar3 ct
```

### Basic example (`rebar3` on Windows 2016)

```yaml
# create this in .github/workflows/ci.yml
on: push
jobs:
test:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
with:
otp-version: '24.0.2'
rebar3-version: '3.16.1'
- run: rebar3 ct
```

## 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
104 changes: 63 additions & 41 deletions __tests__/setup-beam.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,47 +81,69 @@ async function testOTPVersions() {
let spec
let osVersion

spec = '19.3.x'
osVersion = 'ubuntu-16.04'
expected = 'OTP-19.3.6'
got = await setupBeam.getOTPVersion(spec, osVersion)
assert.deepStrictEqual(got, expected)

spec = '^19.3.6'
osVersion = 'ubuntu-16.04'
expected = 'OTP-19.3.6'
got = await setupBeam.getOTPVersion(spec, osVersion)
assert.deepStrictEqual(got, expected)

spec = '^19.3'
osVersion = 'ubuntu-18.04'
expected = 'OTP-19.3.6'
got = await setupBeam.getOTPVersion(spec, osVersion)
assert.deepStrictEqual(got, expected)

spec = '20'
osVersion = 'ubuntu-20.04'
expected = 'OTP-20.3.8'
got = await setupBeam.getOTPVersion(spec, osVersion)
assert.deepStrictEqual(got, expected)

spec = '20.x'
osVersion = 'ubuntu-20.04'
expected = 'OTP-20.3.8'
got = await setupBeam.getOTPVersion(spec, osVersion)
assert.deepStrictEqual(got, expected)

spec = '20.0'
osVersion = 'ubuntu-20.04'
expected = 'OTP-20.0.5'
got = await setupBeam.getOTPVersion(spec, osVersion)
assert.deepStrictEqual(got, expected)

spec = '20.0.x'
osVersion = 'ubuntu-20.04'
expected = 'OTP-20.0.5'
got = await setupBeam.getOTPVersion(spec, osVersion)
assert.deepStrictEqual(got, expected)
if (process.platform === 'linux') {
spec = '19.3.x'
osVersion = 'ubuntu-16.04'
expected = 'OTP-19.3.6'
got = await setupBeam.getOTPVersion(spec, osVersion)
assert.deepStrictEqual(got, expected)

spec = '^19.3.6'
osVersion = 'ubuntu-16.04'
expected = 'OTP-19.3.6'
got = await setupBeam.getOTPVersion(spec, osVersion)
assert.deepStrictEqual(got, expected)

spec = '^19.3'
osVersion = 'ubuntu-18.04'
expected = 'OTP-19.3.6'
got = await setupBeam.getOTPVersion(spec, osVersion)
assert.deepStrictEqual(got, expected)

spec = '20'
osVersion = 'ubuntu-20.04'
expected = 'OTP-20.3.8'
got = await setupBeam.getOTPVersion(spec, osVersion)
assert.deepStrictEqual(got, expected)

spec = '20.x'
osVersion = 'ubuntu-20.04'
expected = 'OTP-20.3.8'
got = await setupBeam.getOTPVersion(spec, osVersion)
assert.deepStrictEqual(got, expected)

spec = '20.0'
osVersion = 'ubuntu-20.04'
expected = 'OTP-20.0'
got = await setupBeam.getOTPVersion(spec, osVersion)
assert.deepStrictEqual(got, expected)

spec = '20.0.x'
osVersion = 'ubuntu-20.04'
expected = 'OTP-20.0.5'
got = await setupBeam.getOTPVersion(spec, osVersion)
assert.deepStrictEqual(got, expected)
}

if (process.platform === 'win32') {
spec = '24.0.1'
osVersion = 'windows-latest'
expected = '24.0.1'
got = await setupBeam.getOTPVersion(spec, osVersion)
assert.deepStrictEqual(got, expected)

spec = '23.2.x'
osVersion = 'windows-2016'
expected = '23.2.7'
got = await setupBeam.getOTPVersion(spec, osVersion)
assert.deepStrictEqual(got, expected)

spec = '23.0'
osVersion = 'windows-2019'
expected = '23.0'
got = await setupBeam.getOTPVersion(spec, osVersion)
assert.deepStrictEqual(got, expected)
}
}

async function testElixirVersions() {
Expand Down
Loading

0 comments on commit 82b4475

Please sign in to comment.