Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed Oct 16, 2023
1 parent dbeeb74 commit 2b5a5c8
Show file tree
Hide file tree
Showing 9 changed files with 137 additions and 136 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/code_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,25 @@ concurrency:

jobs:
linux-clang:
uses: ./.github/workflows/linux_clang_ci.yml
uses: .github/workflows/linux_clang_ci.yml

linux-gcc:
uses: ./.github/workflows/linux_gcc_ci.yml
uses: .github/workflows/linux_gcc_ci.yml

linux-tcc:
uses: ./.github/workflows/linux_tcc_ci.yml
uses: .github/workflows/linux_tcc_ci.yml

linux-tcc-boehm-gc:
uses: ./.github/workflows/linux_tcc_boehm_gc_ci.yml
uses: .github/workflows/linux_tcc_boehm_gc_ci.yml

macos:
uses: ./.github/workflows/macos_ci.yml
uses: .github/workflows/macos_ci.yml

windows-gcc:
uses: ./.github/workflows/windows_gcc_ci.yml
uses: .github/workflows/windows_gcc_ci.yml

windows-msvc:
uses: ./.github/workflows/windows_msvc_ci.yml
uses: .github/workflows/windows_msvc_ci.yml

windows-tcc:
uses: ./.github/workflows/windows_tcc_ci.yml
uses: .github/workflows/windows_tcc_ci.yml
47 changes: 0 additions & 47 deletions .github/workflows/linux_gcc_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,59 +124,12 @@ jobs:
with:
packages: postgresql libpq-dev libssl-dev sqlite3 libsqlite3-dev valgrind libfreetype6-dev libxi-dev libxcursor-dev libgl-dev
version: 1.0
- name: Build vpm
run: ./v install markdown && git clone --depth 1 https://github.com/vlang/vpm && cd vpm && ../v . || ../v cmd/vpm && cd ..
- name: Build examples
run: ./v build-examples
- name: Build tetris with -autofree
run: ./v -autofree -o tetris examples/tetris/tetris.v
- name: Build blog tutorial with -autofree
run: ./v -autofree -o blog tutorials/building_a_simple_web_blog_with_vweb/code/blog
- name: Build modules
run: |
./v build-module vlib/os
./v build-module vlib/builtin
./v build-module vlib/strconv
./v build-module vlib/time
./v build-module vlib/term
./v build-module vlib/math
./v build-module vlib/strings
./v build-module vlib/v/token
./v build-module vlib/v/ast
./v build-module vlib/v/parser
./v build-module vlib/v/gen/c
./v build-module vlib/v/depgraph
./v build-module vlib/os/cmdline
# - 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 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: Native machine code generation
run: |
./v -o vprod -prod cmd/v
echo "Generating a 1m line V file..."
./vprod cmd/tools/gen1m.v
cmd/tools/gen1m > 1m.v
echo "Building it..."
./vprod -backend native -o 1m 1m.v
echo "Running it..."
./1m
ls
- run: ./v -native examples/native/hello_world.v && examples/native/hello_world
- name: compile vdoctor.v with -skip-unused and -prod
run: ./v -showcc -skip-unused -prod cmd/tools/vdoctor.v
- name: compile vup.v with -skip-unused and -prod
run: ./v -showcc -skip-unused -prod cmd/tools/vup.v
- name: Build option_test.v with -autofree
run: ./v -autofree vlib/v/tests/option_test.v
- name: Self compile with -parallel-cc
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ jobs:
uses: ./.github/workflows/time_ci.yml
with:
os: macos-12
cache_id: ${{ env.CACHE_ID }}

build-modules:
needs: [verify, fmt]
Expand Down Expand Up @@ -152,6 +151,7 @@ jobs:
# sanitized msvc
# below 1h instead of 2h+
# cstrict test with tcc
# re-enalbes native example
# re-enable c2v for mac
# re-enable V UI example compilation
# removes cancel workflow as workflows are in the same concurrency group and will be automatically cancelled by github
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/time_nix_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,8 @@ jobs:
test-nix:
runs-on: ${{ inputs.os }}
steps:
- name: Restore cache
uses: actions/cache/restore@v3
with:
path: ./
key: ${{ inputs.cache_id }}
fail-on-cache-miss: true
- name: Build V
run: make -j4
- name: Test time functions in a timezone UTC-12
run: TZ=Etc/GMT+12 ./v test vlib/time/
- name: Test time functions in a timezone UTC-3
Expand Down
File renamed without changes.
12 changes: 1 addition & 11 deletions .github/workflows/toml_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,44 +29,34 @@ jobs:
sudo apt-get update
sudo apt-get install --quiet -y jq libgc-dev
- name: Build V
run: make -j2 && ./v -cc gcc -o v cmd/v

