mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
ci: separate other_ci.yml and paths_ci.yml; simplify make.bat (#13254)
This commit is contained in:
parent
86a2562fa7
commit
34f0d442df
398
.github/workflows/ci.yml
vendored
398
.github/workflows/ci.yml
vendored
@ -13,54 +13,6 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
no-gpl-by-accident:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: No GPL licensed code, should be added accidentally
|
||||
run: |
|
||||
! grep -r --exclude="*.yml" "a GPL license" .
|
||||
|
||||
code-formatting:
|
||||
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 -silent test-cleancode
|
||||
- name: v test-fmt
|
||||
run: ./v -silent test-fmt
|
||||
|
||||
performance-regressions:
|
||||
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: Clone & Build previous vmaster/v
|
||||
run: |
|
||||
git clone --depth=1 https://github.com/vlang/v vmaster/
|
||||
(cd vmaster; make -j4)
|
||||
- name: V versions
|
||||
run: ./v version && ./vmaster/v version
|
||||
- name: Build the repeat tool
|
||||
run: ./v cmd/tools/repeat.v
|
||||
- name: Repeat -o hw.c examples/hello_world.v
|
||||
run: cmd/tools/repeat --max_time 251 --series 3 --count 20 --nmins 2 --nmaxs 5 --warmup 3 --fail_percent 10 -t 'cd {T} ; ./v -show-timings -o hw.c examples/hello_world.v' . ./vmaster
|
||||
- name: Repeat -o v.c cmd/v
|
||||
run: cmd/tools/repeat --max_time 1501 --series 3 --count 20 --nmins 2 --nmaxs 5 --warmup 3 --fail_percent 10 -t 'cd {T} ; ./v -show-timings -o v.c cmd/v' . ./vmaster
|
||||
|
||||
ubuntu-tcc:
|
||||
runs-on: ubuntu-20.04
|
||||
timeout-minutes: 121
|
||||
@ -191,89 +143,6 @@ jobs:
|
||||
./testcase_leak 2>leaks.txt
|
||||
[ "$(stat -c %s leaks.txt)" = "0" ]
|
||||
|
||||
misc-tooling:
|
||||
runs-on: ubuntu-20.04
|
||||
timeout-minutes: 121
|
||||
env:
|
||||
VFLAGS: -cc tcc -no-retry-compilation
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 10
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
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
|
||||
sudo apt-get install --quiet -y xfonts-75dpi xfonts-base
|
||||
- name: Build v
|
||||
run: make
|
||||
|
||||
- name: Ensure V can be compiled with -autofree
|
||||
run: ./v -autofree -o v2 cmd/v ## NB: this does not mean it runs, but at least keeps it from regressing
|
||||
|
||||
- name: Shader examples can be build
|
||||
run: |
|
||||
wget https://github.com/floooh/sokol-tools-bin/raw/33d2e4cc26088c6c28eaef5467990f8940d15aab/bin/linux/sokol-shdc
|
||||
chmod +x ./sokol-shdc
|
||||
for f in examples/sokol/02_cubes_glsl/cube_glsl \
|
||||
examples/sokol/03_march_tracing_glsl/rt_glsl \
|
||||
examples/sokol/04_multi_shader_glsl/rt_glsl_puppy \
|
||||
examples/sokol/04_multi_shader_glsl/rt_glsl_march \
|
||||
examples/sokol/05_instancing_glsl/rt_glsl_instancing \
|
||||
examples/sokol/06_obj_viewer/gouraud \
|
||||
; do \
|
||||
echo "compiling shader $f.glsl ..."; \
|
||||
./sokol-shdc --input $f.glsl --output $f.h --slang glsl330 ; \
|
||||
done
|
||||
for vfile in examples/sokol/0?*/*.v; do echo "compiling $vfile ..."; ./v $vfile ; done
|
||||
|
||||
- name: Install C++ dependencies
|
||||
run: |
|
||||
sudo apt-get install --quiet -y postgresql libpq-dev libssl-dev sqlite3 libsqlite3-dev
|
||||
sudo apt-get install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libgl-dev
|
||||
sudo apt-get install --quiet -y valgrind g++-9
|
||||
- name: Build V
|
||||
run: make -j4
|
||||
- name: g++ version
|
||||
run: g++-9 --version
|
||||
- name: V self compilation with g++
|
||||
run: ./v -cc g++-9 -no-std -cflags -std=c++11 -o v2 cmd/v && ./v2 -cc g++-9 -no-std -cflags -std=c++11 -o v3 cmd/v
|
||||
## - name: Running tests with g++
|
||||
## run: ./v -cc g++-9 -silent test-self
|
||||
|
||||
|
||||
alpine-docker-musl-gcc:
|
||||
name: alpine-musl
|
||||
runs-on: ubuntu-20.04
|
||||
timeout-minutes: 121
|
||||
container:
|
||||
# Alpine docker pre-built container
|
||||
image: thevlang/vlang:alpine-build
|
||||
env:
|
||||
V_CI_MUSL: 1
|
||||
VFLAGS: -cc gcc
|
||||
volumes:
|
||||
- ${{github.workspace}}:/opt/vlang
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Show Environment
|
||||
run: |
|
||||
echo "PWD:"
|
||||
pwd
|
||||
echo "ENVIRONMENT:"
|
||||
env
|
||||
echo "C Compiler:"
|
||||
gcc --version
|
||||
|
||||
- name: Build V
|
||||
run: CC=gcc make
|
||||
|
||||
- name: Test V fixed tests
|
||||
run: ./v -silent test-self
|
||||
|
||||
macos:
|
||||
runs-on: macOS-latest
|
||||
timeout-minutes: 121
|
||||
@ -542,72 +411,6 @@ jobs:
|
||||
echo "Running it..."
|
||||
ls
|
||||
|
||||
# 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 docker pre-built container
|
||||
ubuntu-musl:
|
||||
name: ubuntu-musl
|
||||
runs-on: ubuntu-20.04
|
||||
timeout-minutes: 121
|
||||
container:
|
||||
image: thevlang/vlang:ubuntu-build
|
||||
env:
|
||||
V_CI_MUSL: 1
|
||||
V_CI_UBUNTU_MUSL: 1
|
||||
VFLAGS: -cc musl-gcc
|
||||
volumes:
|
||||
- ${{github.workspace}}:/opt/vlang
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Build V
|
||||
run: |
|
||||
echo $VFLAGS && make -j4 && ./v -cg -o v cmd/v
|
||||
- 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: Test V fixed tests
|
||||
run: |
|
||||
./v -silent 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 -silent test-self
|
||||
|
||||
windows-gcc:
|
||||
runs-on: windows-2019
|
||||
timeout-minutes: 121
|
||||
@ -793,136 +596,99 @@ jobs:
|
||||
## - name: v2 self compilation
|
||||
## run: .\v.exe -o v2.exe cmd/v && .\v2.exe -o v3.exe cmd/v
|
||||
|
||||
parser-silent:
|
||||
name: Parser silent mode
|
||||
alpine-docker-musl-gcc:
|
||||
runs-on: ubuntu-20.04
|
||||
timeout-minutes: 121
|
||||
container:
|
||||
# Alpine docker pre-built container
|
||||
image: thevlang/vlang:alpine-build
|
||||
env:
|
||||
V_CI_MUSL: 1
|
||||
VFLAGS: -cc gcc
|
||||
volumes:
|
||||
- ${{github.workspace}}:/opt/vlang
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install zzuf
|
||||
run: sudo apt install -qq zzuf
|
||||
- name: Build local v
|
||||
run: |
|
||||
make -j4
|
||||
./v -g cmd/tools/vtest-parser.v
|
||||
- name: Run test-parser
|
||||
run: |
|
||||
./v test-parser -S examples/hello_world.v
|
||||
./v test-parser -S examples/hanoi.v
|
||||
./v test-parser -S examples/fibonacci.v
|
||||
./v test-parser -S examples/cli.v
|
||||
./v test-parser -S examples/json.v
|
||||
./v test-parser -S examples/vmod.v
|
||||
./v test-parser -S examples/regex/regex_example.v
|
||||
./v test-parser -S examples/2048/2048.v
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Run test-parser over fuzzed files
|
||||
- name: Show Environment
|
||||
run: |
|
||||
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/hello_world.v > examples/hello_world_fuzz.v
|
||||
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/hanoi.v > examples/hanoi_fuzz.v
|
||||
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/fibonacci.v > examples/fibonacci_fuzz.v
|
||||
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/cli.v > examples/cli_fuzz.v
|
||||
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/json.v > examples/json_fuzz.v
|
||||
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/vmod.v > examples/vmod_fuzz.v
|
||||
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/regex/regex_example.v > examples/regex_example_fuzz.v
|
||||
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/2048/2048.v > examples/2048/2048_fuzz.v
|
||||
./v test-parser -S examples/hello_world_fuzz.v
|
||||
./v test-parser -S examples/hanoi_fuzz.v
|
||||
./v test-parser -S examples/cli_fuzz.v
|
||||
./v test-parser -S examples/regex_example_fuzz.v
|
||||
./v test-parser -S examples/2048/2048_fuzz.v
|
||||
echo "PWD:"
|
||||
pwd
|
||||
echo "ENVIRONMENT:"
|
||||
env
|
||||
echo "C Compiler:"
|
||||
gcc --version
|
||||
|
||||
v-apps-compile:
|
||||
runs-on: ubuntu-20.04
|
||||
timeout-minutes: 121
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build V
|
||||
run: make && sudo ./v symlink
|
||||
run: CC=gcc make
|
||||
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get install --quiet -y libgc-dev
|
||||
- name: Test V fixed tests
|
||||
run: ./v -silent test-self
|
||||
|
||||
## vls
|
||||
- name: Clone VLS
|
||||
run: git clone --depth 1 https://github.com/vlang/vls
|
||||
- name: Build VLS
|
||||
run: pushd vls; v cmd/vls ; popd
|
||||
- name: Build VLS with -prod
|
||||
run: pushd vls; v -prod cmd/vls; popd
|
||||
- name: Build VLS with -gc boehm -skip-unused
|
||||
run: pushd vls; v -gc boehm -skip-unused cmd/vls; popd
|
||||
|
||||
## vsl
|
||||
- name: Clone VSL
|
||||
run: git clone --depth 1 https://github.com/vlang/vsl ~/.vmodules/vsl
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get install --quiet -y --no-install-recommends gfortran liblapacke-dev libopenblas-dev libgc-dev
|
||||
- name: Execute Tests using Pure V Backend
|
||||
run: ~/.vmodules/vsl/bin/test
|
||||
- name: Execute Tests using Pure V Backend with Pure V Math
|
||||
run: ~/.vmodules/vsl/bin/test --use-cblas
|
||||
- name: Execute Tests using Pure V Backend and Garbage Collection enabled
|
||||
run: ~/.vmodules/vsl/bin/test --use-gc boehm
|
||||
- name: Execute Tests using Pure V Backend with Pure V Math and Garbage Collection enabled
|
||||
run: ~/.vmodules/vsl/bin/test --use-cblas --use-gc boehm
|
||||
# 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
|
||||
|
||||
## vtl
|
||||
- name: Clone VTL
|
||||
run: git clone --depth 1 https://github.com/vlang/vtl ~/.vmodules/vtl
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get install --quiet -y --no-install-recommends gfortran liblapacke-dev libopenblas-dev libgc-dev
|
||||
- name: Execute Tests using Pure V Backend
|
||||
run: ~/.vmodules/vtl/bin/test
|
||||
- name: Execute Tests using Pure V Backend with Pure V Math
|
||||
run: ~/.vmodules/vtl/bin/test --use-cblas
|
||||
- name: Execute Tests using Pure V Backend and Garbage Collection enabled
|
||||
run: ~/.vmodules/vtl/bin/test --use-gc boehm
|
||||
- name: Execute Tests using Pure V Backend with Pure V Math and Garbage Collection enabled
|
||||
run: ~/.vmodules/vtl/bin/test --use-cblas --use-gc boehm
|
||||
|
||||
## vab
|
||||
- name: Clone vab
|
||||
run: git clone --depth 1 https://github.com/vlang/vab
|
||||
- name: Build vab
|
||||
run: cd vab; ../v ./vab.v ; cd ..
|
||||
- name: Build vab with -gc boehm -skip-unused
|
||||
run: cd vab; ../v -gc boehm -skip-unused ./vab.v ; cd ..
|
||||
# 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 -silent test-self
|
||||
|
||||
## gitly
|
||||
- name: Install markdown
|
||||
run: ./v install markdown
|
||||
- name: Build Gitly
|
||||
# Ubuntu docker pre-built container
|
||||
ubuntu-musl:
|
||||
runs-on: ubuntu-20.04
|
||||
timeout-minutes: 121
|
||||
container:
|
||||
image: thevlang/vlang:ubuntu-build
|
||||
env:
|
||||
V_CI_MUSL: 1
|
||||
V_CI_UBUNTU_MUSL: 1
|
||||
VFLAGS: -cc musl-gcc
|
||||
volumes:
|
||||
- ${{github.workspace}}:/opt/vlang
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Build V
|
||||
run: |
|
||||
git clone --depth 1 https://github.com/vlang/gitly
|
||||
cd gitly
|
||||
../v .
|
||||
# ./gitly -ci_run
|
||||
../v -autofree .
|
||||
../v -o x tests/first_run.v
|
||||
./x
|
||||
cd ..
|
||||
|
||||
## vex
|
||||
- name: Install Vex dependencies
|
||||
run: sudo apt-get install --quiet -y libssl-dev sqlite3 libsqlite3-dev
|
||||
- name: Install Vex
|
||||
run: mkdir -p ~/.vmodules/nedpals; git clone https://github.com/nedpals/vex ~/.vmodules/nedpals/vex
|
||||
- name: Compile the simple Vex example
|
||||
run: ./v ~/.vmodules/nedpals/vex/examples/simple_example.v
|
||||
- name: Compile the simple Vex example with -gc boehm -skip-unused
|
||||
run: ./v -gc boehm -skip-unused ~/.vmodules/nedpals/vex/examples/simple_example.v
|
||||
- name: Run Vex Tests
|
||||
run: ./v test ~/.vmodules/nedpals/vex
|
||||
|
||||
## vpm modules
|
||||
- name: Install UI through VPM
|
||||
run: ./v install ui
|
||||
|
||||
## libsodium
|
||||
- name: Install libsodium-dev package
|
||||
run: sudo apt-get install --quiet -y libsodium-dev
|
||||
- name: Installl the libsodium wrapper through VPM
|
||||
run: ./v install libsodium
|
||||
- name: Test libsodium
|
||||
run: ./v test ~/.vmodules/libsodium
|
||||
echo $VFLAGS && make -j4 && ./v -cg -o v cmd/v
|
||||
- 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: Test V fixed tests
|
||||
run: |
|
||||
./v -silent test-self
|
||||
|
248
.github/workflows/other_ci.yml
vendored
Normal file
248
.github/workflows/other_ci.yml
vendored
Normal file
@ -0,0 +1,248 @@
|
||||
name: Other CI
|
||||
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
|
||||
concurrency:
|
||||
group: build-${{ github.event.pull_request.number || github.sha }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
no-gpl-by-accident:
|
||||
runs-on: ubuntu-20.04
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: No GPL licensed code, should be added accidentally
|
||||
run: |
|
||||
! grep -r --exclude="*.yml" "a GPL license" .
|
||||
|
||||
code-formatting:
|
||||
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 -silent test-cleancode
|
||||
- name: v test-fmt
|
||||
run: ./v -silent test-fmt
|
||||
|
||||
performance-regressions:
|
||||
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: Clone & Build previous vmaster/v
|
||||
run: |
|
||||
git clone --depth=1 https://github.com/vlang/v vmaster/
|
||||
(cd vmaster; make -j4)
|
||||
- name: V versions
|
||||
run: ./v version && ./vmaster/v version
|
||||
- name: Build the repeat tool
|
||||
run: ./v cmd/tools/repeat.v
|
||||
- name: Repeat -o hw.c examples/hello_world.v
|
||||
run: cmd/tools/repeat --max_time 251 --series 3 --count 20 --nmins 2 --nmaxs 5 --warmup 3 --fail_percent 10 -t 'cd {T} ; ./v -show-timings -o hw.c examples/hello_world.v' . ./vmaster
|
||||
- name: Repeat -o v.c cmd/v
|
||||
run: cmd/tools/repeat --max_time 1501 --series 3 --count 20 --nmins 2 --nmaxs 5 --warmup 3 --fail_percent 10 -t 'cd {T} ; ./v -show-timings -o v.c cmd/v' . ./vmaster
|
||||
|
||||
misc-tooling:
|
||||
runs-on: ubuntu-20.04
|
||||
timeout-minutes: 121
|
||||
env:
|
||||
VFLAGS: -cc tcc -no-retry-compilation
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 10
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
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
|
||||
sudo apt-get install --quiet -y xfonts-75dpi xfonts-base
|
||||
- name: Build v
|
||||
run: make
|
||||
|
||||
- name: Ensure V can be compiled with -autofree
|
||||
run: ./v -autofree -o v2 cmd/v ## NB: this does not mean it runs, but at least keeps it from regressing
|
||||
|
||||
- name: Shader examples can be build
|
||||
run: |
|
||||
wget https://github.com/floooh/sokol-tools-bin/raw/33d2e4cc26088c6c28eaef5467990f8940d15aab/bin/linux/sokol-shdc
|
||||
chmod +x ./sokol-shdc
|
||||
for f in examples/sokol/02_cubes_glsl/cube_glsl \
|
||||
examples/sokol/03_march_tracing_glsl/rt_glsl \
|
||||
examples/sokol/04_multi_shader_glsl/rt_glsl_puppy \
|
||||
examples/sokol/04_multi_shader_glsl/rt_glsl_march \
|
||||
examples/sokol/05_instancing_glsl/rt_glsl_instancing \
|
||||
examples/sokol/06_obj_viewer/gouraud \
|
||||
; do \
|
||||
echo "compiling shader $f.glsl ..."; \
|
||||
./sokol-shdc --input $f.glsl --output $f.h --slang glsl330 ; \
|
||||
done
|
||||
for vfile in examples/sokol/0?*/*.v; do echo "compiling $vfile ..."; ./v $vfile ; done
|
||||
|
||||
- name: Install C++ dependencies
|
||||
run: |
|
||||
sudo apt-get install --quiet -y postgresql libpq-dev libssl-dev sqlite3 libsqlite3-dev
|
||||
sudo apt-get install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libgl-dev
|
||||
sudo apt-get install --quiet -y valgrind g++-9
|
||||
- name: Build V
|
||||
run: make -j4
|
||||
- name: g++ version
|
||||
run: g++-9 --version
|
||||
- name: V self compilation with g++
|
||||
run: ./v -cc g++-9 -no-std -cflags -std=c++11 -o v2 cmd/v && ./v2 -cc g++-9 -no-std -cflags -std=c++11 -o v3 cmd/v
|
||||
## - name: Running tests with g++
|
||||
## run: ./v -cc g++-9 -silent test-self
|
||||
|
||||
|
||||
parser-silent:
|
||||
runs-on: ubuntu-20.04
|
||||
timeout-minutes: 121
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install zzuf
|
||||
run: sudo apt install -qq zzuf
|
||||
- name: Build local v
|
||||
run: |
|
||||
make -j4
|
||||
./v -g cmd/tools/vtest-parser.v
|
||||
- name: Run test-parser
|
||||
run: |
|
||||
./v test-parser -S examples/hello_world.v
|
||||
./v test-parser -S examples/hanoi.v
|
||||
./v test-parser -S examples/fibonacci.v
|
||||
./v test-parser -S examples/cli.v
|
||||
./v test-parser -S examples/json.v
|
||||
./v test-parser -S examples/vmod.v
|
||||
./v test-parser -S examples/regex/regex_example.v
|
||||
./v test-parser -S examples/2048/2048.v
|
||||
|
||||
- name: Run test-parser over fuzzed files
|
||||
run: |
|
||||
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/hello_world.v > examples/hello_world_fuzz.v
|
||||
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/hanoi.v > examples/hanoi_fuzz.v
|
||||
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/fibonacci.v > examples/fibonacci_fuzz.v
|
||||
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/cli.v > examples/cli_fuzz.v
|
||||
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/json.v > examples/json_fuzz.v
|
||||
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/vmod.v > examples/vmod_fuzz.v
|
||||
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/regex/regex_example.v > examples/regex_example_fuzz.v
|
||||
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/2048/2048.v > examples/2048/2048_fuzz.v
|
||||
./v test-parser -S examples/hello_world_fuzz.v
|
||||
./v test-parser -S examples/hanoi_fuzz.v
|
||||
./v test-parser -S examples/cli_fuzz.v
|
||||
./v test-parser -S examples/regex_example_fuzz.v
|
||||
./v test-parser -S examples/2048/2048_fuzz.v
|
||||
|
||||
v-apps-compile:
|
||||
runs-on: ubuntu-20.04
|
||||
timeout-minutes: 121
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build V
|
||||
run: make && sudo ./v symlink
|
||||
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get install --quiet -y libgc-dev
|
||||
|
||||
## vls
|
||||
- name: Clone VLS
|
||||
run: git clone --depth 1 https://github.com/vlang/vls
|
||||
- name: Build VLS
|
||||
run: pushd vls; v cmd/vls ; popd
|
||||
- name: Build VLS with -prod
|
||||
run: pushd vls; v -prod cmd/vls; popd
|
||||
- name: Build VLS with -gc boehm -skip-unused
|
||||
run: pushd vls; v -gc boehm -skip-unused cmd/vls; popd
|
||||
|
||||
## vsl
|
||||
- name: Clone VSL
|
||||
run: git clone --depth 1 https://github.com/vlang/vsl ~/.vmodules/vsl
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get install --quiet -y --no-install-recommends gfortran liblapacke-dev libopenblas-dev libgc-dev
|
||||
- name: Execute Tests using Pure V Backend
|
||||
run: ~/.vmodules/vsl/bin/test
|
||||
- name: Execute Tests using Pure V Backend with Pure V Math
|
||||
run: ~/.vmodules/vsl/bin/test --use-cblas
|
||||
- name: Execute Tests using Pure V Backend and Garbage Collection enabled
|
||||
run: ~/.vmodules/vsl/bin/test --use-gc boehm
|
||||
- name: Execute Tests using Pure V Backend with Pure V Math and Garbage Collection enabled
|
||||
run: ~/.vmodules/vsl/bin/test --use-cblas --use-gc boehm
|
||||
|
||||
## vtl
|
||||
- name: Clone VTL
|
||||
run: git clone --depth 1 https://github.com/vlang/vtl ~/.vmodules/vtl
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get install --quiet -y --no-install-recommends gfortran liblapacke-dev libopenblas-dev libgc-dev
|
||||
- name: Execute Tests using Pure V Backend
|
||||
run: ~/.vmodules/vtl/bin/test
|
||||
- name: Execute Tests using Pure V Backend with Pure V Math
|
||||
run: ~/.vmodules/vtl/bin/test --use-cblas
|
||||
- name: Execute Tests using Pure V Backend and Garbage Collection enabled
|
||||
run: ~/.vmodules/vtl/bin/test --use-gc boehm
|
||||
- name: Execute Tests using Pure V Backend with Pure V Math and Garbage Collection enabled
|
||||
run: ~/.vmodules/vtl/bin/test --use-cblas --use-gc boehm
|
||||
|
||||
## vab
|
||||
- name: Clone vab
|
||||
run: git clone --depth 1 https://github.com/vlang/vab
|
||||
- name: Build vab
|
||||
run: cd vab; ../v ./vab.v ; cd ..
|
||||
- name: Build vab with -gc boehm -skip-unused
|
||||
run: cd vab; ../v -gc boehm -skip-unused ./vab.v ; cd ..
|
||||
|
||||
## gitly
|
||||
- name: Install markdown
|
||||
run: ./v install markdown
|
||||
- name: Build Gitly
|
||||
run: |
|
||||
git clone --depth 1 https://github.com/vlang/gitly
|
||||
cd gitly
|
||||
../v .
|
||||
# ./gitly -ci_run
|
||||
../v -autofree .
|
||||
../v -o x tests/first_run.v
|
||||
./x
|
||||
cd ..
|
||||
|
||||
## vex
|
||||
- name: Install Vex dependencies
|
||||
run: sudo apt-get install --quiet -y libssl-dev sqlite3 libsqlite3-dev
|
||||
- name: Install Vex
|
||||
run: mkdir -p ~/.vmodules/nedpals; git clone https://github.com/nedpals/vex ~/.vmodules/nedpals/vex
|
||||
- name: Compile the simple Vex example
|
||||
run: ./v ~/.vmodules/nedpals/vex/examples/simple_example.v
|
||||
- name: Compile the simple Vex example with -gc boehm -skip-unused
|
||||
run: ./v -gc boehm -skip-unused ~/.vmodules/nedpals/vex/examples/simple_example.v
|
||||
- name: Run Vex Tests
|
||||
run: ./v test ~/.vmodules/nedpals/vex
|
||||
|
||||
## vpm modules
|
||||
- name: Install UI through VPM
|
||||
run: ./v install ui
|
||||
|
||||
## libsodium
|
||||
- name: Install libsodium-dev package
|
||||
run: sudo apt-get install --quiet -y libsodium-dev
|
||||
- name: Installl the libsodium wrapper through VPM
|
||||
run: ./v install libsodium
|
||||
- name: Test libsodium
|
||||
run: ./v test ~/.vmodules/libsodium
|
100
.github/workflows/paths_ci.yml
vendored
Normal file
100
.github/workflows/paths_ci.yml
vendored
Normal file
@ -0,0 +1,100 @@
|
||||
name: Path Testing CI
|
||||
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
|
||||
concurrency:
|
||||
group: build-${{ github.event.pull_request.number || github.sha }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
|
||||
space-paths-linux:
|
||||
runs-on: ubuntu-20.04
|
||||
timeout-minutes: 30
|
||||
env:
|
||||
MY_V_PATH: '你好 my $path, @с интервали'
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
path: ${{env.MY_V_PATH}}
|
||||
- name: Build V
|
||||
run: |
|
||||
echo '${{env.MY_V_PATH}}'
|
||||
ls -la
|
||||
cd '${{env.MY_V_PATH}}'
|
||||
ls -la
|
||||
make
|
||||
- name: v doctor
|
||||
run: |
|
||||
cd '${{env.MY_V_PATH}}'
|
||||
./v doctor
|
||||
- name: v tests
|
||||
run: |
|
||||
cd '${{env.MY_V_PATH}}'
|
||||
./v test vlib/builtin vlib/os
|
||||
|
||||
space-paths-macos:
|
||||
runs-on: macOS-latest
|
||||
timeout-minutes: 30
|
||||
env:
|
||||
MY_V_PATH: '你好 my $path, @с интервали'
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
path: ${{env.MY_V_PATH}}
|
||||
- name: Build V
|
||||
run: |
|
||||
echo '${{env.MY_V_PATH}}'
|
||||
ls -la
|
||||
cd '${{env.MY_V_PATH}}'
|
||||
ls -la
|
||||
make
|
||||
- name: v doctor
|
||||
run: |
|
||||
cd '${{env.MY_V_PATH}}'
|
||||
./v doctor
|
||||
- name: v tests
|
||||
run: |
|
||||
cd '${{env.MY_V_PATH}}'
|
||||
./v test vlib/builtin vlib/os
|
||||
|
||||
space-paths-windows:
|
||||
runs-on: windows-2022
|
||||
timeout-minutes: 30
|
||||
env:
|
||||
MY_V_PATH: 'path with some $punctuation, and some spaces'
|
||||
|
||||
## NB: the following paths do not work for now:
|
||||
##### MY_V_PATH: '你好 my $path, @с интервали'
|
||||
##### MY_V_PATH: 'path with some $punctuation, and some spaces '
|
||||
## tcc has a problem interpreting paths with non latin letters in them,
|
||||
## by default, but that can be solved with passing -Bthirdparty/tcc
|
||||
## but after that V fails self building with:
|
||||
####### builder error: cannot write to folder D:\a\v\v\你好 my $path, @с интервали: No such file or directory
|
||||
## and that happens even for gcc builds, not just tcc ones
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
path: ${{env.MY_V_PATH}}
|
||||
- name: Build V
|
||||
run: |
|
||||
echo '${{env.MY_V_PATH}}'
|
||||
dir
|
||||
cd '${{env.MY_V_PATH}}'
|
||||
dir
|
||||
.\make.bat -tcc
|
||||
- name: v doctor
|
||||
run: |
|
||||
cd '${{env.MY_V_PATH}}'
|
||||
./v doctor
|
||||
- name: v tests
|
||||
run: |
|
||||
cd '${{env.MY_V_PATH}}'
|
||||
./v test vlib/builtin vlib/os
|
42
make.bat
42
make.bat
@ -12,8 +12,8 @@ set target=build
|
||||
|
||||
REM TCC variables
|
||||
set "tcc_url=https://github.com/vlang/tccbin"
|
||||
set "tcc_dir=%~dp0thirdparty\tcc"
|
||||
set "tcc_exe=%~dp0thirdparty\tcc\tcc.exe"
|
||||
set "tcc_dir=thirdparty\tcc"
|
||||
set "tcc_exe=thirdparty\tcc\tcc.exe"
|
||||
if "%PROCESSOR_ARCHITECTURE%" == "x86" ( set "tcc_branch=thirdparty-windows-i386" ) else ( set "tcc_branch=thirdparty-windows-amd64" )
|
||||
if "%~1" == "-tcc32" set "tcc_branch=thirdparty-windows-i386"
|
||||
|
||||
@ -117,17 +117,16 @@ if not [!compiler!] == [] goto :!compiler!_strap
|
||||
REM By default, use tcc, since we have it prebuilt:
|
||||
:tcc_strap
|
||||
:tcc32_strap
|
||||
echo ^> Attempting to build v_win.c with TCC
|
||||
"!tcc_exe!" -Ithirdparty/stdatomic/win -bt10 -g -w -o v.exe vc\v_win.c -ladvapi32
|
||||
echo ^> Attempting to build v_win.c with "!tcc_exe!"
|
||||
"!tcc_exe!" -Bthirdparty/tcc -Ithirdparty/stdatomic/win -bt10 -g -w -o v.exe vc\v_win.c -ladvapi32
|
||||
if %ERRORLEVEL% NEQ 0 goto :compile_error
|
||||
|
||||
echo ^> Compiling with .\v.exe self
|
||||
v.exe -keepc -g -showcc -cc "!tcc_exe!" self
|
||||
echo ^> Compiling .\v.exe with itself
|
||||
v.exe -keepc -g -showcc -cc "!tcc_exe!" -cflags -Bthirdparty/tcc -o v2.exe cmd/v
|
||||
if %ERRORLEVEL% NEQ 0 goto :clang_strap
|
||||
del v.exe
|
||||
move v2.exe v.exe
|
||||
goto :success
|
||||
|
||||
|
||||
|
||||
:clang_strap
|
||||
where /q clang
|
||||
if %ERRORLEVEL% NEQ 0 (
|
||||
@ -144,9 +143,11 @@ if %ERRORLEVEL% NEQ 0 (
|
||||
goto :compile_error
|
||||
)
|
||||
|
||||
echo ^> Compiling with .\v.exe self
|
||||
v.exe -keepc -g -showcc -cc clang self
|
||||
echo ^> Compiling .\v.exe with itself
|
||||
v.exe -keepc -g -showcc -cc clang -o v2.exe cmd/v
|
||||
if %ERRORLEVEL% NEQ 0 goto :compile_error
|
||||
del v.exe
|
||||
move v2.exe v.exe
|
||||
goto :success
|
||||
|
||||
:gcc_strap
|
||||
@ -165,9 +166,11 @@ if %ERRORLEVEL% NEQ 0 (
|
||||
goto :compile_error
|
||||
)
|
||||
|
||||
echo ^> Compiling with .\v.exe self
|
||||
v.exe -keepc -g -showcc -cc gcc self
|
||||
echo ^> Compiling .\v.exe with itself
|
||||
v.exe -keepc -g -showcc -cc gcc -o v2.exe cmd/v
|
||||
if %ERRORLEVEL% NEQ 0 goto :compile_error
|
||||
del v.exe
|
||||
move v2.exe v.exe
|
||||
goto :success
|
||||
|
||||
:msvc_strap
|
||||
@ -205,10 +208,12 @@ if %ERRORLEVEL% NEQ 0 (
|
||||
goto :compile_error
|
||||
)
|
||||
|
||||
echo ^> Compiling with .\v.exe self
|
||||
v.exe -keepc -g -showcc -cc msvc self
|
||||
echo ^> Compiling .\v.exe with itself
|
||||
v.exe -keepc -g -showcc -cc msvc -o v2.exe cmd/v
|
||||
del %ObjFile%
|
||||
if %ERRORLEVEL% NEQ 0 goto :compile_error
|
||||
del v.exe
|
||||
move v2.exe v.exe
|
||||
goto :success
|
||||
|
||||
:download_tcc
|
||||
@ -219,11 +224,6 @@ pushd %tcc_dir% && (
|
||||
popd
|
||||
) || call :bootstrap_tcc
|
||||
|
||||
for /f "usebackq delims=" %%i in (`dir "%tcc_dir%" /b /a /s tcc.exe`) do (
|
||||
set "attrib=%%~ai"
|
||||
set "dattrib=%attrib:~0,1%"
|
||||
if /I not "%dattrib%" == "d" set "tcc_exe=%%~sfi"
|
||||
)
|
||||
if [!tcc_exe!] == [] echo ^> TCC not found, even after cloning& goto :error
|
||||
echo.
|
||||
exit /b 0
|
||||
@ -318,7 +318,7 @@ exit /b 0
|
||||
:cloning_vc
|
||||
echo Cloning vc...
|
||||
echo ^> Cloning from remote !vc_url!
|
||||
git clone --depth 1 --quiet %vc_url%
|
||||
git clone --depth 1 --quiet "%vc_url%"
|
||||
exit /b 0
|
||||
|
||||
:eof
|
||||
|
@ -505,10 +505,7 @@ pub fn is_writable_folder(folder string) ?bool {
|
||||
}
|
||||
tmp_folder_name := 'tmp_perm_check_pid_' + getpid().str()
|
||||
tmp_perm_check := join_path_single(folder, tmp_folder_name)
|
||||
mut f := open_file(tmp_perm_check, 'w+', 0o700) or {
|
||||
return error('cannot write to folder $folder: $err')
|
||||
}
|
||||
f.close()
|
||||
write_file(tmp_perm_check, 'test') or { return error('cannot write to folder "$folder": $err') }
|
||||
rm(tmp_perm_check) ?
|
||||
return true
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user