1name: Test prebuilt binaries
2on:
3  release:
4    types: [edited, published]
5jobs:
6  ubuntu:
7    runs-on: ubuntu-latest
8    steps:
9    - name: Install dependencies
10      run: |
11        sudo apt-get update
12        sudo apt-get install --quiet -y postgresql libpq-dev libglfw3 libglfw3-dev libfreetype6-dev libssl-dev sqlite3 libsqlite3-dev valgrind
13        ## sudo apt-get install --quiet -y libsdl2-dev libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev
14    - name: Download V
15      run: |
16        tag=${GITHUB_REF##*/}
17        wget https://github.com/vlang/v/releases/download/$tag/v_linux.zip
18        unzip v_linux.zip
19        ./v -version
20    - name: Test V
21      run: |
22        ./v run examples/hello_world.v
23
24  macos:
25    runs-on: macOS-latest
26    steps:
27    - name: Install dependencies
28      run: |
29        brew install freetype glfw openssl
30        # brew install sdl2 sdl2_ttf sdl2_mixer sdl2_image
31        export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/opt/openssl/lib/"
32    - name: Download V
33      run: |
34        tag=${GITHUB_REF##*/}
35        wget https://github.com/vlang/v/releases/download/$tag/v_macos.zip
36        unzip v_macos.zip
37        ./v -version
38    - name: Test V
39      run: |
40        ./v run examples/hello_world.v
41
42  windows:
43    runs-on: windows-latest
44    steps:
45    - name: Download V
46      run: |
47        Set-Variable -Name "tag" -Value $env:GITHUB_REF.split("/", 3)[-1]
48        & curl -L https://github.com/vlang/v/releases/download/$tag/v_windows.zip -o v_windows.zip
49        & unzip .\v_windows.zip
50        & .\v.exe -version
51    - name: Test V
52      run: |
53        & .\v.exe run .\examples\hello_world.v
54