From 906d28e9e46688acd0fb18bf7a4f5180f1401c56 Mon Sep 17 00:00:00 2001 From: spaceface Date: Sun, 14 Mar 2021 17:54:45 +0100 Subject: [PATCH] ci: reduce the number of concurrent jobs (#9301) --- .github/workflows/ci.yml | 333 ++++++++------------ .github/workflows/sokol_shader_examples.yml | 45 --- .github/workflows/websockets.yml | 25 +- 3 files changed, 134 insertions(+), 269 deletions(-) delete mode 100644 .github/workflows/sokol_shader_examples.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index edfab0f0a8..1afbdd68b1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,11 +9,11 @@ on: - "**.md" jobs: - code-formatting: + code-formatting-perf-regressions: runs-on: ubuntu-20.04 timeout-minutes: 30 env: - VFLAGS: -cc tcc + VFLAGS: -cc gcc steps: - uses: actions/checkout@v2 - name: Environment info @@ -25,35 +25,7 @@ jobs: - name: v test-fmt run: ./v -silent test-fmt - # v-fmt: - # runs-on: ubuntu-20.04 - # timeout-minutes: 30 - # steps: - # - uses: actions/checkout@v2 - # - name: getting all branch metainfo from github - # run: | - # git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* - # echo "Changed files compared to origin/master are:" && git diff --name-status origin/master HEAD -- '*.v' - # - name: Build v (there is no need for dependencies for fmt) - # run: make -j4 - # - name: Build a production cmd/tools/vfmt - # run: ./v -prod -d vfmt cmd/tools/vfmt.v - # - name: Run v fmt -diff on only the changed files. Does NOT fail for now. - # run: git diff --name-status origin/master HEAD -- '*.v' |grep -v '^D'|rev|cut -f1|rev| xargs ./v fmt -noerror -diff - # - name: Run v test-fmt - # run: echo "TODO" #./v test-fmt - - performance-regressions: - runs-on: ubuntu-20.04 - timeout-minutes: 30 - 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) + ## Performance regressions - name: Clone & Build vmaster/v run: | git clone --depth=1 https://github.com/vlang/v vmaster/ @@ -74,6 +46,8 @@ jobs: VFLAGS: -cc tcc -no-retry-compilation steps: - uses: actions/checkout@v2 + with: + fetch-depth: 10 - name: Install dependencies run: | sudo rm -f /etc/apt/sources.list.d/dotnetdev.list /etc/apt/sources.list.d/microsoft-prod.list; sudo apt-get update; @@ -128,6 +102,83 @@ jobs: run: | ./v tutorials/building_a_simple_web_blog_with_vweb/code/blog + - name: ensure v up works + run: | + ./v cmd/tools/oldv.v + ./cmd/tools/oldv -v HEAD^^^^^ + cd /tmp/v_at_HEAD_____/ + ./v version + ./v -v up + ./v version + ./v -o v2 cmd/v + ./v2 -o v3 cmd/v + + - name: Shader examples can be build + run: | + wget https://github.com/floooh/sokol-tools-bin/archive/pre-feb2021-api-changes.tar.gz + tar -xf pre-feb2021-api-changes.tar.gz + 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 \ + ; do \ + echo "compiling shader $f.glsl ..."; \ + sokol-tools-bin-pre-feb2021-api-changes/bin/linux/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 + + ## C++ + - name: Install C++ dependencies + run: | + sudo rm -f /etc/apt/sources.list.d/dotnetdev.list /etc/apt/sources.list.d/microsoft-prod.list; + sudo apt-get update; + sudo apt-get install --quiet -y postgresql libpq-dev libssl-dev sqlite3 libsqlite3-dev + sudo apt-get install --quiet -y libglfw3 libglfw3-dev libfreetype6-dev libxi-dev libxcursor-dev libasound2-dev + sudo apt-get install --quiet -y valgrind g++-9 + ## sudo apt-get install --quiet -y libsdl2-dev libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev + - name: Build V + run: make -j4 + - name: g++ version + run: g++-9 --version + - name: V self compilation with g++ + run: ./v -cc g++-9 -o v2 cmd/v && ./v2 -cc g++-9 -o v3 cmd/v + ## - name: Running tests with g++ + ## run: ./v -cc g++-9 -silent test-self + + ## Cross compilation + - name: Install dependencies + run: | + sudo rm -f /etc/apt/sources.list.d/dotnetdev.list /etc/apt/sources.list.d/microsoft-prod.list + sudo apt-get update + sudo apt install --quiet -y mingw-w64 wine-stable winetricks + - name: Build V + run: make -j4 + - name: v.c can be compiled and run + run: | + ./v -os cross -o /tmp/v.c cmd/v + gcc -g -std=gnu11 -w -o v_from_vc /tmp/v.c -lm -lpthread + ls -lart v_from_vc + ./v_from_vc version + - name: turn off the wine crash dialog + run: winetricks nocrashdialog + - name: v_win.c can be compiled and run + run: | + ./v -os windows -o /tmp/v_win.c cmd/v + x86_64-w64-mingw32-gcc /tmp/v_win.c -std=c99 -w -municode -o v_from_vc.exe + ls -lart v_from_vc.exe + wine v_from_vc.exe version + - name: hello_world.v can be cross compiled to hello_world.exe + run: | + ./v -os windows examples/hello_world.v + ls -lart examples/hello_world.exe + wine examples/hello_world.exe + - name: 2048.v can be cross compiled to 2048.exe + run: | + ./v -os windows examples/2048/2048.v + ls -lart examples/2048/2048.exe + + # Alpine docker pre-built container alpine-docker-musl-gcc: name: alpine-musl @@ -437,7 +488,7 @@ jobs: run: make -j4 && ./v -cg -cflags -Werror -o v cmd/v - name: Self tests (-fsanitize=undefined) run: ./v -cflags "-fsanitize=undefined" -o v2 cmd/v && ./v2 -cflags -fsanitize=undefined test-self - + tests-sanitize-undefined-gcc: runs-on: ubuntu-20.04 timeout-minutes: 30 @@ -483,10 +534,10 @@ jobs: - 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) - run: + run: ./v -cflags -fsanitize=address -o v cmd/v && ASAN_OPTIONS=detect_leaks=0 ./v -cc tcc test-self -asan-compiler - + tests-sanitize-address-msvc: runs-on: windows-2019 timeout-minutes: 30 @@ -535,7 +586,7 @@ jobs: - 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) - run: + run: ./v -cflags -fsanitize=address -o v cmd/v && ASAN_OPTIONS=detect_leaks=0 ./v -cc tcc test-self -asan-compiler @@ -630,14 +681,6 @@ jobs: # - name: Self tests # run: ./v -silent test-self - ubuntu-llvm-mingw: - runs-on: ubuntu-20.04 - timeout-minutes: 30 - steps: - - uses: actions/checkout@v2 - # - name: Cross-compile V - # run: docker build . -f Dockerfile.cross - windows-gcc: runs-on: windows-2019 timeout-minutes: 30 @@ -725,7 +768,7 @@ jobs: - name: v2 self compilation run: .\v.exe -o v2.exe cmd/v && .\v2.exe -o v3.exe cmd/v - windows-tcc64: + windows-tcc: runs-on: windows-2019 timeout-minutes: 30 env: @@ -770,26 +813,14 @@ jobs: - name: v2 self compilation run: .\v.exe -o v2.exe cmd/v && .\v2.exe -o v3.exe cmd/v - windows-tcc32: - runs-on: windows-2019 - timeout-minutes: 30 - env: - VFLAGS: -cc tcc -no-retry-compilation - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - with: - node-version: 12.x + ## 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 -w -ladvapi32 -bt10 v.c - - name: Install dependencies - run: | - .\v.exe setup-freetype - .\.github\workflows\windows-install-sqlite.bat - ## .\.github\workflows\windows-install-sdl.bat - name: v doctor run: | ./v doctor @@ -815,120 +846,18 @@ jobs: - name: v2 self compilation run: .\v.exe -o v2.exe cmd/v && .\v2.exe -o v3.exe cmd/v - compilable-v-c-and-v-win-c: - runs-on: ubuntu-20.04 - timeout-minutes: 30 - steps: - - uses: actions/checkout@v2 - - name: Install dependencies - run: | - sudo rm -f /etc/apt/sources.list.d/dotnetdev.list /etc/apt/sources.list.d/microsoft-prod.list - sudo apt-get update - sudo apt install --quiet -y mingw-w64 wine-stable winetricks - - name: Build V - run: make -j4 - - name: v.c can be compiled and run - run: | - ./v -os cross -o /tmp/v.c cmd/v - gcc -g -std=gnu11 -w -o v_from_vc /tmp/v.c -lm -lpthread - ls -lart v_from_vc - ./v_from_vc version - - name: turn off the wine crash dialog - run: winetricks nocrashdialog - - name: v_win.c can be compiled and run - run: | - ./v -os windows -o /tmp/v_win.c cmd/v - x86_64-w64-mingw32-gcc /tmp/v_win.c -std=c99 -w -municode -o v_from_vc.exe - ls -lart v_from_vc.exe - wine v_from_vc.exe version - - name: hello_world.v can be cross compiled to hello_world.exe - run: | - ./v -os windows examples/hello_world.v - ls -lart examples/hello_world.exe - wine examples/hello_world.exe - - name: 2048.v can be cross compiled to 2048.exe - run: | - ./v -os windows examples/2048/2048.v - ls -lart examples/2048/2048.exe - - ubuntu-c-plus-plus: - runs-on: ubuntu-20.04 - timeout-minutes: 30 - steps: - - uses: actions/checkout@v2 - - name: Install dependencies - run: | - sudo rm -f /etc/apt/sources.list.d/dotnetdev.list /etc/apt/sources.list.d/microsoft-prod.list; - sudo apt-get update; - sudo apt-get install --quiet -y postgresql libpq-dev libssl-dev sqlite3 libsqlite3-dev - sudo apt-get install --quiet -y libglfw3 libglfw3-dev libfreetype6-dev libxi-dev libxcursor-dev libasound2-dev - sudo apt-get install --quiet -y valgrind g++-9 - ## sudo apt-get install --quiet -y libsdl2-dev libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev - - name: Build V - run: make -j4 - - name: g++ version - run: g++-9 --version - - name: V self compilation with g++ - run: ./v -cc g++-9 -o v2 cmd/v && ./v2 -cc g++-9 -o v3 cmd/v - ## - name: Running tests with g++ - ## run: ./v -cc g++-9 -silent test-self - - install-modules: - runs-on: ubuntu-20.04 - timeout-minutes: 30 - steps: - - uses: actions/checkout@v2 - - name: Install dependencies - run: sudo apt-get install --quiet -y libssl-dev - - name: Build V - run: make -j4 - - name: Installing V modules - run: | - ./v install ui - ./v install nedpals.args - - gitly-compiles: - runs-on: ubuntu-20.04 - timeout-minutes: 30 - steps: - - uses: actions/checkout@v2 - - name: Install dependencies - run: sudo apt-get install --quiet -y libssl-dev sqlite3 libsqlite3-dev - - name: Build V - run: make -j2 && ./v -cc gcc -o v cmd/v - - name: Install markdown - run: ./v install markdown - - name: Build Gitly - run: | - git clone --depth 1 https://github.com/vlang/gitly - cd gitly - ../v . - ../v -autofree . - cd .. - - vex-compiles: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Install dependencies - run: sudo apt-get install --quiet -y libssl-dev sqlite3 libsqlite3-dev - - name: Build V - run: make - - name: Install Vex - run: ./v install nedpals.vex - - name: Compile the simple Vex example - run: ./v ~/.vmodules/nedpals/vex/examples/simple_example.v - - name: Run Vex Tests - run: ./v test ~/.vmodules/nedpals/vex - parser-silent: name: Parser silent mode runs-on: ubuntu-20.04 timeout-minutes: 30 steps: - uses: actions/checkout@v2 + - name: Install zzuf + run: sudo apt install -qq zzuf - name: Build local v - run: make -j4 + run: | + make -j4 + ./v -g cmd/tools/vtest-parser.v - name: Run test-parser run: | ./v test-parser -S examples/hello_world.v @@ -940,18 +869,6 @@ jobs: ./v test-parser -S examples/regex/regex_example.v ./v test-parser -S examples/2048/2048.v - parser-silent-fuzzing: - name: Parser silent mode fuzzing - runs-on: ubuntu-20.04 - timeout-minutes: 30 - 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 over fuzzed files run: | zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/hello_world.v > examples/hello_world_fuzz.v @@ -968,35 +885,20 @@ jobs: ./v test-parser -S examples/regex_example_fuzz.v ./v test-parser -S examples/2048/2048_fuzz.v - v-up-works-on-ubuntu: - runs-on: ubuntu-20.04 - timeout-minutes: 30 - env: - VFLAGS: -cc tcc - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 10 - - name: Build local v - run: make -j4 - - name: v up - run: | - ./v cmd/tools/oldv.v - ./cmd/tools/oldv -v HEAD^^^^^ - cd /tmp/v_at_HEAD_____/ - ./v version - ./v -v up - ./v version - ./v -o v2 cmd/v - ./v2 -o v3 cmd/v - - vls-compiles: + v-apps-compile: runs-on: ubuntu-20.04 timeout-minutes: 30 steps: - uses: actions/checkout@v2 - name: Build V run: make -j2 && ./v -cc gcc -o v cmd/v + + - name: Installing V modules + run: | + ./v install ui + ./v install nedpals.args + + ## vls - name: Clone VLS run: git clone --depth 1 https://github.com/vlang/vls - name: Build VLS @@ -1004,14 +906,29 @@ jobs: - name: Build VLS with -prod run: cd vls; ../v -prod cmd/vls ; cd .. - vab-compiles: - runs-on: ubuntu-20.04 - timeout-minutes: 30 - steps: - - uses: actions/checkout@v2 - - name: Build V - run: make -j2 && ./v -cc gcc -o v cmd/v + ## vab - name: Clone vab run: git clone --depth 1 https://github.com/vlang/vab - name: Build vab run: cd vab; ../v ./vab.v ; cd .. + + ## vex + - name: Install Vex dependencies + run: sudo apt-get install --quiet -y libssl-dev sqlite3 libsqlite3-dev + - name: Install Vex + run: ./v install nedpals.vex + - name: Compile the simple Vex example + run: ./v ~/.vmodules/nedpals/vex/examples/simple_example.v + - name: Run Vex Tests + run: ./v test ~/.vmodules/nedpals/vex + + ## gitly + - name: Install markdown + run: ./v install markdown + - name: Build Gitly + run: | + git clone --depth 1 https://github.com/vlang/gitly + cd gitly + ../v . + ../v -autofree . + cd .. diff --git a/.github/workflows/sokol_shader_examples.yml b/.github/workflows/sokol_shader_examples.yml deleted file mode 100644 index 84207feb86..0000000000 --- a/.github/workflows/sokol_shader_examples.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Sokol Shader Examples - -on: - push: - branches: - - master - paths-ignore: - - "**.md" - pull_request: - branches: - - master - paths-ignore: - - "**.md" - -jobs: - sokol-shaders-can-be-compiled: - runs-on: ubuntu-20.04 - timeout-minutes: 30 - env: - VFLAGS: -cc tcc -no-retry-compilation - steps: - - uses: actions/checkout@v2 - - name: Install dependencies - run: | - sudo rm -f /etc/apt/sources.list.d/dotnetdev.list /etc/apt/sources.list.d/microsoft-prod.list; sudo apt-get update; - sudo apt-get install --quiet -y libglfw3 libglfw3-dev libfreetype6-dev libxi-dev libxcursor-dev libasound2-dev xfonts-75dpi xfonts-base - - name: Build v - run: | - echo $VFLAGS - make -j4 - ./v -cg -cflags -Werror -o v cmd/v - - name: Shader examples can be build - run: | - wget https://github.com/floooh/sokol-tools-bin/archive/pre-feb2021-api-changes.tar.gz - tar -xf pre-feb2021-api-changes.tar.gz - 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 \ - ; do \ - echo "compiling shader $f.glsl ..."; \ - sokol-tools-bin-pre-feb2021-api-changes/bin/linux/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 diff --git a/.github/workflows/websockets.yml b/.github/workflows/websockets.yml index 2d2212fbbe..1fc45c7e35 100644 --- a/.github/workflows/websockets.yml +++ b/.github/workflows/websockets.yml @@ -29,33 +29,26 @@ jobs: - name: Run websockets tests run: ./v -g test vlib/x/websocket/ - autobahn_tests: - name: Autobahn integrations tests - runs-on: ubuntu-20.04 - timeout-minutes: 20 - steps: - - name: Checkout - uses: actions/checkout@v2 - + ## Autobahn integrations tests - name: Run autobahn services run: docker-compose -f ${{github.workspace}}/vlib/x/websocket/tests/autobahn/docker-compose.yml up -d - + - name: Wait for the service to start run: sleep 10s - - - name: Build client test + + - name: Build client test run: docker exec autobahn_client "/src/v" "/src/vlib/x/websocket/tests/autobahn/autobahn_client.v" - name: Run client test run: docker exec autobahn_client "/src/vlib/x/websocket/tests/autobahn/autobahn_client" - + - name: Build client wss test run: docker exec autobahn_client "/src/v" "/src/vlib/x/websocket/tests/autobahn/autobahn_client_wss.v" - + - name: Run client wss test run: docker exec autobahn_client "/src/vlib/x/websocket/tests/autobahn/autobahn_client_wss" - name: Run server test run: docker exec autobahn_server "wstest" "-m" "fuzzingclient" "-s" "/config/fuzzingclient.json" - + - name: Copy reports run: docker cp autobahn_server:/reports ${{github.workspace}}/reports - name: Copy reports wss @@ -70,13 +63,13 @@ jobs: with: name: full report path: ${{github.workspace}}/reports - + - name: Publish report client uses: actions/upload-artifact@v2 with: name: client path: ${{github.workspace}}/reports/clients/index.html - + - name: Publish report server uses: actions/upload-artifact@v2 with: