From c5c49a818bfe6b4785e6b844f17960bbed079478 Mon Sep 17 00:00:00 2001 From: Turiiya <34311583+ttytm@users.noreply.github.com> Date: Tue, 10 Oct 2023 02:11:54 +0200 Subject: [PATCH 1/5] ci: use superordinate workflow for platform code ci --- .cirrus.yml | 2 +- .github/workflows/code_ci.yml | 33 ++++++++ .github/workflows/linux_ci.yml | 128 +++++++++++++----------------- .github/workflows/macos_ci.yml | 57 ++++++------- .github/workflows/platform_ci.yml | 33 ++++++++ .github/workflows/windows_ci.yml | 116 ++++++++++++--------------- 6 files changed, 199 insertions(+), 170 deletions(-) create mode 100644 .github/workflows/code_ci.yml create mode 100644 .github/workflows/platform_ci.yml diff --git a/.cirrus.yml b/.cirrus.yml index 670fe81f153acc..8495c3c726ec0e 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,6 +1,6 @@ env: LANG: en_US.UTF-8 - + freebsd_instance: image_family: freebsd-13-0 diff --git a/.github/workflows/code_ci.yml b/.github/workflows/code_ci.yml new file mode 100644 index 00000000000000..e40ee2d275a62b --- /dev/null +++ b/.github/workflows/code_ci.yml @@ -0,0 +1,33 @@ +name: Code CI + +on: + push: + paths-ignore: + - '**.md' + - '**.yml' + - '!**/code_ci.yml' + - '!**/linux_ci.yml' + - '!**/macos_ci.yml' + - '!**/windows_ci.yml' + pull_request: + paths-ignore: + - '**.md' + - '**.yml' + - '!**/code_ci.yml' + - '!**/linux_ci.yml' + - '!**/macos_ci.yml' + - '!**/windows_ci.yml' + +concurrency: + group: platform-ci-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + +jobs: + linux: + uses: ./.github/workflows/linux_ci.yml + + macos: + uses: ./.github/workflows/macos_ci.yml + + windows: + uses: ./.github/workflows/windows_ci.yml diff --git a/.github/workflows/linux_ci.yml b/.github/workflows/linux_ci.yml index 362a2514540521..253a421f03d523 100644 --- a/.github/workflows/linux_ci.yml +++ b/.github/workflows/linux_ci.yml @@ -1,21 +1,10 @@ -name: Code CI Linux +name: CI Linux on: - push: - paths-ignore: - - "**.md" - - "**.yml" - pull_request: - paths-ignore: - - "**.md" - - "**.yml" - -concurrency: - group: build-ci-linux-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true + workflow_call: jobs: - ubuntu-tcc: + tcc: runs-on: ubuntu-20.04 if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v' timeout-minutes: 121 @@ -28,7 +17,7 @@ jobs: sudo apt-get update sudo apt-get install --quiet -y libssl-dev sqlite3 libsqlite3-dev valgrind sudo apt-get install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libgl-dev - ## The following is needed for examples/wkhtmltopdf.v + # The following is needed for examples/wkhtmltopdf.v wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb sudo apt-get install --quiet -y xfonts-75dpi xfonts-base sudo apt-get install --quiet -y expect @@ -46,7 +35,7 @@ jobs: run: | thirdparty/tcc/tcc.exe -version ./v -cg -o v cmd/v # Make sure vtcc can build itself twice - # ./v test-all + # ./v test-all - name: v self compilation run: ./v -o v2 cmd/v && ./v2 -o v3 cmd/v && ./v3 -o v4 cmd/v - name: v self compilation with -skip-unused @@ -107,7 +96,7 @@ jobs: ./v examples/readline/readline_ci.v ./v examples/readline/readline.vsh - ubuntu-tcc-boehm-gc: + tcc-boehm-gc: runs-on: ubuntu-20.04 if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v' timeout-minutes: 121 @@ -121,7 +110,7 @@ jobs: sudo apt-get install --quiet -y libssl-dev sqlite3 libsqlite3-dev valgrind sudo apt-get install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libgl-dev sudo apt-get install --quiet -y libgc-dev - ## The following is needed for examples/wkhtmltopdf.v + # The following is needed for examples/wkhtmltopdf.v wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb sudo apt-get install --quiet -y xfonts-75dpi xfonts-base sudo dpkg -i wkhtmltox_0.12.6-1.focal_amd64.deb @@ -164,7 +153,7 @@ jobs: ./testcase_leak 2>leaks.txt [ "$(stat -c %s leaks.txt)" = "0" ] - ubuntu: + gcc: runs-on: ubuntu-20.04 if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v' timeout-minutes: 121 @@ -185,14 +174,14 @@ jobs: ./v -o v3 cmd/v -cflags "-fsanitize=undefined -fno-sanitize=alignment" UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ./v2 -o v.c cmd/v UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ./v3 -o v.c cmd/v - # - name: Test V - # run: ./v test-all - # - 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: Build Vorum - # run: git clone --depth 1 https://github.com/vlang/vorum && cd vorum && ../v . && cd .. + # - name: Test V + # run: ./v test-all + # - 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: Build Vorum + # run: git clone --depth 1 https://github.com/vlang/vorum && cd vorum && ../v . && cd .. - name: Build vpm run: ./v install markdown && git clone --depth 1 https://github.com/vlang/vpm && cd vpm && ../v . || ../v cmd/vpm && cd .. - name: Freestanding @@ -259,21 +248,20 @@ jobs: echo "Building it..." ../../vprod -backend native -o 1m 1m.v echo "Running it..." + # ./1m ls - name: compile vdoctor.v with -skip-unused and -prod run: ./v -showcc -skip-unused -cc gcc -prod cmd/tools/vdoctor.v - name: compile vup.v with -skip-unused and -prod run: ./v -showcc -skip-unused -cc gcc -prod cmd/tools/vup.v + # - run: cd examples/native && ../../v -native hello_world.v && ./hello_world + # - name: Coveralls GitHub Action + # uses: coverallsapp/github-action@v1.0.1 + # with: + # github-token: ${{ secrets.GITHUB_TOKEN }} - # ./1m - # run: echo "TODO" #cd examples/native && ../../v -native hello_world.v && ./hello_world - # - name: Coveralls GitHub Action - # uses: coverallsapp/github-action@v1.0.1 - # with: - # github-token: ${{ secrets.GITHUB_TOKEN }} - - ubuntu-clang: + clang: runs-on: ubuntu-20.04 if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v' timeout-minutes: 121 @@ -363,40 +351,38 @@ jobs: echo "Running it..." ls + # autofree-selfcompile: + # runs-on: ubuntu-20.04 + # if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v' + # timeout-minutes: 121 + # env: + # VFLAGS: -cc gcc + # steps: + # - uses: actions/checkout@v3 + # - 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 -# if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v' -# timeout-minutes: 121 -# env: -# VFLAGS: -cc gcc -# steps: -# - uses: actions/checkout@v3 -# - 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 -# if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v' -# timeout-minutes: 121 -# env: -# VFLAGS: -cc musl-gcc -# V_CI_MUSL: 1 -# steps: -# - uses: actions/checkout@v3 -# - 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 + # musl: + # runs-on: ubuntu-20.04 + # if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v' + # timeout-minutes: 121 + # env: + # VFLAGS: -cc musl-gcc + # V_CI_MUSL: 1 + # steps: + # - uses: actions/checkout@v3 + # - 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/macos_ci.yml b/.github/workflows/macos_ci.yml index 778cda84f04214..582f6b2af94673 100644 --- a/.github/workflows/macos_ci.yml +++ b/.github/workflows/macos_ci.yml @@ -1,21 +1,10 @@ -name: Code CI macos +name: CI macOS on: - push: - paths-ignore: - - "**.md" - - "**.yml" - pull_request: - paths-ignore: - - "**.md" - - "**.yml" - -concurrency: - group: build-ci-macos-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true + workflow_call: jobs: - macos: + clang: runs-on: macOS-12 if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v' timeout-minutes: 121 @@ -42,18 +31,18 @@ jobs: run: ./v symlink - name: Build vpm run: ./v install markdown && git clone --depth 1 https://github.com/vlang/vpm && cd vpm && ../v . || ../v cmd/vpm && cd .. - # - name: Set up pg database - # run: | - # pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start - # psql -d postgres -c 'select rolname from pg_roles' - # psql -d postgres -c 'create database customerdb;' - # psql -d customerdb -f examples/database/pg/mydb.sql - # - name: Test v->c - # run: ./v test-all - # - 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: Set up pg database + # run: | + # pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start + # psql -d postgres -c 'select rolname from pg_roles' + # psql -d postgres -c 'create database customerdb;' + # psql -d customerdb -f examples/database/pg/mydb.sql + # - name: Test v->c + # run: ./v test-all + # - 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: Verify `v test` works run: | echo $VFLAGS @@ -84,14 +73,14 @@ jobs: ../v -autofree . ../v -prod . cd .. -# - name: Test c2v -# run: | -# git clone --depth 1 https://github.com/vlang/c2v -# cd c2v && ../v -o c2v . -# ../v . -# ../v run tests/run_tests.vsh -# ../v -experimental -w c2v_test.v -# cd .. + # - name: Test c2v + # run: | + # git clone --depth 1 https://github.com/vlang/c2v + # cd c2v && ../v -o c2v . + # ../v . + # ../v run tests/run_tests.vsh + # ../v -experimental -w c2v_test.v + # cd .. - name: Build V UI examples run: | git clone --depth 1 https://github.com/vlang/ui diff --git a/.github/workflows/platform_ci.yml b/.github/workflows/platform_ci.yml new file mode 100644 index 00000000000000..1e28c41a31b0b4 --- /dev/null +++ b/.github/workflows/platform_ci.yml @@ -0,0 +1,33 @@ +name: Code CI + +on: + push: + paths-ignore: + - '**.md' + - '**.yml' + - '!**/platform_ci.yml' + - '!**/linux_ci.yml' + - '!**/macos_ci.yml' + - '!**/windows_ci.yml' + pull_request: + paths-ignore: + - '**.md' + - '**.yml' + - '!**/platform_ci.yml' + - '!**/linux_ci.yml' + - '!**/macos_ci.yml' + - '!**/windows_ci.yml' + +concurrency: + group: platform-ci-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + +jobs: + linux: + uses: ./.github/workflows/linux_ci.yml + + macos: + uses: ./.github/workflows/macos_ci.yml + + windows: + uses: ./.github/workflows/windows_ci.yml diff --git a/.github/workflows/windows_ci.yml b/.github/workflows/windows_ci.yml index 171d53c4d240bb..c3575ddeb2b06a 100644 --- a/.github/workflows/windows_ci.yml +++ b/.github/workflows/windows_ci.yml @@ -1,21 +1,10 @@ -name: Code CI Windows +name: CI Windows on: - push: - paths-ignore: - - "**.md" - - "**.yml" - pull_request: - paths-ignore: - - "**.md" - - "**.yml" - -concurrency: - group: build-ci-windows-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true + workflow_call: jobs: - windows-gcc: + gcc: runs-on: windows-2019 if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v' timeout-minutes: 181 @@ -50,8 +39,8 @@ jobs: run: ./v -exclude @vlib/math/*.c.v test vlib/math/ - name: Self tests run: .\v.exe test-self - # - name: Test - # run: .\v.exe test-all + # - name: Test + # run: .\v.exe test-all - name: Build option_test.v with -autofree run: .\v.exe -autofree vlib/v/tests/option_test.v - name: Test time functions in a timezone UTC-12 @@ -83,7 +72,7 @@ jobs: - name: compile vup.v with -skip-unused and -prod run: ./v -showcc -skip-unused -prod cmd/tools/vup.v - windows-msvc: + msvc: runs-on: windows-2019 if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v' timeout-minutes: 181 @@ -110,17 +99,17 @@ jobs: echo $VFLAGS ./v cmd/tools/test_if_v_test_system_works.v ./cmd/tools/test_if_v_test_system_works -### TODO: test-cleancode fails with msvc. Investigate why??? -## - name: All code is formatted -## run: ./v test-cleancode + # TODO: test-cleancode fails with msvc. Investigate why??? + # - name: All code is formatted + # run: ./v test-cleancode - name: Test pure V math module run: ./v -exclude @vlib/math/*.c.v test vlib/math/ - name: Self tests run: | ./v -cg cmd\tools\vtest-self.v ./v test-self - # - name: Test - # run: .\v.exe test-all + # - name: Test + # run: .\v.exe test-all - name: Test v->js run: ./v -o hi.js examples/hello_v_js.v && node hi.js - name: Test v binaries @@ -130,7 +119,7 @@ jobs: - name: v2 self compilation run: .\v.exe -o v2.exe cmd/v && .\v2.exe -o v3.exe cmd/v - windows-tcc: + tcc: runs-on: windows-2019 if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v' timeout-minutes: 121 @@ -160,8 +149,7 @@ jobs: .\v.exe cmd/tools/test_if_v_test_system_works.v .\cmd\tools\test_if_v_test_system_works.exe - name: Verify `v vlib/v/gen/c/coutput_test.v` works - run: | - .\v.exe vlib/v/gen/c/coutput_test.v + run: .\v.exe vlib/v/gen/c/coutput_test.v - name: Make sure running TCC64 instead of TCC32 run: ./v test .github\workflows\make_sure_ci_run_with_64bit_compiler_test.v - name: Test ./v doc -v clipboard *BEFORE building tools* @@ -185,42 +173,42 @@ jobs: - name: v2 self compilation with -gc boehm run: .\v.exe -o v2.exe -gc boehm cmd/v && .\v2.exe -o v3.exe -gc boehm cmd/v && .\v3.exe -o v4.exe -gc boehm cmd/v - ## ## tcc32 - ## - name: Build with make.bat -tcc32 - ## run: | - ## Remove-Item -Recurse -Force .\thirdparty\tcc - ## .\v.exe wipe-cache - ## .\make.bat -tcc32 - ## - name: Test new v.c - ## run: .\v.exe -o v.c cmd/v && .\thirdparty\tcc\tcc.exe -Werror -g -w -ladvapi32 -bt10 v.c - ## - name: v doctor - ## run: ./v doctor - ## - ## - name: Verify `v test` works - ## run: | - ## .\v.exe cmd/tools/test_if_v_test_system_works.v - ## .\cmd\tools\test_if_v_test_system_works.exe - ## - ## - name: Verify `v vlib/v/gen/c/coutput_test.v` works - ## run: | - ## .\v.exe vlib/v/gen/c/coutput_test.v - ## - ## - name: Make sure running TCC32 instead of TCC64 - ## run: ./v -stats .github\workflows\make_sure_ci_run_with_32bit_compiler_test.v - ## - ## - name: Test v build-tools - ## run: ./v -W build-tools - ## - ## - name: Test ./v doc clipboard - ## run: ./v doc clipboard - ## - ## - name: Self tests - ## run: ./v test-self - ## - name: Test v->js - ## run: ./v -o hi.js examples/hello_v_js.v && node hi.js - ## - name: Test v binaries - ## run: ./v build-vbinaries - ## - name: Build examples - ## run: ./v build-examples - ## - name: v2 self compilation - ## run: .\v.exe -o v2.exe cmd/v && .\v2.exe -o v3.exe cmd/v + ## tcc32 + # - name: Build with make.bat -tcc32 + # run: | + # Remove-Item -Recurse -Force .\thirdparty\tcc + # .\v.exe wipe-cache + # .\make.bat -tcc32 + # - name: Test new v.c + # run: .\v.exe -o v.c cmd/v && .\thirdparty\tcc\tcc.exe -Werror -g -w -ladvapi32 -bt10 v.c + # - name: v doctor + # run: ./v doctor + # + # - name: Verify `v test` works + # run: | + # .\v.exe cmd/tools/test_if_v_test_system_works.v + # .\cmd\tools\test_if_v_test_system_works.exe + # + # - name: Verify `v vlib/v/gen/c/coutput_test.v` works + # run: | + # .\v.exe vlib/v/gen/c/coutput_test.v + # + # - name: Make sure running TCC32 instead of TCC64 + # run: ./v -stats .github\workflows\make_sure_ci_run_with_32bit_compiler_test.v + # + # - name: Test v build-tools + # run: ./v -W build-tools + # + # - name: Test ./v doc clipboard + # run: ./v doc clipboard + # + # - name: Self tests + # run: ./v test-self + # - name: Test v->js + # run: ./v -o hi.js examples/hello_v_js.v && node hi.js + # - name: Test v binaries + # run: ./v build-vbinaries + # - name: Build examples + # run: ./v build-examples + # - name: v2 self compilation + # run: .\v.exe -o v2.exe cmd/v && .\v2.exe -o v3.exe cmd/v From fbbd1cb6254f76705b44c85d6679fbc56c329278 Mon Sep 17 00:00:00 2001 From: Turiiya <34311583+ttytm@users.noreply.github.com> Date: Tue, 10 Oct 2023 03:03:30 +0200 Subject: [PATCH 2/5] re-enable clean code for msvc --- .github/workflows/windows_ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/windows_ci.yml b/.github/workflows/windows_ci.yml index c3575ddeb2b06a..a36f50f532cc9b 100644 --- a/.github/workflows/windows_ci.yml +++ b/.github/workflows/windows_ci.yml @@ -99,9 +99,8 @@ jobs: echo $VFLAGS ./v cmd/tools/test_if_v_test_system_works.v ./cmd/tools/test_if_v_test_system_works - # TODO: test-cleancode fails with msvc. Investigate why??? - # - name: All code is formatted - # run: ./v test-cleancode + - name: All code is formatted + run: ./v test-cleancode - name: Test pure V math module run: ./v -exclude @vlib/math/*.c.v test vlib/math/ - name: Self tests From 1216d63ac7ff4deaf931910431028b7ad22f8931 Mon Sep 17 00:00:00 2001 From: Turiiya <34311583+ttytm@users.noreply.github.com> Date: Tue, 10 Oct 2023 12:56:38 +0200 Subject: [PATCH 3/5] fix, re-enable more test that were fixed in the meantime --- .github/workflows/code_ci.yml | 2 +- .github/workflows/platform_ci.yml | 33 ------------------------------ cmd/tools/modules/testing/common.v | 32 ++++++++++++++--------------- cmd/tools/vtest-self.v | 9 ++++---- 4 files changed, 21 insertions(+), 55 deletions(-) delete mode 100644 .github/workflows/platform_ci.yml diff --git a/.github/workflows/code_ci.yml b/.github/workflows/code_ci.yml index e40ee2d275a62b..4aa650536764a9 100644 --- a/.github/workflows/code_ci.yml +++ b/.github/workflows/code_ci.yml @@ -19,7 +19,7 @@ on: - '!**/windows_ci.yml' concurrency: - group: platform-ci-${{ github.event.pull_request.number || github.sha }} + group: code-ci-${{ github.event.pull_request.number || github.sha }} cancel-in-progress: true jobs: diff --git a/.github/workflows/platform_ci.yml b/.github/workflows/platform_ci.yml deleted file mode 100644 index 1e28c41a31b0b4..00000000000000 --- a/.github/workflows/platform_ci.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Code CI - -on: - push: - paths-ignore: - - '**.md' - - '**.yml' - - '!**/platform_ci.yml' - - '!**/linux_ci.yml' - - '!**/macos_ci.yml' - - '!**/windows_ci.yml' - pull_request: - paths-ignore: - - '**.md' - - '**.yml' - - '!**/platform_ci.yml' - - '!**/linux_ci.yml' - - '!**/macos_ci.yml' - - '!**/windows_ci.yml' - -concurrency: - group: platform-ci-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -jobs: - linux: - uses: ./.github/workflows/linux_ci.yml - - macos: - uses: ./.github/workflows/macos_ci.yml - - windows: - uses: ./.github/workflows/windows_ci.yml diff --git a/cmd/tools/modules/testing/common.v b/cmd/tools/modules/testing/common.v index 1452931b311fa3..74e35ea2b52aee 100644 --- a/cmd/tools/modules/testing/common.v +++ b/cmd/tools/modules/testing/common.v @@ -13,6 +13,8 @@ import runtime pub const github_job = os.getenv('GITHUB_JOB') +pub const runner_os = os.getenv('RUNNER_OS') // GitHub runner OS + pub const show_start = os.getenv('VTEST_SHOW_START') == '1' pub const hide_skips = os.getenv('VTEST_HIDE_SKIP') == '1' @@ -219,6 +221,20 @@ pub fn new_test_session(_vargs string, will_compile bool) TestSession { skip_files << 'examples/pendulum-simulation/parallel.v' skip_files << 'examples/pendulum-simulation/parallel_with_iw.v' skip_files << 'examples/pendulum-simulation/sequential.v' + if testing.github_job == 'tcc' { + // TODO: fix these by adding declarations for the missing functions in the prebuilt tcc + skip_files << 'vlib/net/mbedtls/mbedtls_compiles_test.v' + skip_files << 'vlib/net/ssl/ssl_compiles_test.v' + } + } + if testing.runner_os != 'Linux' && testing.github_job != 'tcc' { + skip_files << 'examples/c_interop_wkhtmltopdf.v' // needs installation of wkhtmltopdf from https://github.com/wkhtmltopdf/packaging/releases + skip_files << 'examples/call_v_from_python/test.v' // the example only makes sense to be compiled, when python is installed + skip_files << 'examples/call_v_from_ruby/test.v' // the example only makes sense to be compiled, when ruby is installed + skip_files << 'vlib/vweb/vweb_app_test.v' // imports the `sqlite` module, which in turn includes sqlite3.h + } + $if !macos { + skip_files << 'examples/macos_tray/tray.v' } if testing.github_job == 'ubuntu-docker-musl' { skip_files << 'vlib/net/openssl/openssl_compiles_test.v' @@ -226,11 +242,6 @@ pub fn new_test_session(_vargs string, will_compile bool) TestSession { if testing.github_job == 'tests-sanitize-memory-clang' { skip_files << 'vlib/net/openssl/openssl_compiles_test.v' } - if testing.github_job == 'windows-tcc' { - // TODO: fix these by adding declarations for the missing functions in the prebuilt tcc - skip_files << 'vlib/net/mbedtls/mbedtls_compiles_test.v' - skip_files << 'vlib/net/ssl/ssl_compiles_test.v' - } if testing.github_job != 'misc-tooling' { // These examples need .h files that are produced from the supplied .glsl files, // using by the shader compiler tools in https://github.com/floooh/sokol-tools-bin/archive/pre-feb2021-api-changes.tar.gz @@ -246,17 +257,6 @@ pub fn new_test_session(_vargs string, will_compile bool) TestSession { skip_files << 'examples/sokol/sounds/wav_player.v' skip_files << 'examples/sokol/sounds/simple_sin_tones.v' } - if testing.github_job != 'ubuntu-tcc' { - skip_files << 'examples/c_interop_wkhtmltopdf.v' // needs installation of wkhtmltopdf from https://github.com/wkhtmltopdf/packaging/releases - skip_files << 'examples/call_v_from_python/test.v' // the example only makes sense to be compiled, when python is installed - skip_files << 'examples/call_v_from_ruby/test.v' // the example only makes sense to be compiled, when ruby is installed - // the ttf_test.v is not interactive, but needs X11 headers to be installed, which is done only on ubuntu-tcc for now - skip_files << 'vlib/x/ttf/ttf_test.v' - skip_files << 'vlib/vweb/vweb_app_test.v' // imports the `sqlite` module, which in turn includes sqlite3.h - } - $if !macos { - skip_files << 'examples/macos_tray/tray.v' - } // examples/wasm/mandelbrot/mandelbrot.v requires special compilation flags: `-b wasm -os browser`, skip it for now: skip_files << 'examples/wasm/mandelbrot/mandelbrot.v' diff --git a/cmd/tools/vtest-self.v b/cmd/tools/vtest-self.v index 36a1a40b2c38ec..c5151ddc8dfb68 100644 --- a/cmd/tools/vtest-self.v +++ b/cmd/tools/vtest-self.v @@ -350,11 +350,10 @@ fn main() { tsession.skip_files << 'vlib/db/pg/pg_orm_test.v' } - if github_job == 'windows-tcc' { - tsession.skip_files << 'vlib/v/tests/project_with_cpp_code/compiling_cpp_files_with_a_cplusplus_compiler_test.v' - // TODO: fix these ASAP - tsession.skip_files << 'vlib/net/tcp_test.v' - tsession.skip_files << 'vlib/net/udp_test.v' + $if windows { + if github_job == 'tcc' { + tsession.skip_files << 'vlib/v/tests/project_with_cpp_code/compiling_cpp_files_with_a_cplusplus_compiler_test.v' + } } if !os.exists('cmd/tools/builders/wasm_builder') { From 97222be0a1aa276b4c7d7fe5722016e5341e2ae4 Mon Sep 17 00:00:00 2001 From: Turiiya <34311583+ttytm@users.noreply.github.com> Date: Tue, 10 Oct 2023 15:47:23 +0200 Subject: [PATCH 4/5] Update cmd/tools/modules/testing/common.v Co-authored-by: Delyan Angelov --- cmd/tools/modules/testing/common.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/tools/modules/testing/common.v b/cmd/tools/modules/testing/common.v index 74e35ea2b52aee..689e386bcaaef9 100644 --- a/cmd/tools/modules/testing/common.v +++ b/cmd/tools/modules/testing/common.v @@ -227,7 +227,7 @@ pub fn new_test_session(_vargs string, will_compile bool) TestSession { skip_files << 'vlib/net/ssl/ssl_compiles_test.v' } } - if testing.runner_os != 'Linux' && testing.github_job != 'tcc' { + if testing.runner_os != 'Linux' || testing.github_job != 'tcc' { skip_files << 'examples/c_interop_wkhtmltopdf.v' // needs installation of wkhtmltopdf from https://github.com/wkhtmltopdf/packaging/releases skip_files << 'examples/call_v_from_python/test.v' // the example only makes sense to be compiled, when python is installed skip_files << 'examples/call_v_from_ruby/test.v' // the example only makes sense to be compiled, when ruby is installed From b3e7b801f3d450cebbe7dc4ce1bdd692660f9da3 Mon Sep 17 00:00:00 2001 From: Turiiya <34311583+ttytm@users.noreply.github.com> Date: Tue, 10 Oct 2023 17:42:17 +0200 Subject: [PATCH 5/5] fix --- cmd/tools/modules/testing/common.v | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/tools/modules/testing/common.v b/cmd/tools/modules/testing/common.v index 689e386bcaaef9..dbf73a972e2779 100644 --- a/cmd/tools/modules/testing/common.v +++ b/cmd/tools/modules/testing/common.v @@ -238,6 +238,7 @@ pub fn new_test_session(_vargs string, will_compile bool) TestSession { } if testing.github_job == 'ubuntu-docker-musl' { skip_files << 'vlib/net/openssl/openssl_compiles_test.v' + skip_files << 'vlib/x/ttf/ttf_test.v' } if testing.github_job == 'tests-sanitize-memory-clang' { skip_files << 'vlib/net/openssl/openssl_compiles_test.v'