2021-04-13 12:40:37 +02:00
|
|
|
name: Cross CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths-ignore:
|
|
|
|
- "**.md"
|
|
|
|
pull_request:
|
|
|
|
paths-ignore:
|
|
|
|
- "**.md"
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
2021-04-17 18:31:29 +02:00
|
|
|
macos-cross:
|
2021-04-13 12:40:37 +02:00
|
|
|
runs-on: macOS-latest
|
2022-02-24 11:04:04 +01:00
|
|
|
timeout-minutes: 25
|
2021-04-13 12:40:37 +02:00
|
|
|
env:
|
|
|
|
VFLAGS: -cc clang
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 10
|
2021-11-22 15:36:26 +01:00
|
|
|
|
2021-04-13 12:40:37 +02:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
brew install mingw-w64
|
|
|
|
export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/opt/openssl/lib/"
|
2021-11-22 15:36:26 +01:00
|
|
|
|
2021-04-13 12:40:37 +02:00
|
|
|
- name: Build V
|
|
|
|
run: make
|
|
|
|
|
|
|
|
- name: Test symlink
|
|
|
|
run: ./v symlink
|
2021-11-22 15:36:26 +01:00
|
|
|
|
2021-04-13 12:40:37 +02:00
|
|
|
- name: Cross-compilation to Linux
|
|
|
|
run: |
|
|
|
|
./v -os linux cmd/v
|
|
|
|
# TODO: fix this: ./v -os linux examples/2048/2048.v
|
2021-11-22 15:36:26 +01:00
|
|
|
|
2021-04-13 12:40:37 +02:00
|
|
|
- name: Cross-compilation to Windows
|
|
|
|
run: |
|
|
|
|
./v -os windows cmd/v
|
|
|
|
./v -os windows examples/2048/2048.v
|
|
|
|
|
2022-01-07 15:57:05 +01:00
|
|
|
- name: Compile to raw Android (non-graphic) compatible
|
|
|
|
run: |
|
|
|
|
# Test that V can compile non-graphic app to Android compatible code *without* using the -apk flag
|
|
|
|
./v -os android examples/toml.v
|
|
|
|
|
2021-04-17 18:31:29 +02:00
|
|
|
linux-cross:
|
2021-04-13 12:40:37 +02:00
|
|
|
runs-on: ubuntu-20.04
|
2022-02-24 11:04:04 +01:00
|
|
|
timeout-minutes: 25
|
2021-04-13 12:40:37 +02:00
|
|
|
env:
|
|
|
|
VFLAGS: -cc tcc -no-retry-compilation
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 10
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2021-11-22 15:59:11 +01:00
|
|
|
## sudo dpkg --add-architecture i386
|
2021-05-08 12:02:36 +02:00
|
|
|
sudo apt update
|
2021-11-22 15:36:26 +01:00
|
|
|
sudo apt-get install --quiet -y libssl-dev sqlite3 libsqlite3-dev
|
2021-11-22 15:59:11 +01:00
|
|
|
sudo apt-get install --quiet -y mingw-w64 wine-stable winetricks
|
|
|
|
## sudo apt-get install --quiet -y wine32
|
2021-04-13 12:40:37 +02:00
|
|
|
- name: Turn off the wine crash dialog
|
|
|
|
run: winetricks nocrashdialog
|
2021-11-22 15:36:26 +01:00
|
|
|
|
2021-04-13 12:40:37 +02:00
|
|
|
- name: Build v
|
|
|
|
run: make
|
2021-11-22 15:36:26 +01:00
|
|
|
|
2021-04-13 12:40:37 +02:00
|
|
|
- name: v.c can be compiled and run with -os cross
|
|
|
|
run: |
|
|
|
|
./v -os cross -o /tmp/v.c cmd/v
|
2022-04-20 23:12:50 +02:00
|
|
|
gcc -g -std=gnu11 -w -o v_from_vc /tmp/v.c -lm -lpthread
|
2021-04-13 12:40:37 +02:00
|
|
|
ls -lart v_from_vc
|
|
|
|
./v_from_vc version
|
2021-11-22 15:36:26 +01:00
|
|
|
|
2021-04-13 12:40:37 +02:00
|
|
|
- name: v_win.c can be compiled and run with -os windows
|
|
|
|
run: |
|
2022-04-14 12:28:46 +02:00
|
|
|
./v -cc msvc -os windows -o /tmp/v_win.c cmd/v
|
2022-04-20 23:12:50 +02:00
|
|
|
x86_64-w64-mingw32-gcc /tmp/v_win.c -std=c99 -w -municode -o v_from_vc.exe
|
2021-04-13 12:40:37 +02:00
|
|
|
ls -lart v_from_vc.exe
|
2021-11-22 15:59:11 +01:00
|
|
|
wine64 ./v_from_vc.exe version
|
2021-11-22 15:36:26 +01:00
|
|
|
|
2021-04-13 12:40:37 +02:00
|
|
|
- name: hello_world.v can be cross compiled to hello_world.exe
|
|
|
|
run: |
|
|
|
|
./v -os windows examples/hello_world.v
|
|
|
|
ls -lart examples/hello_world.exe
|
2021-11-22 15:59:11 +01:00
|
|
|
wine64 examples/hello_world.exe
|
2021-11-22 15:36:26 +01:00
|
|
|
|
2021-04-13 12:40:37 +02:00
|
|
|
- name: 2048.v can be cross compiled to 2048.exe
|
|
|
|
run: |
|
|
|
|
./v -os windows examples/2048/2048.v
|
|
|
|
ls -lart examples/2048/2048.exe
|
2021-04-17 18:31:29 +02:00
|
|
|
|
2022-01-07 15:57:05 +01:00
|
|
|
- name: toml.v can be compiled to raw Android C
|
|
|
|
run: |
|
|
|
|
# Test that V can compile non-graphic app to Android compatible code *without* using the -apk flag
|
|
|
|
./v -os android examples/toml.v
|
|
|
|
|
|
|
|
|
2021-04-17 18:31:29 +02:00
|
|
|
windows-cross:
|
|
|
|
runs-on: windows-2019
|
2022-02-24 11:04:04 +01:00
|
|
|
timeout-minutes: 25
|
2021-04-17 18:31:29 +02:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
echo %VFLAGS%
|
|
|
|
echo $VFLAGS
|
2021-09-28 12:11:55 +02:00
|
|
|
.\make.bat -msvc
|
2021-04-17 18:31:29 +02:00
|
|
|
- name: TODO v_win.c can be compiled and run with -os windows
|
|
|
|
run: |
|
2022-04-14 12:28:46 +02:00
|
|
|
.\v.exe -os windows -cc msvc -showcc -o v2.exe cmd\v
|
|
|
|
.\v.exe -os windows -cc msvc -o v_win.c cmd\v
|
2021-04-17 18:31:29 +02:00
|
|
|
dir v2.exe
|
|
|
|
dir v_win.c
|
2021-11-22 15:36:26 +01:00
|
|
|
.\v2.exe version
|