From fc67aa7fd920bd129603cb91f700d0327ae88d2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Tue, 9 Feb 2021 20:25:19 +0100 Subject: [PATCH] Test the vibe-d:http experimental configuration. --- .github/workflows/ci.yml | 3 ++- run-ci.sh | 50 ++++++++++++++++++++++++++++++++++------ 2 files changed, 45 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d2f06620..fcd85fe17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,6 +31,7 @@ jobs: - { os: ubuntu-latest, dc: dmd-latest, parts: 'unittests,tests', extra_dflags: "-cov -version=VibedSetCoverageMerge" } # Custom part for vibe-core 1.x.x testing - { os: ubuntu-latest, dc: dmd-latest, parts: 'builds,unittests,tests,vibe-core-1', extra_dflags: '' } + - { os: ubuntu-latest, dc: ldc-latest, parts: 'unittests,examples,tests,vibe-http' } runs-on: ${{ matrix.os }} timeout-minutes: 60 @@ -64,7 +65,7 @@ jobs: ./run-ci.sh - name: '[DMD] Upload coverage to Codecov' - if: matrix.dc == 'dmd-latest' + if: matrix.parts == 'unittests,tests' uses: codecov/codecov-action@v1 diff --git a/run-ci.sh b/run-ci.sh index 4481aa311..b9078e3fc 100755 --- a/run-ci.sh +++ b/run-ci.sh @@ -2,6 +2,9 @@ set -e -x -o pipefail +dub --version +$DC --version + DUB_ARGS="--build-mode=${DUB_BUILD_MODE:-separate} ${DUB_ARGS:-}" # default to run all parts : ${PARTS:=lint,builds,unittests,examples,tests,mongo,meson} @@ -12,6 +15,18 @@ if [[ $PARTS =~ (^|,)vibe-core-1(,|$) ]]; then sed -i "s/\"vibe-core\" version=\">=1\.0\.0 <3\.0\.0-0\"/\"vibe-core\" version=\">=1.0.0 <2.0.0-0\"/g" $RECIPES fi +DUB_ARGS_HTTP=$DUB_ARGS +DUB_ARGS_HTTP_S=$DUB_ARGS + +if [[ $PARTS =~ (^|,)vibe-http(,|$) ]]; then + DUB_ARGS_HTTP="${DUB_ARGS} --override-config vibe-d:http/experimental" +fi + +# TODO: support coverage builds! +#if [[ $PARTS =~ (^|,)coverage(,|$) ]]; then +# DFLAGS="-g -debug -cov -version=VibedSetCoverageMerge" +#fi + if [[ $PARTS =~ (^|,)lint(,|$) ]]; then ./scripts/test_version.sh # Check for trailing whitespace" @@ -20,12 +35,12 @@ fi if [[ $PARTS =~ (^|,)builds(,|$) ]]; then # test for successful release build - dub build --combined -b release --compiler=$DC + dub build --combined -b release --compiler=$DC $DUB_ARGS dub clean --all-packages # test for successful 32-bit build if [ "$DC" == "dmd" ]; then - dub build --combined --arch=x86 + dub build --combined --arch=x86 $DUB_ARGS dub clean --all-packages fi fi @@ -33,10 +48,13 @@ fi if [[ $PARTS =~ (^|,)unittests(,|$) ]]; then dub test :data --compiler=$DC $DUB_ARGS dub test :mongodb --compiler=$DC $DUB_ARGS - dub test :redis --compiler=$DC $DUB_ARGS - dub test :web --compiler=$DC $DUB_ARGS + dub test :redis --compiler=$DC $DUB_ARGS_HTTP + dub test :web --compiler=$DC $DUB_ARGS_HTTP dub test :utils --compiler=$DC $DUB_ARGS - dub test :http --compiler=$DC $DUB_ARGS + # vibe-http is tested on its own, skip it here + if ! [[ $PARTS =~ (^|,)vibe-http(,|$) ]]; then + dub test :http --compiler=$DC $DUB_ARGS + fi dub test :mail --compiler=$DC $DUB_ARGS dub test :stream --compiler=$DC $DUB_ARGS dub test :crypto --compiler=$DC $DUB_ARGS @@ -49,7 +67,16 @@ fi if [[ $PARTS =~ (^|,)examples(,|$) ]]; then for ex in $(\ls -1 examples/); do echo "[INFO] Building example $ex" - (cd examples/$ex && dub build --compiler=$DC $DUB_ARGS && dub clean) + + # determine whether vibe-d:http is involved + if [[ "`dub describe --root=examples/$ex --data=versions`" == *Have_vibe_d_http* ]] + then + ARGS=$DUB_ARGS_HTTP + else + ARGS=$DUB_ARGS + fi + + (cd examples/$ex && dub build --compiler=$DC $ARGS && dub clean) done fi @@ -66,7 +93,16 @@ if [[ $PARTS =~ (^|,)tests(,|$) ]]; then echo "[WARNING] Skipping test $ex due to TravisCI incompatibility". else echo "[INFO] Running test $ex" - (cd tests/$ex && dub --compiler=$DC $DUB_ARGS && dub clean) + + # determine whether vibe-d:http is involved + if [[ "`dub describe --root=tests/$ex --data=versions`" == *Have_vibe_d_http* ]] + then + ARGS=$DUB_ARGS_HTTP + else + ARGS=$DUB_ARGS + fi + + (cd tests/$ex && dub --compiler=$DC $ARGS && dub clean) fi fi done