-
Notifications
You must be signed in to change notification settings - Fork 3
138 lines (124 loc) · 4.27 KB
/
e2e_test.yaml
File metadata and controls
138 lines (124 loc) · 4.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: E2E tests
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
e2e_tests:
strategy:
matrix:
# ref: https://github.com/actions/runner-images
os: [ubuntu-latest, macos-latest, windows-latest]
lua_version: [5.5.0, 5.4.7, 5.3.6]
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 & install 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 & install 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: install readline lib (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get install libreadline-dev -y
- name: install readline lib (MacOS)
if: runner.os == 'MacOS'
run: |
brew install readline
- name: add vfox-lua plugin
if: runner.os == 'Windows'
run: |
vfox add --source https://github.com/${{ github.repository_owner }}/vfox-lua/archive/$env:GITHUB_REF.zip lua
- name: add vfox-lua plugin
if: runner.os != 'Windows'
run: |
vfox add --source https://github.com/${{ github.repository_owner }}/vfox-lua/archive/${GITHUB_REF}.zip lua
- name: install lua by vfox-lua plugin (Linux)
if: runner.os == 'Linux'
env:
LUA_VERSION: ${{ matrix.lua_version }}
run: |
vfox install lua@$LUA_VERSION
eval "$(vfox activate bash)"
vfox use -g lua@$LUA_VERSION
eval "$(vfox activate bash)"
echo "===============PATH==============="
echo $PATH
echo "===============PATH==============="
status=$(lua -v | grep $LUA_VERSION)
if [ -z "$status" ]; then
echo "Lua version is not $LUA_VERSION"
exit 1
else
echo "Lua version $LUA_VERSION installed successfully"
fi
- name: install lua by vfox-lua plugin (Darwin)
if: runner.os == 'MacOS'
env:
LUA_VERSION: ${{ matrix.lua_version }}
run: |
vfox install lua@$LUA_VERSION
eval "$(vfox activate bash)"
vfox use -g lua@$LUA_VERSION
eval "$(vfox activate bash)"
echo "===============PATH==============="
echo $PATH
echo "===============PATH==============="
status=$(lua -v | grep $LUA_VERSION)
if [ -z "$status" ]; then
echo "Lua version is not @$LUA_VERSION"
exit 1
else
echo "Lua version $LUA_VERSION installed successfully"
fi
- name: Setup MSYS2 (Windows)
uses: msys2/setup-msys2@v2
if: runner.os == 'Windows'
with:
msystem: MINGW64
update: true
install: >
mingw-w64-x86_64-gcc
mingw-w64-x86_64-make
- name: Verify GCC and Make installation (Windows)
shell: pwsh
if: runner.os == 'Windows'
run: |
gcc --version
make --version
- name: install Lua by vfox-lua plugin (Windows)
if: runner.os == 'Windows'
shell: pwsh
env:
LUA_VERSION: "${{ matrix.lua_version }}"
run: |
vfox install "lua@$env:LUA_VERSION"
Invoke-Expression "$(vfox activate pwsh)"
vfox use -g "lua@$env:LUA_VERSION"
Invoke-Expression "$(vfox activate pwsh)"
echo "===============PATH==============="
echo $env:PATH
echo "===============PATH==============="
$result=(lua.exe -v)
if ($result -match "Lua $env:LUA_VERSION") {
Write-Output "lua@$env:LUA_VERSION installed successfully!"
} else {
Write-Output "lua@$env:LUA_VERSION installed failed!"
exit 1
}