From 638b267e4e6cfa28d0638598641d422a55e8e735 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Fri, 13 May 2022 12:24:11 +0300 Subject: [PATCH] ci: add a quick `v test-cleancode` check, before more costlier tasks --- .github/workflows/ci.yml | 71 +++++++++++++++--------------- .github/workflows/ci_sanitized.yml | 15 ++++--- 2 files changed, 44 insertions(+), 42 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d987bedfd..fcca993f42 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,6 +33,7 @@ jobs: run: | echo $VFLAGS make + ./v test-cleancode ./v -d debug_malloc -d debug_realloc -o v cmd/v ./v -cg -cstrict -o v cmd/v # Test v -realloc arena allocation @@ -609,40 +610,40 @@ jobs: ## run: .\v.exe -o v2.exe cmd/v && .\v2.exe -o v3.exe cmd/v - # ubuntu-autofree-selfcompile: - # runs-on: ubuntu-20.04 - # timeout-minutes: 121 - # env: - # VFLAGS: -cc gcc - # steps: - # - uses: actions/checkout@v2 - # - name: Build V - # run: make -j4 - # - name: V self compilation with -autofree - # run: ./v -o v2 -autofree cmd/v && ./v2 -o v3 -autofree cmd/v && ./v3 -o v4 -autofree cmd/v +# ubuntu-autofree-selfcompile: +# runs-on: ubuntu-20.04 +# timeout-minutes: 121 +# env: +# VFLAGS: -cc gcc +# steps: +# - uses: actions/checkout@v2 +# - name: Build V +# run: make -j4 +# - name: V self compilation with -autofree +# run: ./v -o v2 -autofree cmd/v && ./v2 -o v3 -autofree cmd/v && ./v3 -o v4 -autofree cmd/v - # ubuntu-musl: - # runs-on: ubuntu-20.04 - # timeout-minutes: 121 - # env: - # VFLAGS: -cc musl-gcc - # V_CI_MUSL: 1 - # steps: - # - uses: actions/checkout@v2 - # - uses: actions/setup-node@v1 - # with: - # node-version: 12.x - # - name: Install dependencies - # run: | - # sudo apt-get install --quiet -y musl musl-tools libssl-dev sqlite3 libsqlite3-dev valgrind - # - name: Build v - # run: echo $VFLAGS && make -j4 && ./v -cg -o v cmd/v - # # - name: Test v binaries - # # run: ./v build-vbinaries - # ## - name: Test v->js - # ## run: ./v -o hi.js examples/hello_v_js.v && node hi.js - # - name: quick debug - # run: ./v -stats vlib/strconv/format_test.v - # - name: Self tests - # run: ./v test-self +# ubuntu-musl: +# runs-on: ubuntu-20.04 +# timeout-minutes: 121 +# env: +# VFLAGS: -cc musl-gcc +# V_CI_MUSL: 1 +# steps: +# - uses: actions/checkout@v2 +# - uses: actions/setup-node@v1 +# with: +# node-version: 12.x +# - name: Install dependencies +# run: | +# sudo apt-get install --quiet -y musl musl-tools libssl-dev sqlite3 libsqlite3-dev valgrind +# - name: Build v +# run: echo $VFLAGS && make -j4 && ./v -cg -o v cmd/v +# # - name: Test v binaries +# # run: ./v build-vbinaries +# ## - name: Test v->js +# ## run: ./v -o hi.js examples/hello_v_js.v && node hi.js +# - name: quick debug +# run: ./v -stats vlib/strconv/format_test.v +# - name: Self tests +# run: ./v test-self diff --git a/.github/workflows/ci_sanitized.yml b/.github/workflows/ci_sanitized.yml index 1e0a86ba16..8a738aab0c 100644 --- a/.github/workflows/ci_sanitized.yml +++ b/.github/workflows/ci_sanitized.yml @@ -16,7 +16,7 @@ on: paths: - '!**' - 'cmd/tools/vtest*' - - 'cmd/tools/builders/**.v' + - 'cmd/tools/builders/**.v' - 'vlib/builtin/**.v' - 'vlib/strconv/**.v' - 'vlib/strings/**.v' @@ -43,7 +43,7 @@ on: paths: - '!**' - 'cmd/tools/vtest*' - - 'cmd/tools/builders/**.v' + - 'cmd/tools/builders/**.v' - 'vlib/builtin/**.v' - 'vlib/strconv/**.v' - 'vlib/strings/**.v' @@ -91,7 +91,7 @@ jobs: sudo apt-get install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libgl-dev sudo apt-get install clang - name: Build V - run: make -j4 && ./v -cg -cstrict -o v cmd/v + run: make -j4 && ./v -cg -cstrict -o v cmd/v && ./v test-cleancode - 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) @@ -115,7 +115,7 @@ jobs: sudo apt-get install --quiet -y postgresql libpq-dev libssl-dev sqlite3 libsqlite3-dev valgrind sudo apt-get install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libgl-dev - name: Build V - run: make -j4 && ./v -cg -cstrict -o v cmd/v + run: make -j4 && ./v -cg -cstrict -o v cmd/v && ./v test-cleancode - 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) @@ -140,7 +140,7 @@ jobs: sudo apt-get install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libgl-dev sudo apt-get install clang - name: Build V - run: make -j4 && ./v -cg -cstrict -o v cmd/v + run: make -j4 && ./v -cg -cstrict -o v cmd/v && ./v test-cleancode - 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) @@ -168,6 +168,7 @@ jobs: echo $VFLAGS .\make.bat -msvc .\v.exe self + .\v.exe test-cleancode ## - name: Install dependencies ## run: | ## .\v.exe setup-freetype @@ -195,7 +196,7 @@ jobs: sudo apt-get install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libgl-dev sudo apt-get install clang - name: Build V - run: make -j4 && ./v -cg -cstrict -o v cmd/v + run: make -j4 && ./v -cg -cstrict -o v cmd/v && ./v test-cleancode - 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) @@ -224,7 +225,7 @@ jobs: sudo apt-get install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libgl-dev sudo apt-get install clang - name: Build V - run: make -j4 && ./v -cc clang -cg -cstrict -o v cmd/v + run: make -j4 && ./v -cc clang -cg -cstrict -o v cmd/v && ./v test-cleancode - name: Self tests (-fsanitize=memory) run: ./v -cflags -fsanitize=memory test-self - name: Self tests (V compiled with -fsanitize=memory)