-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
140 lines (123 loc) · 4.09 KB
/
Copy pathcross_ci.yml
File metadata and controls
140 lines (123 loc) · 4.09 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
139
140
name: Cross CI
on:
push:
branches:
- master
paths-ignore:
- '**.md'
- '**.yml'
- '!**/cross_ci.yml'
- 'cmd/tools/**'
- '!cmd/tools/builders/**.v'
pull_request:
paths-ignore:
- '**.md'
- '**.yml'
- '!**/cross_ci.yml'
- 'cmd/tools/**'
- '!cmd/tools/builders/**.v'
concurrency:
group: cross-${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.sha || github.ref }}
cancel-in-progress: true
jobs:
cross-macos:
runs-on: macos-latest
timeout-minutes: 20
env:
VFLAGS: -cc clang
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 10
- name: Cache Homebrew downloads
uses: actions/cache@v5
with:
path: ~/Library/Caches/Homebrew
key: brew-cross-macos-${{ hashFiles('.github/workflows/cross_ci.yml') }}
restore-keys: |
brew-cross-macos-
- name: Build V
run: make -j4 && ./v symlink
- name: Install dependencies
run: |
./v retry -- brew install mingw-w64
export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/opt/openssl/lib/"
- 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 of veb app to Linux with -d use_openssl
run: ./v -d use_openssl -os linux examples/veb/veb_example.v
- name: Cross-compilation of vlang/gitly to Linux with -d use_openssl
run: |
./v retry -- ./v install markdown
./v retry -- ./v install pcre
./v retry -- git clone --depth 1 https://github.com/vlang/gitly /tmp/gitly
./v -d use_openssl -os linux /tmp/gitly
file /tmp/gitly/gitly
- name: Cross-compilation to Windows
run: |
./v -os windows cmd/v
./v -os windows examples/2048/2048.v
cross-linux:
runs-on: ubuntu-24.04
timeout-minutes: 20
env:
VFLAGS: -cc tcc -no-retry-compilation
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 10
- uses: ./.github/actions/cache-apt-packages-action
- name: Build v
run: make -j4 && ./v symlink
- name: Install dependencies
run: |
.github/workflows/disable_azure_mirror.sh
./v retry -- sudo apt update -y -qq
./v retry -- sudo apt install --quiet -y mingw-w64 wine wine64 winetricks libssl-dev sqlite3 libsqlite3-dev
- name: Show diagnostics for wine
run: |
which wine
# shellcheck disable=SC2046
ls -la $(realpath $(which wine))
- 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 -cc msvc -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 -lws2_32 -Wl,-stack=33554432
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
cross-windows:
runs-on: windows-2025
timeout-minutes: 20
steps:
- uses: actions/checkout@v6
- name: Build
run: |
echo %VFLAGS%
echo $VFLAGS
.\makev.bat -msvc
- name: TODO v_win.c can be compiled and run with -os windows
run: |
.\v.exe -os windows -cc msvc -showcc -o v2.exe cmd\v
.\v.exe -os windows -cc msvc -o v_win.c cmd\v
dir v2.exe
dir v_win.c
.\v2.exe version