run: make -j4 && ./v -cc gcc -o v cmd/v
- name: Show JQ Version
run: jq --version

- name: Run local TOML tests
run: ./v test vlib/toml

# Tests found at https://github.com/BurntSushi/toml-test
- name: Clone BurntSushi/toml-test
run: |
git clone -n https://github.com/BurntSushi/toml-test.git $TOML_BS_TESTS_PATH
git -C $TOML_BS_TESTS_PATH checkout $TOML_BS_TESTS_PINNED_COMMIT
- name: Run BurntSushi TOML tests
run: ./v vlib/toml/tests/burntsushi_toml_test.v

# Tests found at gist
- name: Get large_toml_file_test.toml
run: wget https://gist.githubusercontent.com/Larpon/89b0e3d94c6903851ff15559e5df7a05/raw/62a1f87a4e37bf157f2e0bfb32d85d840c98e422/large_toml_file_test.toml -O vlib/toml/tests/testdata/large_toml_file_test.toml

- name: Run large TOML file tests
run: ./v vlib/toml/tests/large_toml_file_test.v

# Tests found at https://github.com/iarna/toml-spec-tests
- name: Clone iarna/toml-spec-tests
run: |
git clone -n https://github.com/iarna/toml-spec-tests.git $TOML_IARNA_TESTS_PATH
git -C $TOML_IARNA_TESTS_PATH checkout $TOML_IARNA_TESTS_PINNED_COMMIT
- name: Run iarna TOML tests
run: ./v -gc boehm vlib/toml/tests/iarna_toml_spec_test.v

# Tests found at https://github.com/alexcrichton/toml-rs
- name: Clone alexcrichton/toml-rs
run: |
git clone -n https://github.com/alexcrichton/toml-rs.git $TOML_AC_TESTS_PATH
git -C $TOML_AC_TESTS_PATH checkout $TOML_AC_TESTS_PINNED_COMMIT
- name: Run alexcrichton TOML tests
run: ./v vlib/toml/tests/alexcrichton_toml_rs_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,77 @@ concurrency:
cancel-in-progress: true

jobs:
v-apps-compile:
internal:
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
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build V
run: make && sudo ./v symlink
- name: Build modules
run: |
v build-module vlib/os
v build-module vlib/builtin
v build-module vlib/strconv
v build-module vlib/time
v build-module vlib/term
v build-module vlib/math
v build-module vlib/strings
v build-module vlib/v/token
v build-module vlib/v/ast
v build-module vlib/v/parser
v build-module vlib/v/gen/c
v build-module vlib/v/depgraph
v build-module vlib/os/cmdline
- name: Build examples
run: v build-examples
- name: Build tetris with -autofree
run: v -autofree -o tetris examples/tetris/tetris.v
- name: Build blog tutorial with -autofree
run: v -autofree -o blog tutorials/building_a_simple_web_blog_with_vweb/code/blog
- name: Build 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: Native machine code generation
run: |
v -o vprod -prod cmd/v
echo "Generating a 1m line V file..."
./vprod cmd/tools/gen1m.v
cmd/tools/gen1m > 1m.v
echo "Building it..."
./vprod -backend native -o 1m 1m.v
echo "Running it..."
./1m
ls
- name: Test v->js
run: ./v -o hi.js examples/hello_v_js.v && node hi.js
- run: v -native examples/native/hello_world.v && examples/native/hello_world
- name: compile vdoctor.v with -skip-unused and -prod
run: v -showcc -skip-unused -prod cmd/tools/vdoctor.v
- name: compile vup.v with -skip-unused and -prod
run: v -showcc -skip-unused -prod cmd/tools/vup.v

