From 2790890bc221356a3f8b9be722f4928d3c5af3ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomas=20Hellstr=C3=B6m?= Date: Wed, 8 Jul 2020 20:30:57 +0200 Subject: [PATCH] ci: use pre built docker containers for musl (#5759) --- .github/workflows/ci.yml | 99 +++++++++++++++++---------- cmd/tools/vtest-fixed.v | 11 ++- vlib/v/tests/valgrind/valgrind_test.v | 2 +- 3 files changed, 72 insertions(+), 40 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9fcfdccae..6e4b2f796a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,7 @@ name: CI on: [push, pull_request] jobs: + # v-fmt: # runs-on: ubuntu-18.04 # steps: @@ -51,25 +52,27 @@ jobs: # - name: Test v binaries # run: ./v -silent build-vbinaries + # Alpine docker pre-built container alpine-docker-musl-gcc: name: alpine-musl runs-on: ubuntu-latest - env: - V_CI_MUSL: 1 + container: + image: thevlang/vlang:alpine-build + env: + V_CI_MUSL: 1 + + volumes: + - ${{github.workspace}}:/opt/vlang steps: - - - name: Checkout - uses: actions/checkout@v2 - - - name: Build V - uses: spytheman/docker_alpine_v@v7.0 - with: - entrypoint: .github/workflows/alpine.build.sh - - - name: Test V - uses: spytheman/docker_alpine_v@v7.0 - with: - entrypoint: .github/workflows/alpine.test.sh + - name: Checkout + uses: actions/checkout@v2 + + - name: Build V + run: | + make CC=clang + - name: Test V fixed tests + run: | + v test-fixed macos: runs-on: ${{ matrix.os }} @@ -196,28 +199,52 @@ jobs: - 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-18.04 - env: - VFLAGS: -cc musl-gcc - V_CI_MUSL: 1 + + # Ubuntu docker pre-built container + ubuntu-musl: + name: ubuntu-musl + runs-on: ubuntu-latest + 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: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - with: - node-version: 12.x - - 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 musl musl-tools libssl-dev sqlite3 libsqlite3-dev libsdl2-dev libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev valgrind - - name: Build v - run: echo $VFLAGS && make -j4 && ./v -cg -o v cmd/v -# - name: Test v binaries -# run: ./v -silent 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: Fixed tests - run: ./v test-fixed + - name: Checkout + uses: actions/checkout@v2 + + - name: Build V + run: | + echo $VFLAGS && make -j4 && ./v -cg -o v cmd/v + - name: Test V fixed tests + run: | + v test-fixed + +# ubuntu-musl: +# runs-on: ubuntu-18.04 +# 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 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 musl musl-tools libssl-dev sqlite3 libsqlite3-dev libsdl2-dev libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev valgrind +# - name: Build v +# run: echo $VFLAGS && make -j4 && ./v -cg -o v cmd/v +# # - name: Test v binaries +# # run: ./v -silent 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: Fixed tests +# run: ./v test-fixed ubuntu-llvm-mingw: runs-on: ubuntu-18.04 diff --git a/cmd/tools/vtest-fixed.v b/cmd/tools/vtest-fixed.v index 1f71a4690b..46ba09d4ed 100644 --- a/cmd/tools/vtest-fixed.v +++ b/cmd/tools/vtest-fixed.v @@ -8,14 +8,16 @@ const ( skip_test_files = [ 'vlib/net/http/http_httpbin_test.v', ] - skip_on_musl = [ - 'vlib/net/http/http_test.v', + skip_on_musl = []string{} + skip_on_ubuntu_musl = + [ 'vlib/net/http/cookie_test.v', + 'vlib/net/http/http_test.v', 'vlib/net/websocket/ws_test.v' 'vlib/sqlite/sqlite_test.v', 'vlib/orm/orm_test.v', 'vlib/clipboard/clipboard_test.v', - 'vlib/v/gen/js/jsgen_test.v', + // 'vlib/v/gen/js/jsgen_test.v', ] skip_on_linux = []string{} skip_on_non_linux = [ @@ -49,6 +51,9 @@ fn main() { if os.getenv('V_CI_MUSL').len > 0 { tsession.skip_files << skip_on_musl } + if os.getenv('V_CI_UBUNTU_MUSL').len > 0 { + tsession.skip_files << skip_on_ubuntu_musl + } $if !linux { tsession.skip_files << skip_on_non_linux } diff --git a/vlib/v/tests/valgrind/valgrind_test.v b/vlib/v/tests/valgrind/valgrind_test.v index fba91746eb..2adb5296fc 100644 --- a/vlib/v/tests/valgrind/valgrind_test.v +++ b/vlib/v/tests/valgrind/valgrind_test.v @@ -13,7 +13,7 @@ fn test_all() { eprintln('You can still do it by setting FORCE_VALGRIND_TEST=1 .') exit(0) } - if os.getenv('V_CI_MUSL').len > 0 { + if os.getenv('V_CI_UBUNTU_MUSL').len > 0 { eprintln('This test is disabled for musl.') exit(0) }