1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

ci: split windows/linux/macos jobs from the single ci.yml to 3 separate .yml files

This split is needed, so failing jobs on macos/windows, could be restarted
independently from each other more easily, through the web interface on github.
This commit is contained in:
Delyan Angelov 2023-01-19 14:28:37 +02:00
parent 92c7e3f7ff
commit c7a829e74f
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
3 changed files with 340 additions and 308 deletions

View File

@ -1,4 +1,4 @@
name: Code CI name: Code CI Linux
on: on:
push: push:
@ -11,7 +11,7 @@ on:
- "**.yml" - "**.yml"
concurrency: concurrency:
group: build-ci-${{ github.event.pull_request.number || github.sha }} group: build-ci-linux-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true cancel-in-progress: true
jobs: jobs:
@ -158,105 +158,6 @@ jobs:
./testcase_leak 2>leaks.txt ./testcase_leak 2>leaks.txt
[ "$(stat -c %s leaks.txt)" = "0" ] [ "$(stat -c %s leaks.txt)" = "0" ]
macos:
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
env:
VFLAGS: -cc clang
PKG_CONFIG_PATH: /usr/local/opt/pkgconfig:/usr/local/opt/libpq/lib/pkgconfig:/usr/local/opt/openssl@3/lib/pkgconfig:/opt/homebrew/lib/pkgconfig:/opt/homebrew/opt/libpq/lib/pkgconfig:/opt/homebrew/opt/openssl@3/lib/pkgconfig
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Install dependencies
run: |
echo "PKG_CONFIG_PATH is '$PKG_CONFIG_PATH'"
brew install libpq openssl
export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/opt/openssl/lib/"
echo "LIBRARY_PATH is '$LIBRARY_PATH'"
- name: Build V
run: make -j4 && ./v -cg -cstrict -o v cmd/v
- name: Run sanitizers
run: |
./v -o v2 cmd/v -cflags -fsanitize=undefined
UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ./v2 -o v.c cmd/v
- name: Build V using V
run: ./v -o v2 cmd/v && ./v2 -o v3 cmd/v
- name: Test symlink
run: ./v symlink
- name: Build vpm
run: git clone --depth 1 https://github.com/vlang/vpm && cd vpm && ../v . && 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: Verify `v test` works
run: |
echo $VFLAGS
./v cmd/tools/test_if_v_test_system_works.v
./cmd/tools/test_if_v_test_system_works
- name: All code is formatted
run: VJOBS=1 ./v test-cleancode
- name: Self tests
run: VJOBS=1 ./v test-self
- name: Build examples
run: ./v build-examples
- name: Build examples with -autofree
run: |
./v -autofree -o tetris examples/tetris/tetris.v
./v -autofree -o blog tutorials/building_a_simple_web_blog_with_vweb/code/blog
- name: v doctor
run: |
./v doctor
- name: Test ved
run: |
git clone --depth 1 https://github.com/vlang/ved
cd ved && ../v -o ved .
../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: Build V UI examples
run: |
git clone --depth 1 https://github.com/vlang/ui
cd ui
mkdir -p ~/.vmodules
ln -s $(pwd) ~/.vmodules/ui
../v examples/rectangles.v
## ../v run examples/build_examples.vsh
- name: V self compilation with -usecache
run: |
unset VFLAGS
./v -usecache examples/hello_world.v && examples/hello_world
./v -o v2 -usecache cmd/v
./v2 -o v3 -usecache cmd/v
./v3 version
./v3 -o tetris -usecache examples/tetris/tetris.v
- name: V self compilation with -parallel-cc
run: |
./v -o v2 -parallel-cc cmd/v
- name: Test password input
run: |
./v examples/password
./v examples/password/password_ci.vsh
ubuntu: ubuntu:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v' if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
@ -451,213 +352,6 @@ jobs:
echo "Running it..." echo "Running it..."
ls ls
windows-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: 121
env:
VFLAGS: -cc gcc
VERBOSE_MAKE: 1
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Build
run: |
gcc --version
.\make.bat -gcc
- name: Test new v.c
run: |
.\v.exe -o v.c cmd/v
gcc -Werror -municode -w v.c
- name: Install dependencies
run: |
.\v.exe setup-freetype
.\.github\workflows\windows-install-sqlite.bat
- name: v doctor
run: |
./v doctor
- name: Verify `v test` works
run: |
echo $VFLAGS
./v cmd/tools/test_if_v_test_system_works.v
./cmd/tools/test_if_v_test_system_works
- name: All code is formatted
run: ./v test-cleancode
- name: Self tests
run: .\v.exe test-self
# - name: Test
# run: .\v.exe test-all
- name: Test time functions in a timezone UTC-12
run: |
tzutil /s "Dateline Standard Time"
./v test vlib/time/
- name: Test time functions in a timezone UTC-3
run: |
tzutil /s "Greenland Standard Time"
./v test vlib/time/
- name: Test time functions in a timezone UTC+3
run: |
tzutil /s "Russian Standard Time"
./v test vlib/time/
- name: Test time functions in a timezone UTC+12
run: |
tzutil /s "New Zealand Standard Time"
./v test vlib/time/
- 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
windows-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: 121
env:
VFLAGS: -cc msvc
VERBOSE_MAKE: 1
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
.\v.exe -cflags /WX self
- name: Install dependencies
run: |
.\v.exe setup-freetype
.\.github\workflows\windows-install-sqlite.bat
- name: v doctor
run: |
./v doctor
- name: Verify `v test` works
run: |
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: Self tests
run: |
./v -cg cmd\tools\vtest-self.v
./v test-self
# - 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
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
windows-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
env:
VFLAGS: -cc tcc -no-retry-compilation
VJOBS: 1
VTEST_SHOW_START: 1
VERBOSE_MAKE: 1
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Build with make.bat -tcc
run: |
.\make.bat -tcc
- name: Test new v.c
run: |
.\v.exe -o v.c cmd/v
.\thirdparty\tcc\tcc.exe -Werror -w -ladvapi32 -bt10 v.c
- name: Install dependencies
run: |
.\v.exe setup-freetype
.\.github\workflows\windows-install-sqlite.bat
- 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 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*
run: ./v doc -v clipboard
- name: Test v build-tools
run: ./v -W build-tools
- name: All code is formatted
run: ./v test-cleancode
- 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 && .\v3.exe -o v4.exe cmd/v
- 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
# ubuntu-autofree-selfcompile: # ubuntu-autofree-selfcompile:
# runs-on: ubuntu-20.04 # runs-on: ubuntu-20.04