other:
runs-on: ubuntu-20.04
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
steps:
- uses: actions/checkout@v4
- name: Build V
run: make && sudo ./v symlink
- name: Build vpm
run: v install markdown && git clone --depth 1 https://github.com/vlang/vpm && cd vpm && ../v . || ../v cmd/vpm
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install --quiet -y libgc-dev libsodium-dev libssl-dev sqlite3 libsqlite3-dev valgrind libfreetype6-dev libxi-dev libxcursor-dev libgl-dev xfonts-75dpi xfonts-base
sudo apt-get install --quiet -y --no-install-recommends gfortran liblapacke-dev libopenblas-dev ## for vsl/vtl
sudo apt-get install --quiet -y --no-install-recommends sassc libgit2-dev ## needed by gitly
sudo apt-get install --quiet -y --no-install-recommends libhdf5-cpp-103 libhdf5-dev libhdf5-mpi-dev hdf5-tools libopenmpi-dev opencl-headers liblapacke-dev libopenblas-dev ## needed by VSL
sudo apt update
sudo apt install -qq -y libgc-dev libsodium-dev libssl-dev sqlite3 libsqlite3-dev valgrind libfreetype6-dev libxi-dev libxcursor-dev libgl-dev xfonts-75dpi xfonts-base
sudo apt install -qq -y gfortran liblapacke-dev libopenblas-dev ## for vsl/vtl
sudo apt install -qq -y sassc libgit2-dev ## needed by gitly
sudo apt install -qq -y libhdf5-cpp-103 libhdf5-dev libhdf5-mpi-dev hdf5-tools libopenmpi-dev opencl-headers liblapacke-dev libopenblas-dev ## needed by VSL
- name: Build vlang/vab
run: |
echo "Install VAB"
Expand Down Expand Up @@ -100,30 +156,6 @@ jobs:
v install ui
echo "Examples of UI should compile"
v ~/.vmodules/ui/examples/build_examples.vsh
- name: Build vlang/vsl
run: |
echo "Installing dependencies"
sudo apt-get install --quiet -y --no-install-recommends \
gfortran \
libxi-dev \
libxcursor-dev \
mesa-common-dev \
liblapacke-dev \
libopenblas-dev \
libgc-dev \
libgl1-mesa-dev \
libopenmpi-dev \
opencl-headers
echo "Install VSL"
v install vsl
echo "Execute Tests using Pure V Backend"
~/.vmodules/vsl/bin/test
echo "Execute Tests using Pure V Backend with Pure V Math"
~/.vmodules/vsl/bin/test --use-cblas
echo "Execute Tests using Pure V Backend and Garbage Collection enabled"
~/.vmodules/vsl/bin/test --use-gc boehm
echo "Execute Tests using Pure V Backend with Pure V Math and Garbage Collection enabled"
~/.vmodules/vsl/bin/test --use-cblas --use-gc boehm
- name: Build vlang/vtl
run: |
echo "Install VTL"
Expand All @@ -137,14 +169,6 @@ jobs:
~/.vmodules/vtl/bin/test --use-gc boehm
echo "Execute Tests using Pure V Backend with Pure V Math and Garbage Collection enabled"
~/.vmodules/vtl/bin/test --use-cblas --use-gc boehm
- name: Build vlang/adventofcode
run: |
echo "Clone the AdventOfCode repo"
git clone --depth 1 https://github.com/vlang/adventofcode /tmp/adventofcode
echo "Install dependencies"
v install pcre
echo "Execute Tests"
cd /tmp/adventofcode && v run verify.v
# - name: Build VEX
# run: |
# echo "Install Vex"
Expand All @@ -155,3 +179,38 @@ jobs:
# v -skip-unused ~/.vmodules/nedpals/vex/examples/simple_example.v
# echo "Run Vex Tests"
# v test ~/.vmodules/nedpals/vex

vsl:
runs-on: ubuntu-20.04
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
steps:
- uses: actions/checkout@v4
- name: Build V
run: make -j4 && sudo ./v symlink
- name: Build vlang/vsl
run: |
echo "Installing dependencies"
sudo apt install -y -qq gfortran libxi-dev libxcursor-dev mesa-common-dev liblapacke-dev libopenblas-dev libgc-dev libgl1-mesa-dev libopenmpi-dev opencl-headers
echo "Install VSL"
v install vsl
echo "Execute Tests using Pure V Backend"
~/.vmodules/vsl/bin/test
echo "Execute Tests using Pure V Backend with Pure V Math"
~/.vmodules/vsl/bin/test --use-cblas
echo "Execute Tests using Pure V Backend and Garbage Collection enabled"
~/.vmodules/vsl/bin/test --use-gc boehm
echo "Execute Tests using Pure V Backend with Pure V Math and Garbage Collection enabled"
~/.vmodules/vsl/bin/test --use-cblas --use-gc boehm
aoc:
runs-on: ubuntu-20.04
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
steps:
- name: Build vlang/adventofcode
run: |
echo "Clone the AdventOfCode repo"
git clone --depth 1 https://github.com/vlang/adventofcode /tmp/adventofcode
echo "Install dependencies"
v install pcre
echo "Execute Tests"
cd /tmp/adventofcode && v run verify.v
4 changes: 2 additions & 2 deletions .github/workflows/vab_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name: vab CI
# - "**.md"

jobs:
vab-compiles-v-examples:
vab-compile-v-examples:
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
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
vab examples/$example -o apks/$safe_name.apk
done
v-compiles-os-android:
vab-compile-to-android:
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: 20
Expand Down
Loading

0 comments on commit 2b5a5c8

Please sign in to comment.