1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

ci: split cross compilation jobs to their own ci_cross.yml file

This commit is contained in:
Delyan Angelov 2021-04-13 13:40:37 +03:00
parent e5a52edd6b
commit a31e265317
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
2 changed files with 103 additions and 43 deletions

View File

@ -169,6 +169,13 @@ jobs:
sudo apt-get install --quiet -y xfonts-75dpi xfonts-base
- name: Build v
run: make
- name: v.c can be compiled and run with -os cross
run: |
./v -os cross -o /tmp/v.c cmd/v
gcc -g -std=gnu11 -w -o v_from_vc /tmp/v.c -lm -lpthread
ls -lart v_from_vc
./v_from_vc version
- name: Ensure v up works
run: |
@ -199,8 +206,7 @@ jobs:
./sokol-shdc --input $f.glsl --output $f.h --slang glsl330 ; \
done
for vfile in examples/sokol/0?*/*.v; do echo "compiling $vfile ..."; ./v $vfile ; done
## C++
- name: Install C++ dependencies
run: |
sudo apt-get install --quiet -y postgresql libpq-dev libssl-dev sqlite3 libsqlite3-dev
@ -215,43 +221,13 @@ jobs:
## - name: Running tests with g++
## run: ./v -cc g++-9 -silent test-self
## Cross compilation
- name: Install dependencies
run: |
sudo apt install --quiet -y mingw-w64 wine-stable winetricks
- name: Build V
run: make -j4
- name: v.c can be compiled and run
run: |
./v -os cross -o /tmp/v.c cmd/v
gcc -g -std=gnu11 -w -o v_from_vc /tmp/v.c -lm -lpthread
ls -lart v_from_vc
./v_from_vc version
- name: turn off the wine crash dialog
run: winetricks nocrashdialog
- name: v_win.c can be compiled and run
run: |
./v -os windows -o /tmp/v_win.c cmd/v
x86_64-w64-mingw32-gcc /tmp/v_win.c -std=c99 -w -municode -o v_from_vc.exe
ls -lart v_from_vc.exe
wine v_from_vc.exe version
- 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
wine examples/hello_world.exe
- name: 2048.v can be cross compiled to 2048.exe
run: |
./v -os windows examples/2048/2048.v
ls -lart examples/2048/2048.exe
# Alpine docker pre-built container
alpine-docker-musl-gcc:
name: alpine-musl
runs-on: ubuntu-20.04
timeout-minutes: 45
container:
# Alpine docker pre-built container
image: thevlang/vlang:alpine-build
env:
V_CI_MUSL: 1
@ -320,10 +296,13 @@ jobs:
run: |
./v cmd/tools/test_if_v_test_system_works.v
./cmd/tools/test_if_v_test_system_works
- name: Self tests
run: VJOBS=1 ./v -silent test-self
- name: Build examples
run: ./v build-examples
- name: Build examples with -autofree
run: |
./v -autofree -o tetris examples/tetris/tetris.v
@ -331,21 +310,14 @@ jobs:
- name: v doctor
run: |
./v doctor
- name: Cross-compilation to Linux
run: |
./v -os linux cmd/v
# TODO: fix this: ./v -os linux examples/2048/2048.v
- name: Cross-compilation to Windows
run: |
./v -os windows cmd/v
./v -os windows examples/2048/2048.v
# - name: Test vsh
# run: ./v examples/v_script.vsh
- name: Test ved
run: |
git clone --depth 1 https://github.com/vlang/ved
cd ved && ../v -o ved .
../v -autofree .
cd ..
- name: Build V UI examples
run: |
git clone --depth 1 https://github.com/vlang/ui

88
.github/workflows/ci_cross.yml vendored Normal file
View File

@ -0,0 +1,88 @@
name: Cross CI
on:
push:
paths-ignore:
- "**.md"
pull_request:
paths-ignore:
- "**.md"
jobs:
macos:
runs-on: macOS-latest
timeout-minutes: 15
env:
VFLAGS: -cc clang
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 10
- name: Install dependencies
run: |
brew install mingw-w64
export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/opt/openssl/lib/"
- name: Build V
run: make
- name: Test symlink
run: ./v symlink
- name: Cross-compilation to Linux
run: |
./v -os linux cmd/v
# TODO: fix this: ./v -os linux examples/2048/2048.v
- name: Cross-compilation to Windows
run: |
./v -os windows cmd/v
./v -os windows examples/2048/2048.v
linux:
runs-on: ubuntu-20.04
timeout-minutes: 15
env:
VFLAGS: -cc tcc -no-retry-compilation
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 10
- name: Install dependencies
run: |
sudo apt-get install --quiet -y libssl-dev sqlite3 libsqlite3-dev valgrind
sudo apt-get install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libasound2-dev libgl-dev
sudo apt-get install --quiet -y xfonts-75dpi xfonts-base
sudo apt-get install --quiet -y mingw-w64 wine-stable winetricks
- name: Turn off the wine crash dialog
run: winetricks nocrashdialog
- name: Build v
run: make
- name: v.c can be compiled and run with -os cross
run: |
./v -os cross -o /tmp/v.c cmd/v
gcc -g -std=gnu11 -w -o v_from_vc /tmp/v.c -lm -lpthread
ls -lart v_from_vc
./v_from_vc version
- name: v_win.c can be compiled and run with -os windows
run: |
./v -os windows -o /tmp/v_win.c cmd/v
x86_64-w64-mingw32-gcc /tmp/v_win.c -std=c99 -w -municode -o v_from_vc.exe
ls -lart v_from_vc.exe
wine v_from_vc.exe version
- 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
wine examples/hello_world.exe
- name: 2048.v can be cross compiled to 2048.exe
run: |
./v -os windows examples/2048/2048.v
ls -lart examples/2048/2048.exe