Add Windows to the mix (#49)

82b4475 · Paulo F. Oliveira · 2021-06-24 20:58

26 files +565 -180

Files changed

modified .eslintrc.yml
+13 −10
@@ -6,14 +6,17 @@ extends:
6 6 - airbnb
7 7 parserOptions:
8 8 ecmaVersion: 12
9 rules: {
10 indent: ["warn", 2],
11 max-len: ["warn", 100],
12 no-console: 0,
13 no-undef: "error",
14 no-unused-vars: ["error", {"varsIgnorePattern": "^_"}],
15 no-use-before-define: 0,
16 operator-linebreak: 0,
17 require-jsdoc: 0,
9 +rules:
10 + indent: ["warn", 2]
11 + max-len: ["warn", 100]
12 + no-console: 0
13 + no-undef: "error"
14 + no-unused-vars: ["error", {"varsIgnorePattern": "^_"}]
15 + no-use-before-define: 0
16 + operator-linebreak: 0
17 + require-jsdoc: 0
18 18 semi: 0
19 }
19 +
20 +settings:
21 + react:
22 + version: 999.999.999
modified .github/workflows/ci.yml
+1 −1
@@ -21,12 +21,12 @@ jobs:
21 21 - run: npm install -g npm
22 22 - run: npm install
23 23 - run: npm run build
24 + - run: npm run format
24 25 - run: npm install -g markdownlint-cli
25 26 - run: npm run markdownlint
26 27 - run: npm run shellcheck
27 28 - run: npm run yamllint
28 29 - run: npm run jslint
29 30 - run: npm run licenses
30 - run: npm run format
31 31 - name: Check if build left artifacts
32 32 run: git diff --exit-code
modified .github/workflows/test.yml
+47 −5
@@ -2,10 +2,12 @@
2 2 name: test
3 3
4 4 on:
5 push: {branches: main}
6 pull_request: {branches: main}
7 repository_dispatch:
8 workflow_dispatch:
5 + push:
6 + branches:
7 + - main
8 + pull_request:
9 + branches:
10 + - main
9 11
10 12 jobs:
11 13 unit_test:
@@ -18,7 +20,7 @@ jobs:
18 20 - run: npm ci
19 21 - run: npm test
20 22
21 integration_test:
23 + integration_test_ubuntu:
22 24 name: >
23 25 Pre-release integration tests
24 26 (Ubuntu ${{matrix.combo.os}},
@@ -136,3 +138,43 @@ jobs:
136 138 cd test-projects/rebar3
137 139 rebar3 ct
138 140 if: ${{matrix.combo.rebar3-version}}
141 +
142 + integration_test_windows:
143 + name: >
144 + Pre-release integration tests
145 + (Windows ${{matrix.combo.os}},
146 + Erlang/OTP ${{matrix.combo.otp-version}},
147 + rebar3 ${{matrix.combo.rebar3-version}})
148 + runs-on: ${{matrix.combo.os}}
149 + strategy:
150 + fail-fast: false
151 + matrix:
152 + combo:
153 + - otp-version: '24.0.2'
154 + rebar3-version: '3.16'
155 + os: 'windows-2019'
156 + - otp-version: '23.0'
157 + rebar3-version: '3.15'
158 + os: 'windows-2019'
159 + - otp-version: '24.0.2'
160 + rebar3-version: '3.16'
161 + os: 'windows-2016'
162 + - otp-version: '23.0'
163 + rebar3-version: '3.15'
164 + os: 'windows-2016'
165 + steps:
166 + - uses: actions/checkout@v2
167 + - name: Use erlef/setup-beam
168 + id: setup-beam
169 + uses: ./
170 + with:
171 + otp-version: ${{matrix.combo.otp-version}}
172 + rebar3-version: ${{matrix.combo.rebar3-version}}
173 + - name: Erlang/OTP version (action)
174 + run: echo "Erlang/OTP ${{steps.setup-beam.outputs.otp-version}}"
175 + - name: rebar3 version (action)
176 + run: echo "rebar3 ${{steps.setup-beam.outputs.rebar3-version}}"
177 + - name: Run rebar3 project tests
178 + run: |
179 + cd test-projects/rebar3
180 + rebar3 ct
modified README.md
+20 −0
@@ -45,6 +45,8 @@ and Erlang/OTP.
45 45 | ubuntu-16.04 | 17 - 24 | ✅
46 46 | ubuntu-18.04 | 17 - 24 | ✅
47 47 | ubuntu-20.04 | 20 - 24 | ✅
48 +| windows-2016 | 23 - 24 | ✅
49 +| windows-2019 | 23 - 24 | ✅
48 50
49 51 ### Basic example (Elixir)
50 52
@@ -130,6 +132,24 @@ jobs:
130 132 - run: rebar3 ct
131 133 ```
132 134
135 +### Basic example (`rebar3` on Windows 2016)
136 +
137 +```yaml
138 +# create this in .github/workflows/ci.yml
139 +on: push
140 +
141 +jobs:
142 + test:
143 + runs-on: windows-2019
144 + steps:
145 + - uses: actions/checkout@v2
146 + - uses: erlef/setup-beam@v1
147 + with:
148 + otp-version: '24.0.2'
149 + rebar3-version: '3.16.1'
150 + - run: rebar3 ct
151 +```
152 +
133 153 ## Elixir Problem Matchers
134 154
135 155 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.
modified __tests__/setup-beam.test.js
+63 −41
@@ -81,47 +81,69 @@ async function testOTPVersions() {
81 81 let spec
82 82 let osVersion
83 83
84 spec = '19.3.x'
85 osVersion = 'ubuntu-16.04'
86 expected = 'OTP-19.3.6'
87 got = await setupBeam.getOTPVersion(spec, osVersion)
88 assert.deepStrictEqual(got, expected)
89
90 spec = '^19.3.6'
91 osVersion = 'ubuntu-16.04'
92 expected = 'OTP-19.3.6'
93 got = await setupBeam.getOTPVersion(spec, osVersion)
94 assert.deepStrictEqual(got, expected)
95
96 spec = '^19.3'
97 osVersion = 'ubuntu-18.04'
98 expected = 'OTP-19.3.6'
99 got = await setupBeam.getOTPVersion(spec, osVersion)
100 assert.deepStrictEqual(got, expected)
101
102 spec = '20'
103 osVersion = 'ubuntu-20.04'
104 expected = 'OTP-20.3.8'
105 got = await setupBeam.getOTPVersion(spec, osVersion)
106 assert.deepStrictEqual(got, expected)
107
108 spec = '20.x'
109 osVersion = 'ubuntu-20.04'
110 expected = 'OTP-20.3.8'
111 got = await setupBeam.getOTPVersion(spec, osVersion)
112 assert.deepStrictEqual(got, expected)
113
114 spec = '20.0'
115 osVersion = 'ubuntu-20.04'
116 expected = 'OTP-20.0.5'
117 got = await setupBeam.getOTPVersion(spec, osVersion)
118 assert.deepStrictEqual(got, expected)
119
120 spec = '20.0.x'
121 osVersion = 'ubuntu-20.04'
122 expected = 'OTP-20.0.5'
123 got = await setupBeam.getOTPVersion(spec, osVersion)
124 assert.deepStrictEqual(got, expected)
84 + if (process.platform === 'linux') {
85 + spec = '19.3.x'
86 + osVersion = 'ubuntu-16.04'
87 + expected = 'OTP-19.3.6'
88 + got = await setupBeam.getOTPVersion(spec, osVersion)
89 + assert.deepStrictEqual(got, expected)
90 +
91 + spec = '^19.3.6'
92 + osVersion = 'ubuntu-16.04'
93 + expected = 'OTP-19.3.6'
94 + got = await setupBeam.getOTPVersion(spec, osVersion)
95 + assert.deepStrictEqual(got, expected)
96 +
97 + spec = '^19.3'
98 + osVersion = 'ubuntu-18.04'
99 + expected = 'OTP-19.3.6'
100 + got = await setupBeam.getOTPVersion(spec, osVersion)
101 + assert.deepStrictEqual(got, expected)
102 +
103 + spec = '20'
104 + osVersion = 'ubuntu-20.04'
105 + expected = 'OTP-20.3.8'
106 + got = await setupBeam.getOTPVersion(spec, osVersion)
107 + assert.deepStrictEqual(got, expected)
108 +
109 + spec = '20.x'
110 + osVersion = 'ubuntu-20.04'
111 + expected = 'OTP-20.3.8'
112 + got = await setupBeam.getOTPVersion(spec, osVersion)
113 + assert.deepStrictEqual(got, expected)
114 +
115 + spec = '20.0'
116 + osVersion = 'ubuntu-20.04'
117 + expected = 'OTP-20.0'
118 + got = await setupBeam.getOTPVersion(spec, osVersion)
119 + assert.deepStrictEqual(got, expected)
120 +
121 + spec = '20.0.x'
122 + osVersion = 'ubuntu-20.04'
123 + expected = 'OTP-20.0.5'
124 + got = await setupBeam.getOTPVersion(spec, osVersion)
125 + assert.deepStrictEqual(got, expected)
126 + }
127 +
128 + if (process.platform === 'win32') {
129 + spec = '24.0.1'
130 + osVersion = 'windows-latest'
131 + expected = '24.0.1'
132 + got = await setupBeam.getOTPVersion(spec, osVersion)
133 + assert.deepStrictEqual(got, expected)
134 +
135 + spec = '23.2.x'
136 + osVersion = 'windows-2016'
137 + expected = '23.2.7'
138 + got = await setupBeam.getOTPVersion(spec, osVersion)
139 + assert.deepStrictEqual(got, expected)
140 +
141 + spec = '23.0'
142 + osVersion = 'windows-2019'
143 + expected = '23.0'
144 + got = await setupBeam.getOTPVersion(spec, osVersion)
145 + assert.deepStrictEqual(got, expected)
146 + }
125 147 }
126 148
127 149 async function testElixirVersions() {
modified dist/index.js
+161 −60

Click to load diff…

added dist/install-elixir.ps1
+5 −0

Click to load diff…

renamed
+0 −0

Click to load diff…

added dist/install-otp.ps1
+19 −0

Click to load diff…

renamed
+0 −0

Click to load diff…

added dist/install-rebar3.ps1
+24 −0

Click to load diff…

renamed
+0 −0

Click to load diff…

modified package.json
+1 −1

Click to load diff…

added src/install-elixir.ps1
+5 −0

Click to load diff…

renamed
+0 −0

Click to load diff…

added src/install-otp.ps1
+19 −0

Click to load diff…

renamed
+0 −0

Click to load diff…

added src/install-rebar3.ps1
+24 −0

Click to load diff…

renamed
+0 −0

Click to load diff…

modified src/installer.js
+25 −5

Click to load diff…

modified src/setup-beam.js
+135 −54

Click to load diff…

Parents: dd4eb24