Skip to content

Commit ea54191

Browse files
authored
feat: Support install in windows (#4), require vfox 0.5.3+
* chore: fetch windows verrsions * feat: support windows platform * fix: windows install, ungly * chore(e2e): e2e test pull request * chore(e2e): speed up test * chore(e2e): test in windows * chore: fix e2e * chore: Invoke vfox * chore: e2e let it crash * chore: peek test env * fix: test in macos * chore: check windows test result * docs: update READMe * chore: fix test check in windows * chore: opt windows installation test
1 parent 9d4e73e commit ea54191

14 files changed

+26902
-34
lines changed

.github/workflows/e2e_test.yaml

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
matrix:
1616
# ref: https://github.com/actions/runner-images
17-
os: [ubuntu-20.04, macos-12]
17+
os: [ubuntu-20.04, macos-12, windows-2022]
1818
runs-on: ${{ matrix.os }}
1919
steps:
2020
- uses: actions/checkout@v4
@@ -31,16 +31,33 @@ jobs:
3131
run: |
3232
brew tap version-fox/tap
3333
brew install vfox
34-
34+
35+
- name: install scoop (Windows)
36+
if: runner.os == 'Windows'
37+
uses: MinoruSekine/setup-scoop@v3
38+
39+
- name: install vfox (Windows)
40+
if: runner.os == 'Windows'
41+
run: |
42+
scoop install vfox
43+
3544
- name: add vfox-erlang & vfox-elixir plugin
45+
if: runner.os != 'Windows'
3646
run: |
3747
vfox add --source https://github.com/version-fox/vfox-erlang/archive/refs/heads/main.zip erlang
38-
vfox add --source https://github.com/version-fox/vfox-elixir/archive/refs/heads/main.zip elixir
48+
vfox add --source https://github.com/version-fox/vfox-elixir/archive/${GITHUB_REF}.zip elixir
3949
40-
- name: install Erlang/OTP & Elixir by vfox-erlang & vfox-elixir plugin (Darwin)
50+
- name: add vfox-erlang & vfox-elixir plugin
51+
if: runner.os == 'Windows'
52+
run: |
53+
vfox add --source https://github.com/version-fox/vfox-erlang/archive/refs/heads/main.zip erlang
54+
vfox add --source https://github.com/version-fox/vfox-elixir/archive/$env:GITHUB_REF.zip elixir
55+
56+
- name: install Erlang/OTP & Elixir by vfox-erlang & vfox-elixir plugin (Linux)
4157
if: runner.os == 'Linux'
4258
run: |
4359
sudo apt-get -y install build-essential autoconf m4 libncurses5-dev libwxgtk3.0-gtk3-dev libwxgtk-webview3.0-gtk3-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev libssh-dev unixodbc-dev xsltproc fop libxml2-utils libncurses-dev openjdk-11-jdk
60+
export MAKEFLAGS=-j4
4461
vfox install erlang@26.2.3
4562
vfox use -g erlang@26.2.3
4663
eval "$(vfox activate bash)"
@@ -59,6 +76,7 @@ jobs:
5976
if: runner.os == 'MacOS'
6077
run: |
6178
brew install autoconf libxslt fop wxwidgets openssl
79+
export MAKEFLAGS=-j4
6280
vfox install erlang@26.2.3
6381
vfox use -g erlang@26.2.3
6482
eval "$(vfox activate bash)"
@@ -72,4 +90,29 @@ jobs:
7290
elixirc -v
7391
cd assets
7492
elixir hello.ex
75-
93+
94+
- name: install Erlang/OTP & Elixir by vfox-erlang & vfox-elixir plugin (Windows)
95+
if: runner.os == 'Windows'
96+
run: |
97+
vfox install erlang@26.2.3
98+
vfox use -g erlang@26.2.3
99+
Invoke-Expression "$(vfox activate pwsh)"
100+
echo "===============PATH==============="
101+
echo $env:PATH
102+
echo "===============PATH==============="
103+
& erl.exe -eval 'erlang:display({otp_release, erlang:system_info(otp_release)}), halt().' -noshell
104+
vfox install elixir@1.16.2-elixir-otp-26
105+
vfox use -g elixir@1.16.2-elixir-otp-26
106+
Invoke-Expression "$(vfox activate pwsh)"
107+
Get-Command iex.bat
108+
echo "===============PATH==============="
109+
echo $env:PATH
110+
echo "===============PATH==============="
111+
cd assets
112+
$result = elixirc.bat hello.ex
113+
if ($result -match "Hello world") {
114+
Write-Output "elixir installed successfully!"
115+
} else {
116+
Write-Output "elixir installed failed!"
117+
exit 1
118+
}

.github/workflows/update_elixir_versions.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
cd assets
2525
python -m pip install requests packaging
2626
python get_all_elixir_versions.py
27+
python get_all_elixir_win_versions.py
2728
2829
- name: Push updated version file
2930
run: |

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,15 @@ vfox use -g elixir@1.16.2
6969
```
7070

7171
You can reference the E2E test in MacOS 12: [https://github.com/version-fox/vfox-elixir/actions/workflows/e2e_test.yaml](https://github.com/version-fox/vfox-elixir/actions/workflows/e2e_test.yaml)
72+
73+
## install ELixir in Windows platform
74+
75+
You should use the v.0.5.3+ vfox version to add vfox-elixir plugin in Wondows platform. **Only support install Elixir versions after v1.15**, Elixir versions before v1.15 can also be installed using the deprecated [Online Elixir Installer](https://github.com/elixir-lang/elixir-windows-setup/releases/tag/v2.4).
76+
77+
```shell
78+
# Get avaliable version
79+
vfox search elixir
80+
81+
# install an specific version
82+
vfox use elixir@1.16.2-elixir-otp-26
83+
```

0 commit comments

Comments
 (0)