Skip to content

Commit

Permalink
Test the vibe-d:http experimental configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
s-ludwig committed Feb 14, 2024
1 parent 8073956 commit fc67aa7
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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


Expand Down
50 changes: 43 additions & 7 deletions run-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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"
Expand All @@ -20,23 +35,26 @@ 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

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
Expand All @@ -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

Expand All @@ -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
Expand Down

0 comments on commit fc67aa7

Please sign in to comment.