115
.github/workflows/macos_ci.yml vendored Normal file
View File

@ -0,0 +1,115 @@
name: Code 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
jobs:
macos:
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
env:
VFLAGS: -cc clang
PKG_CONFIG_PATH: /usr/local/opt/pkgconfig:/usr/local/opt/libpq/lib/pkgconfig:/usr/local/opt/openssl@3/lib/pkgconfig:/opt/homebrew/lib/pkgconfig:/opt/homebrew/opt/libpq/lib/pkgconfig:/opt/homebrew/opt/openssl@3/lib/pkgconfig
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Install dependencies
run: |
echo "PKG_CONFIG_PATH is '$PKG_CONFIG_PATH'"
brew install libpq openssl
export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/opt/openssl/lib/"
echo "LIBRARY_PATH is '$LIBRARY_PATH'"
- name: Build V
run: make -j4 && ./v -cg -cstrict -o v cmd/v
- name: Run sanitizers
run: |
./v -o v2 cmd/v -cflags -fsanitize=undefined
UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ./v2 -o v.c cmd/v
- name: Build V using V
run: ./v -o v2 cmd/v && ./v2 -o v3 cmd/v
- name: Test symlink
run: ./v symlink
- name: Build vpm
run: git clone --depth 1 https://github.com/vlang/vpm && cd vpm && ../v . && 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: Verify `v test` works
run: |
echo $VFLAGS
./v cmd/tools/test_if_v_test_system_works.v
./cmd/tools/test_if_v_test_system_works
- name: All code is formatted
run: VJOBS=1 ./v test-cleancode
- name: Self tests
run: VJOBS=1 ./v test-self
- name: Build examples
run: ./v build-examples
- name: Build examples with -autofree
run: |
./v -autofree -o tetris examples/tetris/tetris.v
./v -autofree -o blog tutorials/building_a_simple_web_blog_with_vweb/code/blog
- name: v doctor
run: |
./v doctor
- name: Test ved
run: |
git clone --depth 1 https://github.com/vlang/ved
cd ved && ../v -o ved .
../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: Build V UI examples
run: |
git clone --depth 1 https://github.com/vlang/ui
cd ui
mkdir -p ~/.vmodules
ln -s $(pwd) ~/.vmodules/ui
../v examples/rectangles.v
## ../v run examples/build_examples.vsh
- name: V self compilation with -usecache
run: |
unset VFLAGS
./v -usecache examples/hello_world.v && examples/hello_world
./v -o v2 -usecache cmd/v
./v2 -o v3 -usecache cmd/v
./v3 version
./v3 -o tetris -usecache examples/tetris/tetris.v
- name: V self compilation with -parallel-cc
run: |
./v -o v2 -parallel-cc cmd/v
- name: Test password input
run: |
./v examples/password
./v examples/password/password_ci.vsh

