-
-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (93 loc) · 2.64 KB
/
linux.yml
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
name: Linux CI
on:
workflow_call:
jobs:
setup:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Setup V
run: |
curl -LO https://github.com/vlang/v/releases/latest/download/v_linux.zip
unzip -o v_linux.zip
mv v ~/v
~/v/v symlink && v -showcc self && v doctor
- uses: actions/checkout@v4
with:
path: vibe
- name: Setup V module
run: |
mv vibe ~/.vmodules/vibe
~/.vmodules/vibe/curl/setup.vsh --silent
- name: Save cache
uses: actions/cache/save@v4
with:
path: |
~/v
~/.vmodules
key: ${{ matrix.os }}-${{ github.sha }}
lint:
needs: setup
uses: ./.github/workflows/lint.yml
test:
needs: setup
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-latest]
cc: [tcc, gcc, clang]
optimization: ['', '-W -cstrict']
exclude:
- cc: tcc
optimization: '-W -cstrict'
fail-fast: false
runs-on: ${{ matrix.os }}
env:
VFLAGS: -cg -cc ${{ matrix.cc }} ${{ matrix.optimization }}
steps:
- name: Restore cache
uses: actions/cache/restore@v4
with:
path: |
~/v
~/.vmodules
key: ${{ matrix.os }}-${{ github.sha }}
fail-on-cache-miss: true
- name: Setup V
run: ~/v/v symlink
- name: Run tests
run: v -stats test ~/.vmodules/vibe
test-sanitzed:
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: ubuntu-latest-${{ github.sha }}
fail-on-cache-miss: true
- name: Setup V
run: ~/v/v symlink
- name: Run tests
run: v -cflags -fsanitize=${{ matrix.sanitizer }} -stats test ~/.vmodules/vibe