2021-04-13 13:24:01 +03:00
|
|
|
name: Sanitized CI
|
|
|
|
|
2021-07-30 11:37:07 +03:00
|
|
|
## Running these jobs is slow (over ~1 hour, sometimes even 2)
|
|
|
|
## so we run them only when there is a chance that the generated
|
|
|
|
## C code could have changed, or for some critical vlib modules,
|
|
|
|
## like `builtin`, `os`, `sync`, where they have demonstrated
|
|
|
|
## their usefulness by catching actual very hard to find bugs.
|
|
|
|
## The cost of this selective running is delayed feedback when
|
|
|
|
## there are bugs in other V modules.
|
|
|
|
## The positive is *much faster CI runs* for most V contributors,
|
|
|
|
## that make PRs that are not concerning V itself, or the critical
|
|
|
|
## V modules.
|
|
|
|
|
2021-04-13 13:24:01 +03:00
|
|
|
on:
|
|
|
|
push:
|
2022-05-14 15:38:15 +03:00
|
|
|
branches: [master]
|
2021-07-30 11:10:37 +03:00
|
|
|
paths:
|
2022-05-12 23:29:37 +03:00
|
|
|
- '!**'
|
|
|
|
- 'cmd/tools/vtest*'
|
2022-05-13 12:24:11 +03:00
|
|
|
- 'cmd/tools/builders/**.v'
|
2022-05-12 23:29:37 +03:00
|
|
|
- 'vlib/builtin/**.v'
|
|
|
|
- 'vlib/strconv/**.v'
|
|
|
|
- 'vlib/strings/**.v'
|
|
|
|
- 'vlib/math/**.v'
|
|
|
|
- 'vlib/math/big/**.v'
|
|
|
|
- 'vlib/arrays/**.v'
|
|
|
|
- 'vlib/datatypes/**.v'
|
|
|
|
- 'vlib/os/**.v'
|
|
|
|
- 'vlib/sync/**.v'
|
|
|
|
- 'vlib/v/tests/**.v'
|
|
|
|
- 'vlib/v/ast/**.v'
|
|
|
|
- 'vlib/v/scanner/**.v'
|
|
|
|
- 'vlib/v/parser/**.v'
|
|
|
|
- 'vlib/v/checker/**.v'
|
|
|
|
- 'vlib/v/gen/c/**.v'
|
|
|
|
- 'vlib/v/builder/**.v'
|
|
|
|
- 'vlib/v/cflag/**.v'
|
|
|
|
- 'vlib/v/live/**.v'
|
|
|
|
- 'vlib/v/util/**.v'
|
|
|
|
- 'vlib/v/markused/**.v'
|
|
|
|
- 'vlib/v/preludes/**.v'
|
|
|
|
- 'vlib/v/embed_file/**.v'
|
2021-04-13 13:24:01 +03:00
|
|
|
pull_request:
|
2021-07-30 11:10:37 +03:00
|
|
|
paths:
|
2022-05-12 23:29:37 +03:00
|
|
|
- '!**'
|
|
|
|
- 'cmd/tools/vtest*'
|
2022-05-13 12:24:11 +03:00
|
|
|
- 'cmd/tools/builders/**.v'
|
2022-05-12 23:29:37 +03:00
|
|
|
- 'vlib/builtin/**.v'
|
|
|
|
- 'vlib/strconv/**.v'
|
|
|
|
- 'vlib/strings/**.v'
|
|
|
|
- 'vlib/math/**.v'
|
|
|
|
- 'vlib/math/big/**.v'
|
|
|
|
- 'vlib/arrays/**.v'
|
|
|
|
- 'vlib/datatypes/**.v'
|
|
|
|
- 'vlib/os/**.v'
|
|
|
|
- 'vlib/sync/**.v'
|
|
|
|
- 'vlib/v/tests/**.v'
|
|
|
|
- 'vlib/v/ast/**.v'
|
|
|
|
- 'vlib/v/scanner/**.v'
|
|
|
|
- 'vlib/v/parser/**.v'
|
|
|
|
- 'vlib/v/checker/**.v'
|
|
|
|
- 'vlib/v/gen/c/**.v'
|
|
|
|
- 'vlib/v/builder/**.v'
|
|
|
|
- 'vlib/v/cflag/**.v'
|
|
|
|
- 'vlib/v/live/**.v'
|
|
|
|
- 'vlib/v/util/**.v'
|
|
|
|
- 'vlib/v/markused/**.v'
|
|
|
|
- 'vlib/v/preludes/**.v'
|
|
|
|
- 'vlib/v/embed_file/**.v'
|
2021-04-13 13:24:01 +03:00
|
|
|
|
2021-12-21 19:55:02 +03:00
|
|
|
concurrency:
|
2022-01-24 15:36:42 +03:00
|
|
|
group: build-sanitized-${{ github.event.pull_request.number || github.sha }}
|
2021-12-21 19:55:02 +03:00
|
|
|
cancel-in-progress: true
|
2021-07-26 15:55:09 +03:00
|
|
|
|
2021-12-21 19:55:02 +03:00
|
|
|
jobs:
|
2022-05-14 15:38:15 +03:00
|
|
|
code-formatting-before-regression:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
timeout-minutes: 15
|
|
|
|
env:
|
|
|
|
VFLAGS: -cc gcc
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Environment info
|
|
|
|
run: echo $VFLAGS $GITHUB_SHA $GITHUB_REF
|
|
|
|
- name: Build local v
|
|
|
|
run: make -j4
|
|
|
|
- name: v test-cleancode
|
|
|
|
run: ./v test-cleancode
|
|
|
|
- name: v test-fmt
|
|
|
|
run: ./v test-fmt
|
|
|
|
|
2021-04-13 13:24:01 +03:00
|
|
|
tests-sanitize-undefined-clang:
|
2022-05-14 15:38:15 +03:00
|
|
|
needs: [code-formatting-before-regression]
|
2021-04-13 13:24:01 +03:00
|
|
|
runs-on: ubuntu-20.04
|
2021-07-29 16:29:53 +03:00
|
|
|
timeout-minutes: 180
|
2021-04-13 13:24:01 +03:00
|
|
|
env:
|
|
|
|
VFLAGS: -cc clang
|
2021-04-14 18:43:52 +03:00
|
|
|
VJOBS: 1
|
|
|
|
VTEST_SHOW_START: 1
|
2021-04-13 13:24:01 +03:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 12.x
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2021-07-14 09:22:24 +03:00
|
|
|
sudo apt-get update
|
2021-04-13 13:24:01 +03:00
|
|
|
sudo apt-get install --quiet -y postgresql libpq-dev libssl-dev sqlite3 libsqlite3-dev valgrind
|
2021-05-08 13:32:29 +03:00
|
|
|
sudo apt-get install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libgl-dev
|
2021-04-13 13:24:01 +03:00
|
|
|
sudo apt-get install clang
|
|
|
|
- name: Build V
|
2022-05-14 15:38:15 +03:00
|
|
|
run: make -j4 && ./v -cg -cstrict -o v cmd/v
|
2021-04-13 13:24:01 +03:00
|
|
|
- name: Self tests (-fsanitize=undefined)
|
|
|
|
run: ./v -cflags "-fsanitize=undefined" -o v2 cmd/v && ./v2 -cflags -fsanitize=undefined test-self
|
|
|
|
- name: Build examples (V compiled with -fsanitize=undefined)
|
|
|
|
run: ./v2 build-examples
|
|
|
|
|
|
|
|
tests-sanitize-undefined-gcc:
|
2022-05-14 15:38:15 +03:00
|
|
|
needs: [code-formatting-before-regression]
|
2021-04-13 13:24:01 +03:00
|
|
|
runs-on: ubuntu-20.04
|
2021-07-29 16:29:53 +03:00
|
|
|
timeout-minutes: 180
|
2021-04-13 13:24:01 +03:00
|
|
|
env:
|
|
|
|
VFLAGS: -cc gcc
|
2021-04-14 18:43:52 +03:00
|
|
|
VJOBS: 1
|
|
|
|
VTEST_SHOW_START: 1
|
2021-04-13 13:24:01 +03:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 12.x
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2021-05-08 13:02:36 +03:00
|
|
|
sudo apt update
|
2021-04-13 13:24:01 +03:00
|
|
|
sudo apt-get install --quiet -y postgresql libpq-dev libssl-dev sqlite3 libsqlite3-dev valgrind
|
2021-05-08 13:32:29 +03:00
|
|
|
sudo apt-get install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libgl-dev
|
2021-04-13 13:24:01 +03:00
|
|
|
- name: Build V
|
2022-05-14 15:38:15 +03:00
|
|
|
run: make -j4 && ./v -cg -cstrict -o v cmd/v
|
2021-04-13 13:24:01 +03:00
|
|
|
- name: Self tests (-fsanitize=undefined)
|
|
|
|
run: ./v -cflags "-fsanitize=undefined" -o v2 cmd/v && ./v2 -cflags -fsanitize=undefined test-self
|
|
|
|
- name: Build examples (V compiled with -fsanitize=undefined)
|
|
|
|
run: ./v2 build-examples
|
|
|
|
|
|
|
|
tests-sanitize-address-clang:
|
2022-05-14 15:38:15 +03:00
|
|
|
needs: [code-formatting-before-regression]
|
2021-04-13 13:24:01 +03:00
|
|
|
runs-on: ubuntu-20.04
|
2021-07-29 16:29:53 +03:00
|
|
|
timeout-minutes: 180
|
2021-04-13 13:24:01 +03:00
|
|
|
env:
|
|
|
|
VFLAGS: -cc clang
|
2021-04-14 18:43:52 +03:00
|
|
|
VJOBS: 1
|
|
|
|
VTEST_SHOW_START: 1
|
2021-04-13 13:24:01 +03:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 12.x
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2021-05-08 13:02:36 +03:00
|
|
|
sudo apt update
|
2021-04-13 13:24:01 +03:00
|
|
|
sudo apt-get install --quiet -y postgresql libpq-dev libssl-dev sqlite3 libsqlite3-dev valgrind
|
2021-05-08 13:32:29 +03:00
|
|
|
sudo apt-get install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libgl-dev
|
2021-04-13 13:24:01 +03:00
|
|
|
sudo apt-get install clang
|
|
|
|
- name: Build V
|
2022-05-14 15:38:15 +03:00
|
|
|
run: make -j4 && ./v -cg -cstrict -o v cmd/v
|
2021-04-13 13:24:01 +03:00
|
|
|
- name: Self tests (-fsanitize=address)
|
|
|
|
run: ASAN_OPTIONS=detect_leaks=0 ./v -cflags "-fsanitize=address,pointer-compare,pointer-subtract" test-self
|
|
|
|
- name: Self tests (V compiled with -fsanitize=address)
|
2022-05-12 23:29:37 +03:00
|
|
|
run:
|
|
|
|
./v -cflags -fsanitize=address -o v cmd/v &&
|
2021-04-13 13:24:01 +03:00
|
|
|
ASAN_OPTIONS=detect_leaks=0 ./v -cc tcc test-self -asan-compiler
|
|
|
|
- name: Build examples (V compiled with -fsanitize=address)
|
|
|
|
run: ASAN_OPTIONS=detect_leaks=0 ./v build-examples
|
|
|
|
|
|
|
|
tests-sanitize-address-msvc:
|
2022-05-14 15:38:15 +03:00
|
|
|
needs: [code-formatting-before-regression]
|
2021-04-13 13:24:01 +03:00
|
|
|
runs-on: windows-2019
|
2021-07-29 16:29:53 +03:00
|
|
|
timeout-minutes: 180
|
2021-04-13 13:24:01 +03:00
|
|
|
env:
|
|
|
|
VFLAGS: -cc msvc
|
2021-04-14 18:43:52 +03:00
|
|
|
VJOBS: 1
|
|
|
|
VTEST_SHOW_START: 1
|
2021-04-13 13:24:01 +03:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 12.x
|
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
echo %VFLAGS%
|
|
|
|
echo $VFLAGS
|
|
|
|
.\make.bat -msvc
|
2021-09-18 12:08:09 +03:00
|
|
|
.\v.exe self
|
2022-05-13 12:24:11 +03:00
|
|
|
.\v.exe test-cleancode
|
2021-09-18 15:11:39 +03:00
|
|
|
## - name: Install dependencies
|
|
|
|
## run: |
|
|
|
|
## .\v.exe setup-freetype
|
|
|
|
## .\.github\workflows\windows-install-sqlite.bat
|
|
|
|
## - name: Self tests (TODO: /fsanitize=address)
|
|
|
|
## run: |
|
|
|
|
## .\v.exe -cflags "/fsanitize=address" test-self
|
2021-04-13 13:24:01 +03:00
|
|
|
|
|
|
|
tests-sanitize-address-gcc:
|
2022-05-14 15:38:15 +03:00
|
|
|
needs: [code-formatting-before-regression]
|
2021-04-13 13:24:01 +03:00
|
|
|
runs-on: ubuntu-20.04
|
2021-07-29 16:29:53 +03:00
|
|
|
timeout-minutes: 180
|
2021-04-13 13:24:01 +03:00
|
|
|
env:
|
|
|
|
VFLAGS: -cc gcc
|
2021-04-14 18:43:52 +03:00
|
|
|
VJOBS: 1
|
|
|
|
VTEST_SHOW_START: 1
|
2021-04-13 13:24:01 +03:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 12.x
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2021-05-08 13:02:36 +03:00
|
|
|
sudo apt update
|
2021-04-13 13:24:01 +03:00
|
|
|
sudo apt-get install --quiet -y postgresql libpq-dev libssl-dev sqlite3 libsqlite3-dev valgrind
|
2021-05-08 13:32:29 +03:00
|
|
|
sudo apt-get install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libgl-dev
|
2021-04-13 13:24:01 +03:00
|
|
|
sudo apt-get install clang
|
|
|
|
- name: Build V
|
2022-05-14 15:38:15 +03:00
|
|
|
run: make -j4 && ./v -cg -cstrict -o v cmd/v &&
|
2021-04-13 13:24:01 +03:00
|
|
|
- name: Self tests (-fsanitize=address)
|
|
|
|
run: ASAN_OPTIONS=detect_leaks=0 ./v -cflags -fsanitize=address test-self
|
|
|
|
- name: Self tests (V compiled with -fsanitize=address)
|
|
|
|
run:
|
|
|
|
./v -cflags -fsanitize=address,pointer-compare,pointer-subtract -o v cmd/v &&
|
|
|
|
ASAN_OPTIONS=detect_leaks=0 ./v -cc tcc test-self -asan-compiler
|
|
|
|
- name: Build examples (V compiled with -fsanitize=address)
|
|
|
|
run: ASAN_OPTIONS=detect_leaks=0 ./v build-examples
|
|
|
|
|
|
|
|
tests-sanitize-memory-clang:
|
2022-05-14 15:38:15 +03:00
|
|
|
needs: [code-formatting-before-regression]
|
2021-04-13 13:24:01 +03:00
|
|
|
runs-on: ubuntu-20.04
|
2021-07-29 16:29:53 +03:00
|
|
|
timeout-minutes: 180
|
2021-04-13 13:24:01 +03:00
|
|
|
env:
|
|
|
|
VFLAGS: -cc clang
|
2021-04-14 18:43:52 +03:00
|
|
|
VJOBS: 1
|
|
|
|
VTEST_SHOW_START: 1
|
2021-04-13 13:24:01 +03:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 12.x
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2021-05-08 13:02:36 +03:00
|
|
|
sudo apt update
|
2021-04-13 13:24:01 +03:00
|
|
|
sudo apt-get install --quiet -y postgresql libpq-dev libssl-dev sqlite3 libsqlite3-dev valgrind
|
2021-05-08 13:32:29 +03:00
|
|
|
sudo apt-get install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libgl-dev
|
2021-04-13 13:24:01 +03:00
|
|
|
sudo apt-get install clang
|
|
|
|
- name: Build V
|
2022-05-14 15:38:15 +03:00
|
|
|
run: make -j4 && ./v -cc clang -cg -cstrict -o v cmd/v
|
2021-04-13 13:24:01 +03:00
|
|
|
- name: Self tests (-fsanitize=memory)
|
|
|
|
run: ./v -cflags -fsanitize=memory test-self
|
|
|
|
- name: Self tests (V compiled with -fsanitize=memory)
|
2022-05-12 23:29:37 +03:00
|
|
|
run:
|
|
|
|
./v -cflags -fsanitize=memory -o v cmd/v && ./v -cc tcc test-self -msan-compiler
|
2021-04-13 13:24:01 +03:00
|
|
|
- name: Build examples (V compiled with -fsanitize=memory)
|
|
|
|
run: ./v build-examples
|