223
.github/workflows/windows_ci.yml vendored Normal file
View File

@ -0,0 +1,223 @@
name: Code 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
jobs:
windows-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: 121
env:
VFLAGS: -cc gcc
VERBOSE_MAKE: 1
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Build
run: |
gcc --version
.\make.bat -gcc
- name: Test new v.c
run: |
.\v.exe -o v.c cmd/v
gcc -Werror -municode -w v.c
- name: Install dependencies
run: |
.\v.exe setup-freetype
.\.github\workflows\windows-install-sqlite.bat
- name: v doctor
run: |
./v doctor
- name: Verify `v test` works
run: |
echo $VFLAGS
./v cmd/tools/test_if_v_test_system_works.v
./cmd/tools/test_if_v_test_system_works
- name: All code is formatted
run: ./v test-cleancode
- name: Self tests
run: .\v.exe test-self
# - name: Test
# run: .\v.exe test-all
- name: Test time functions in a timezone UTC-12
run: |
tzutil /s "Dateline Standard Time"
./v test vlib/time/
- name: Test time functions in a timezone UTC-3
run: |
tzutil /s "Greenland Standard Time"
./v test vlib/time/
- name: Test time functions in a timezone UTC+3
run: |
tzutil /s "Russian Standard Time"
./v test vlib/time/
- name: Test time functions in a timezone UTC+12
run: |
tzutil /s "New Zealand Standard Time"
./v test vlib/time/
- 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
windows-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: 121
env:
VFLAGS: -cc msvc
VERBOSE_MAKE: 1
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
.\v.exe -cflags /WX self
- name: Install dependencies
run: |
.\v.exe setup-freetype
.\.github\workflows\windows-install-sqlite.bat
- name: v doctor
run: |
./v doctor
- name: Verify `v test` works
run: |
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: Self tests
run: |
./v -cg cmd\tools\vtest-self.v
./v test-self
# - 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
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
windows-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
env:
VFLAGS: -cc tcc -no-retry-compilation
VJOBS: 1
VTEST_SHOW_START: 1
VERBOSE_MAKE: 1
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Build with make.bat -tcc
run: |
.\make.bat -tcc
- name: Test new v.c
run: |
.\v.exe -o v.c cmd/v
.\thirdparty\tcc\tcc.exe -Werror -w -ladvapi32 -bt10 v.c
- name: Install dependencies
run: |
.\v.exe setup-freetype
.\.github\workflows\windows-install-sqlite.bat
- 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 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*
run: ./v doc -v clipboard
- name: Test v build-tools
run: ./v -W build-tools
- name: All code is formatted
run: ./v test-cleancode
- 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 && .\v3.exe -o v4.exe cmd/v
- 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