Repository navigation
118 lines (113 loc) · 3.57 KB
/
Copy pathlinux.yml
File metadata and controls
118 lines (113 loc) · 3.57 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
name: CI Linux
on:
workflow_call:
jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: webview
- name: Setup V
run: |
curl -Lo v_linux.zip https://github.com/vlang/v/releases/latest/download/v_linux.zip
unzip -o v_linux.zip
mv v ~/v && ~/v/v symlink
- name: Setup dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libgtk-3-dev libwebkit2gtk-4.0-dev
version: 1.0
- name: Setup V module
run: |
mkdir -p ~/.vmodules/ttytm && mv webview ~/.vmodules/ttytm/webview
~/.vmodules/ttytm/webview/build.vsh --silent
- name: Save cache
uses: actions/cache/save@v4
with:
path: |
~/v
~/.vmodules
key: ${{ runner.os }}-${{ github.sha }}
lint:
needs: setup
uses: ./.github/workflows/lint.yml
test:
needs: setup
runs-on: ubuntu-latest
strategy:
matrix:
cc: [tcc, gcc, clang]
optimization: ['', '-W -cstrict']
exclude:
- cc: tcc
optimization: '-W -cstrict'
- cc: clang
optimization: '-W -cstrict'
fail-fast: false
env:
VFLAGS: -cg -cc ${{ matrix.cc }} ${{ matrix.optimization }}
steps:
- name: Restore cache
uses: actions/cache/restore@v4
with:
path: |
~/v
~/.vmodules
key: ${{ runner.os }}-${{ github.sha }}
fail-on-cache-miss: true
- name: Setup V
run: ~/v/v symlink && v -showcc self && v doctor
- name: Setup dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libgtk-3-dev libwebkit2gtk-4.0-dev
version: 1.0
- name: Test
run: xvfb-run v -stats test ~/.vmodules/ttytm/webview/tests/
- name: Build examples
run: |
for example_dir in $(find ~/.vmodules/ttytm/webview/examples/* -maxdepth 0 -type d); do
cmd="v $example_dir/"
[[ "$example_dir" =~ .*"emoji-picker"$ ]] && cmd+="main.v"
echo "$cmd"
eval "$cmd"
done
test-sanitized:
if: false # Skip sanitzed tests until issues are addressed.
needs: setup
runs-on: ubuntu-latest
strategy:
matrix:
include:
- cc: gcc
sanitizer: address,leak,undefined,shift,shift-exponent,shift-base,integer-divide-by-zero,unreachable,vla-bound,null,return,signed-integer-overflow,bounds,bounds-strict,alignment,object-size,float-divide-by-zero,float-cast-overflow,nonnull-attribute,returns-nonnull-attribute,bool,enum,vptr
- cc: gcc
sanitizer: thread
- cc: clang
sanitizer: address,leak,undefined
- cc: clang
sanitizer: thread
- cc: clang
sanitizer: memory
fail-fast: false
env:
VFLAGS: -cg -cc ${{ matrix.cc }}
steps:
- name: Restore cache
uses: actions/cache/restore@v4
with:
path: |
~/v
~/.vmodules
key: ${{ runner.os }}-${{ github.sha }}
fail-on-cache-miss: true
- name: Setup V
run: ~/v/v symlink && v -showcc self && v doctor
- name: Setup dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libgtk-3-dev libwebkit2gtk-4.0-dev
version: 1.0
- name: Test
run: xvfb-run v -stats -cflags -fsanitize=${{ matrix.sanitizer }} test ~/.vmodules/ttytm/webview/tests/