Skip to content

vfox E2E tests

vfox E2E tests #708

Workflow file for this run

name: vfox E2E tests
on:
push:
branches: [main]
paths: ['lib']
pull_request:
paths: ['lib']
workflow_dispatch:
schedule:
# Runs at 12am UTC
- cron: '0 0 * * *'
jobs:
e2e_tests:
strategy:
matrix:
# ref: https://github.com/actions/runner-images
os: [ubuntu-22.04, macos-latest, windows-2022]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '^1.24.2' # The Go version to download (if necessary) and use.
- name: build vfox (Unix-like)
if: runner.os != 'Windows'
run: |
git clone https://github.com/version-fox/vfox.git
cd vfox
go build -o vfox
chmod +x vfox
cp vfox /usr/local/bin
- name: build vfox (Windows)
if: runner.os == 'Windows'
run: |
git clone https://github.com/version-fox/vfox.git
cd vfox
go build -o vfox.exe
echo "$pwd" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
./vfox.exe -version
- 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/${GITHUB_REF}.zip elixir
- 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 update -y
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 erlang@26.2.3
eval "$(vfox activate bash)"
vfox use -g erlang@26.2.3
eval "$(vfox activate bash)"
which erl
echo "===============PATH==============="
echo $PATH
echo "===============PATH==============="
vfox install elixir@1.16.2
eval "$(vfox activate bash)"
vfox use -g elixir@1.16.2
eval "$(vfox activate bash)"
elixirc -v
cd assets
elixir hello.ex
- name: download a pre-built Elixir version from hex.pm
if: runner.os == 'Linux'
run: |
eval "$(vfox activate bash)"
vfox use -g erlang@26.2.3
eval "$(vfox activate bash)"
which erl
echo "===============PATH==============="
echo $PATH
echo "===============PATH==============="
VFOX_ELIXIR_MIRROR=hex vfox install elixir@main-otp-26
VFOX_ELIXIR_MIRROR=hex vfox use -g elixir@main-otp-26
eval "$(vfox activate bash)"
elixirc -v
cd assets
elixir hello.ex
- name: install Erlang/OTP & Elixir by vfox-erlang & vfox-elixir plugin (Darwin)
if: runner.os == 'MacOS'
run: |
brew install autoconf libxslt fop wxwidgets openssl
export MAKEFLAGS=-j4
vfox install erlang@26.2.3
eval "$(vfox activate bash)"
vfox use -g erlang@26.2.3
eval "$(vfox activate bash)"
which erl
echo "===============PATH==============="
echo $PATH
echo "===============PATH==============="
vfox install elixir@1.16.2
vfox use -g elixir@1.16.2
eval "$(vfox activate bash)"
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 erlang@26.2.3
Invoke-Expression "$(vfox activate pwsh)"
vfox use -g erlang@26.2.3
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 elixir@1.16.2-elixir-otp-26
vfox use -g elixir@1.16.2-elixir-otp-26
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
}