ci: improve ci_cross.yml

pull/12550/head
Delyan Angelov 2021-11-22 16:36:26 +02:00
parent 759f3d28b7
commit 1bbbba5813
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 13 additions and 11 deletions

View File

@ -19,23 +19,23 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
fetch-depth: 10 fetch-depth: 10
- name: Install dependencies - name: Install dependencies
run: | run: |
brew install mingw-w64 brew install mingw-w64
export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/opt/openssl/lib/" export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/opt/openssl/lib/"
- name: Build V - name: Build V
run: make run: make
- name: Test symlink - name: Test symlink
run: ./v symlink run: ./v symlink
- name: Cross-compilation to Linux - name: Cross-compilation to Linux
run: | run: |
./v -os linux cmd/v ./v -os linux cmd/v
# TODO: fix this: ./v -os linux examples/2048/2048.v # TODO: fix this: ./v -os linux examples/2048/2048.v
- name: Cross-compilation to Windows - name: Cross-compilation to Windows
run: | run: |
./v -os windows cmd/v ./v -os windows cmd/v
@ -52,35 +52,36 @@ jobs:
fetch-depth: 10 fetch-depth: 10
- name: Install dependencies - name: Install dependencies
run: | run: |
sudo dpkg --add-architecture i386
sudo apt update sudo apt update
sudo apt-get install --quiet -y libssl-dev sqlite3 libsqlite3-dev valgrind sudo apt-get install --quiet -y libssl-dev sqlite3 libsqlite3-dev
sudo apt-get install --quiet -y mingw-w64 wine-stable winetricks sudo apt-get install --quiet -y mingw-w64 wine-stable winetricks wine32
- name: Turn off the wine crash dialog - name: Turn off the wine crash dialog
run: winetricks nocrashdialog run: winetricks nocrashdialog
- name: Build v - name: Build v
run: make run: make
- name: v.c can be compiled and run with -os cross - name: v.c can be compiled and run with -os cross
run: | run: |
./v -os cross -o /tmp/v.c cmd/v ./v -os cross -o /tmp/v.c cmd/v
gcc -g -std=gnu11 -I ./thirdparty/stdatomic/nix -w -o v_from_vc /tmp/v.c -lm -lpthread gcc -g -std=gnu11 -I ./thirdparty/stdatomic/nix -w -o v_from_vc /tmp/v.c -lm -lpthread
ls -lart v_from_vc ls -lart v_from_vc
./v_from_vc version ./v_from_vc version
- name: v_win.c can be compiled and run with -os windows - name: v_win.c can be compiled and run with -os windows
run: | run: |
./v -os windows -o /tmp/v_win.c cmd/v ./v -os windows -o /tmp/v_win.c cmd/v
x86_64-w64-mingw32-gcc -I ./thirdparty/stdatomic/win /tmp/v_win.c -std=c99 -w -municode -o v_from_vc.exe x86_64-w64-mingw32-gcc -I ./thirdparty/stdatomic/win /tmp/v_win.c -std=c99 -w -municode -o v_from_vc.exe
ls -lart v_from_vc.exe ls -lart v_from_vc.exe
wine v_from_vc.exe version wine v_from_vc.exe version
- name: hello_world.v can be cross compiled to hello_world.exe - name: hello_world.v can be cross compiled to hello_world.exe
run: | run: |
./v -os windows examples/hello_world.v ./v -os windows examples/hello_world.v
ls -lart examples/hello_world.exe ls -lart examples/hello_world.exe
wine examples/hello_world.exe wine examples/hello_world.exe
- name: 2048.v can be cross compiled to 2048.exe - name: 2048.v can be cross compiled to 2048.exe
run: | run: |
./v -os windows examples/2048/2048.v ./v -os windows examples/2048/2048.v
@ -104,3 +105,4 @@ jobs:
.\v.exe -os windows -o v_win.c cmd\v .\v.exe -os windows -o v_win.c cmd\v
dir v2.exe dir v2.exe
dir v_win.c dir v_win.c
.\v2.exe version