Skip to content

Commit

Permalink
feat: Support install in windows (#4), require vfox 0.5.3+
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
yeshan333 authored Jun 18, 2024
1 parent 9d4e73e commit ea54191
Show file tree
Hide file tree
Showing 14 changed files with 26,902 additions and 34 deletions.
53 changes: 48 additions & 5 deletions .github/workflows/e2e_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
# ref: https://github.com/actions/runner-images
os: [ubuntu-20.04, macos-12]
os: [ubuntu-20.04, macos-12, windows-2022]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand All @@ -31,16 +31,33 @@ jobs:
run: |
brew tap version-fox/tap
brew install vfox
- name: install scoop (Windows)
if: runner.os == 'Windows'
uses: MinoruSekine/setup-scoop@v3

- name: install vfox (Windows)
if: runner.os == 'Windows'
run: |
scoop install vfox
- name: add vfox-erlang & vfox-elixir plugin
if: runner.os != 'Windows'
run: |
vfox add --source https://github.com/version-fox/vfox-erlang/archive/refs/heads/main.zip erlang
vfox add --source https://github.com/version-fox/vfox-elixir/archive/refs/heads/main.zip elixir
vfox add --source https://github.com/version-fox/vfox-elixir/archive/${GITHUB_REF}.zip elixir
- name: install Erlang/OTP & Elixir by vfox-erlang & vfox-elixir plugin (Darwin)
- name: add vfox-erlang & vfox-elixir plugin
if: runner.os == 'Windows'
run: |
vfox add --source https://github.com/version-fox/vfox-erlang/archive/refs/heads/main.zip erlang
vfox add --source https://github.com/version-fox/vfox-elixir/archive/$env:GITHUB_REF.zip elixir
- name: install Erlang/OTP & Elixir by vfox-erlang & vfox-elixir plugin (Linux)
if: runner.os == 'Linux'
run: |
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
export MAKEFLAGS=-j4
vfox install [email protected]
vfox use -g [email protected]
eval "$(vfox activate bash)"
Expand All @@ -59,6 +76,7 @@ jobs:
if: runner.os == 'MacOS'
run: |
brew install autoconf libxslt fop wxwidgets openssl
export MAKEFLAGS=-j4
vfox install [email protected]
vfox use -g [email protected]
eval "$(vfox activate bash)"
Expand All @@ -72,4 +90,29 @@ jobs:
elixirc -v
cd assets
elixir hello.ex
- name: install Erlang/OTP & Elixir by vfox-erlang & vfox-elixir plugin (Windows)
if: runner.os == 'Windows'
run: |
vfox install [email protected]
vfox use -g [email protected]
Invoke-Expression "$(vfox activate pwsh)"
echo "===============PATH==============="
echo $env:PATH
echo "===============PATH==============="
& erl.exe -eval 'erlang:display({otp_release, erlang:system_info(otp_release)}), halt().' -noshell
vfox install [email protected]
vfox use -g [email protected]
Invoke-Expression "$(vfox activate pwsh)"
Get-Command iex.bat
echo "===============PATH==============="
echo $env:PATH
echo "===============PATH==============="
cd assets
$result = elixirc.bat hello.ex
if ($result -match "Hello world") {
Write-Output "elixir installed successfully!"
} else {
Write-Output "elixir installed failed!"
exit 1
}
1 change: 1 addition & 0 deletions .github/workflows/update_elixir_versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
cd assets
python -m pip install requests packaging
python get_all_elixir_versions.py
python get_all_elixir_win_versions.py
- name: Push updated version file
run: |
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,15 @@ vfox use -g [email protected]
```

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)

## install ELixir in Windows platform

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).

```shell
# Get avaliable version
vfox search elixir

# install an specific version
vfox use [email protected]
```
Loading

0 comments on commit ea54191

Please sign in to comment.